Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • samtools mpileup with many BAM files

    How does samtools mpileup work with hundreds of BAM files? I have a very large, high-coverage dataset that I need to call variants in. I suppose I could just run samtools mpileup ... *.bam, but I feel like that could turn out badly.


    Alternatively, I could call variants in each BAM separately and generate many VCF files. Are there any tools out there that will merge VCF files and do the appropriate math with quality scores / read depths / etc.?

  • #2
    Why do you think it won't work on hundreds of bam files? The files are sorted, so it presumably runs through all the files at once but is only looking at a little data from each file at a given time. I've done work on viral genomes with 20k-30k read depths and had no problems.

    mpileup does have some limitations as to how many reads it will use at any given locus. I believe it's 8000 and is hardcoded in; that may bite you more than runtime issues if you really have that much data. If you're running up against this limit, I can send you a patch to samtools but you'll need to compile samtools yourself.

    Comment


    • #3
      So I found that while samtools does work fine with a large amount of input files, it is much faster to concatenate all the BAM files first, sort the single large file, and run mpileup on that.

      Comment


      • #4
        I think this command is good ...
        samtools mpileup -uD -f <reference>.fasta ./1_sorted.bam ./2_sorted.bam ./3_sorted.bam ./4_sorted.bam | bcftools view -bvcg - > SNPs.raw.bcf
        bcftools view SNPs.raw.bcf | vcfutils.pl varFilter -D100 > SNPs.flt.vcf
        .
        .
        .
        And to SNP counting:

        vcf-stats SNP.flt.vcf > stats.txt
        grep 'snp_count' stats.txt > snp_count.txt
        awk '{sum+=$1} END {print sum}' snp_count.txt

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 08:47 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        60 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        59 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        54 views
        0 likes
        Last Post seqadmin  
        Working...
        X