samtools error
1
0
Entering edit mode
Marcus Davy ▴ 390
@marcus-davy-5153
Last seen 6.1 years ago
I can confirm using bowtie2 to generate sam files, using samtools from the command line to convert sam files to sorted bam files, as well as generating a bam file in R space of the same filesize using asBam() in Rsamtools. Both ways loaded the bam files into R fine using scanBam(). Here is a thread on seqanswers with similar a error to yours; http://seqanswers.com/forums/showthread.php?t=18119 More information is required about your specific problem for anyone to potentially help out, but it looks like there is something inconsistent in your sam file header information. Marcus On Thu, May 31, 2012 at 4:14 PM, Martin Morgan <mtmorgan@fhcrc.org> wrote: > On 05/30/2012 08:57 PM, Yu Chuan Tai wrote: > >> Hi, >> >> I tried to convert a SAM file from Bowtie2 output to a BAM file, >> however, it didn't work. >> > > I guess you're talking about Rsamtools; if you mean samtools, then this is > not the right forum. How did you try to convert the file? It should be > > library(Rsamtools) > asBam("../AlignedData/S1_L001_**001.SAM", "../AlignedData/S1_L001_001") > > What did you try? Also, Bowtie2 will be able to output BAM files directly. > > Martin > > > [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.e="" thz.ch="" mailman="" listinfo="" bioconductor=""> >> Search the archives: >> http://news.gmane.org/gmane.**science.biology.informatics.**conduct or<http: news.gmane.org="" gmane.science.biology.informatics.conductor=""> >> > > > -- > Computational Biology > Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 > > Location: M1-B861 > Telephone: 206 667-2793 > > > ______________________________**_________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/**listinfo/bioconductor<https: stat.et="" hz.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]]
Cancer convert Cancer convert • 3.7k views
ADD COMMENT
0
Entering edit mode
Lucia Peixoto ▴ 330
@lucia-peixoto-4203
Last seen 9.6 years ago
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.et="" hz.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]]
ADD COMMENT

Login before adding your answer.

Traffic: 1006 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6