I use Bowtie2 to get my sams and then samtools for all post processing
I have encountered the same error before

It  happened to me when for some reason the Bowtie2 run was interrupted, so
that the sam file, although it contained all the headers, did not contain
alignments for some of the headers
aka, your sam file was truncated so that the headers did not exactly match
the alignments

have you checked if you have all the headers corresponding to all the
alignments?

Lucia






On Wed, May 30, 2012 at 11:57 PM, Yu Chuan Tai <yuchuan@stat.berkeley.edu>wrote:

> Hi,
>
> I tried to convert a SAM file from Bowtie2 output to a BAM file, however,
> it didn't work.
>
> [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).
>
> [main_samview] fail to read the header from "../AlignedData/S1_L001_001.**
> SAM".
>
> When I used Bowtie2, I tried to include SAM headers and not include SAM
> headers, both gave me the same error.
> Could anyone tell me what's going on here, since I just started to use
> samtools today.
>
> Thanks!
> Yu Chuan
>
> ______________________________**_________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/bioconductor<https://stat.ethz.ch/mailman/listinfo/bioconductor>
> Search the archives: http://news.gmane.org/gmane.**
> science.biology.informatics.**conductor<http://news.gmane.org/gmane.science.biology.informatics.conductor>
>

	[[alternative HTML version deleted]]

