I'm having issues with the sorting/indexing of a bam file. I just started working with samtools (and all bioinformatics) last week so I'm pretty new to this.
First I generated a SAM alignment file using STAR. Then I converted that to a BAM file and it seemed to run correctly. But the I try to sort the bam file, and here are my inputs and the resulting output:
samtools sort alignment1.bam alignment1.sorted
[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
If I try to go straight to indexing, I get a similar error:
samtools index alignment1.bam alignment1.bai
[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).
[bam_index_core] Invalid BAM header.[bam_index_build2] fail to index the BAM file.
Can someone help me fix these issues?
Thanks
First I generated a SAM alignment file using STAR. Then I converted that to a BAM file and it seemed to run correctly. But the I try to sort the bam file, and here are my inputs and the resulting output:
samtools sort alignment1.bam alignment1.sorted
[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
If I try to go straight to indexing, I get a similar error:
samtools index alignment1.bam alignment1.bai
[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).
[bam_index_core] Invalid BAM header.[bam_index_build2] fail to index the BAM file.
Can someone help me fix these issues?
Thanks
Comment