This is a test version of Biostars. For the public version, visit https://www.biostars.org.
why I cant have sam, sorted bam or bed by tophat output?

Hi friends,

My results with below syntaxes:

$TOP/tophat2 \
  --no-coverage-search \
  --no-convert-bam \
  --b2-sensitive \
  --b2-D 20 \
  --b2-R 3 \
  --b2-N 0 \
  --b2-L 20 \
  --read-gap-length 12 \
  --read-mismatches 2 \
  --read-edit-dist 13 \
  --max-insertion-length 20 \
  --max-deletion-length 30 \
  -p 8 \
  -G genes.gtf \
  genome \
  SRR1944914_trimmed_unmapped.fastq

resulting in:

[2015-09-04 09:36:52] Reporting output tracks
    [FAILED]
Error running:
/usr/data/nfs6/izadi/test/tophat-2.1.0.Linux_x86_64/samtools_0.1.18 merge -f -h ./tophat_out/tmp/genome_genome.bwt.samheader.sam -u - ./tophat_out/tmp/accepted_hits0_sorted.bam ./tophat_out/tmp/accepted_hits1_sorted.bam ./tophat_out/tmp/accepted_hits2_sorted.bam ./tophat_out/tmp/accepted_hits3_sorted.bam ./tophat_out/tmp/accepted_hits4_sorted.bam ./tophat_out/tmp/accepted_hits5_sorted.bam ./tophat_out/tmp/accepted_hits6_sorted.bam ./tophat_out/tmp/accepted_hits7_sorted.bam | /usr/data/nfs6/izadi/test/tophat-2.1.0.Linux_x86_64/samtools_0.1.18 view -h -

[izadi@lbox161 bowtie2-2.2.5]$ $TOP/tophat2 --no-coverage-search --no-sort-bam --b2-sensitive --b2-D 20 --b2-R 3 --b2-N 0 --b2-L 20 --read-gap-length 12 --read-mismatches 2 --read-edit-dist 13 --max-insertion-length 20 --max-deletion-length 30 -p 8 -G genes.gtf genome SRR1944914_trimmed_unmapped.fastq[2015-09-04 09:52:18] Reporting output tracks
**[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_0.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_1.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_2.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_3.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_4.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_5.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_6.bam".
[bam_header_read] bgzf_check_EOF: Invalid argument
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[main_samview] fail to read the header from "./tophat_out/tmp/unmapped_left_7.bam".
-----------------------------------------------
[2015-09-04 09:54:10] A summary of the alignment counts can be found in ./tophat_out/align_summary.txt
[2015-09-04 09:54:10] Run complete: 00:06:48 elapsed

When I tried to have a sam output, produced sam was empty. When I tried to have unsorted bam, I got error. How I can have a valid sam please because when I tried to sort accepted_hit.bam I got error. What is the fault please?

bam tophat

1 answer

It seems your SAM / BAM files do not have a header

See this thread and also this one to learn how to add it

Log in to answer this question.