Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • esiefker
    Junior Member
    • May 2013
    • 4

    tophat & samtools: accepted_hits0_sorted.0000.bam

    I am encountering an error when running tophat v2.0.8b with samtools 0.1.19+. At the end of a run, during tophat_reports, I get the following error:
    Code:
    Error: [Errno 2] No such file or directory: 'EGFR-tophat/tmp/accepted_hits0_sorted.bam'
    The directory 'EGFR-tophat/tmp' has a bunch of files that look like this:

    accepted_hits0_sorted.0000.bam
    accepted_hits0_sorted.0001.bam
    accepted_hits0_sorted.0002.bam
    ..
    accepted_hits7_sorted.0004.bam
    accepted_hits7_sorted.0005.bam

    On checking 'run.log', it appears that these files are being created with samtools, invoked like this:

    Code:
    /usr/local/bin/samtools sort EGFR-tophat/tmp/accepted_hits0.bam EGFR-tophat/tmp/accepted_hits0_sorted
    And the error is being thrown by samtools, invode like this:
    Code:
    /usr/local/bin/samtools merge -f -h EGFR-tophat/tmp/Homo_sapiens_GRCh37_71_genome.bwt.samheader.sam EGFR-tophat/accepted_hits.bam EGFR-tophat/tmp/accepted_hits0_sorted.bam EGFR-tophat/tmp/accepted_hits1_sorted.bam EGFR-tophat/tmp/accepted_hits2_sorted.bam EGFR-tophat/tmp/accepted_hits3_sorted.bam EGFR-tophat/tmp/accepted_hits4_sorted.bam EGFR-tophat/tmp/accepted_hits5_sorted.bam EGFR-tophat/tmp/accepted_hits6_sorted.bam EGFR-tophat/tmp/accepted_hits7_sorted.bam

    Checking the samtools manual, I see:
    Code:
    This command may also create temporary files <out.prefix>.%d.bam when  the  whole  alignment  cannot  be fitted into memory (controlled by option -m).
    Apparently tophat is not aware that samtools may segment the alignments, and fails to properly merge them. Is there a way to direct tophat to do this? Should I just use --no-sort-bam with tophat? What are the implications of an unsorted bam?

    Meanwhile, can I merge these semented alignments myself and resume tophat? Something like:
    Code:
    samtools merge accepted_hits0_sorted.bam accepted_hits0_sorted.*.bam
    and then resume tophat with -R? Since memory was a limit during the sort, will I run out of memory during the merge? Is there a reason samtools doesn't automatically merge the segmented alignments?
  • esiefker
    Junior Member
    • May 2013
    • 4

    #2
    Originally posted by esiefker View Post

    Meanwhile, can I merge these semented alignments myself and resume tophat? Something like:
    Code:
    samtools merge accepted_hits0_sorted.bam accepted_hits0_sorted.*.bam
    and then resume tophat with -R?
    I tried this, it complained about truncated files.

    [ebs15242@soresearch tmp]$ samtools merge accepted_hits0_sorted.bam accepted_hits0_sorted.*.bam
    [bam_header_read] EOF marker is absent. The input is probably truncated.
    [bam_header_read] EOF marker is absent. The input is probably truncated.
    [bam_header_read] EOF marker is absent. The input is probably truncated.
    [bam_header_read] invalid BAM binary header (this is not a BAM file).
    Segmentation fault
    [ebs15242@soresearch tmp]$ du -hsc !$
    du -hsc accepted_hits0_sorted.*.bam
    228M accepted_hits0_sorted.0000.bam
    226M accepted_hits0_sorted.0001.bam
    177M accepted_hits0_sorted.0002.bam
    236K accepted_hits0_sorted.0003.bam
    16K accepted_hits0_sorted.0004.bam
    0 accepted_hits0_sorted.0005.bam
    0 accepted_hits0_sorted.0006.bam
    630M total
    Why is samtools outputting truncated files? Should I pass it the -m flag? How do I instruct tophat to do that?

    Comment

    • esiefker
      Junior Member
      • May 2013
      • 4

      #3
      Oh, never mind. I was running out of disk space. I was not aware, because tophat removed some temporary files after samtools failed. Making space has gotten me past this error. Hope this experience can help someone else...

      Comment

      • NKAkers
        Member
        • Sep 2011
        • 26

        #4
        Dear esiefker,

        I've just encountered the same error, your post was indeed a big help for me. Thanks!

        Comment

        Latest Articles

        Collapse

        • 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
        • SEQadmin2
          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
          by SEQadmin2



          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
          07-08-2026, 05:17 AM
        • GATTACAT
          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by GATTACAT
          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
          07-01-2026, 11:43 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 10:26 AM
        0 responses
        13 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-09-2026, 10:04 AM
        0 responses
        25 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-08-2026, 10:08 AM
        0 responses
        16 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-07-2026, 11:05 AM
        0 responses
        33 views
        0 reactions
        Last Post SEQadmin2  
        Working...