Unconfigured Ad

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

    #1

    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
          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, 10-22-2026, 11:13 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        44 views
        0 reactions
        Last Post SEQadmin2  
        Working...