Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tracecakes
    Member
    • Jun 2013
    • 16

    #1

    samtools mpileup -r not working

    Hi all,

    I would like to call SNPs from multiple bam files, one chromosome at a time.

    I used the following command to get a vcf file for chromosome 1:

    samtools mpileup -Q 20 -q 20 -C 50 -EDIuf canfam3.fasta -r 1 -b bamlist.txt | bcftools view -cg -> chr1.vcf

    However it does not work and I get this error message:
    [bam_index_load] fail to load BAM index.
    [mpileup] fail to load index for 1-th input.
    [afs] 0:0.000

    After extensive googling, I got a clue that it may work whilst leaving option r out, and it did start to work:

    command:
    samtools mpileup -Q 20 -q 20 -C 50 -EDIuf canfam3.fasta -b bamlist.txt | bcftools view -cg -> test.vcf

    output:
    [mpileup] 7 samples in 7 input files
    <mpileup> Set max per-file depth to 1142
    [bcfview] 100000 sites processed.
    [afs] 0:99543.747 1:62.399 2:41.907 3:52.140 4:38.329 5:33.845 6:42.816 7:57.233 8:11.331 9:7.889 10:14.342 11:7.750 12:12.551 13:29.424 14:44.296
    [bcfview] 200000 sites processed.
    [afs] 0:99754.577 1:37.872 2:35.226 3:81.483 4:18.848 5:8.106 6:3.562 7:6.604 8:1.895 9:4.640 10:12.232 11:4.209 12:4.845 13:8.355 14:17.546

    Unfortunately there was no other solutions suggested from that.

    Does anyone know why it doesn't work with the "r" option ? I thought the bam files didn't have to be indexed for mpileup... but I still have my original index files (before doing rmdup) anyway.
  • lh3
    Senior Member
    • Feb 2008
    • 686

    #2
    [bam_index_load] fail to load BAM index.
    [mpileup] fail to load index for 1-th input.

    You need to run "samtools index yours.bam"

    Comment

    • tracecakes
      Member
      • Jun 2013
      • 16

      #3
      Thanks for your reply lh3. I have indexed my bam files and its still not working.

      Comment

      • westerman
        Rick Westerman
        • Jun 2008
        • 1104

        #4
        '-r <region>' should work. It works for me. :-) To help in troubleshooting, please do an 'ls -l' of your directory and cat your bamlist.txt file so that we can be sure that you have a good index? Also the first list or two of 'samtools view <one_of_your_files>' so that can be sure that the region names indeed look like '1' instead of something like 'chr1'.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 11:13 AM
        0 responses
        19 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, Yesterday, 10:48 AM
        0 responses
        18 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        36 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        42 views
        0 reactions
        Last Post SEQadmin2  
        Working...