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:
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:
And the error is being thrown by samtools, invode like this:
Checking the samtools manual, I see:
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:
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?
Code:
Error: [Errno 2] No such file or directory: 'EGFR-tophat/tmp/accepted_hits0_sorted.bam'
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
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).
Meanwhile, can I merge these semented alignments myself and resume tophat? Something like:
Code:
samtools merge accepted_hits0_sorted.bam accepted_hits0_sorted.*.bam
Comment