Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kz26
    Junior Member
    • Jun 2010
    • 8

    #1

    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.?
  • arolfe
    Member
    • Jul 2011
    • 29

    #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

    • kz26
      Junior Member
      • Jun 2010
      • 8

      #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

      • arthurmelo
        Member
        • Jul 2012
        • 19

        #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

        • SEQadmin2
          Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
          by SEQadmin2



          CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

          Despite this, “CRISPR helped turn genome editing from a specialized technique into
          ...
          07-31-2026, 11:01 AM
        • SEQadmin2
          Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
          by SEQadmin2


          Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

          The systematic characterization of the human proteome has
          ...
          07-20-2026, 11:48 AM
        • SEQadmin2
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Today, 10:13 AM
        0 responses
        10 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-31-2026, 02:55 AM
        0 responses
        23 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-24-2026, 12:17 PM
        0 responses
        19 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-23-2026, 11:41 AM
        0 responses
        17 views
        0 reactions
        Last Post SEQadmin2  
        Working...