Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
BWA sam and Samtools sam->bam conversion problem maasha Bioinformatics 6 06-05-2013 07:39 AM
merging bam files with different headers dnusol Bioinformatics 2 02-06-2012 11:09 PM
space character in headers frymor Bioinformatics 6 11-03-2011 07:11 AM
.SAM to .BAM with SAM file header @PG emilyjia2000 Bioinformatics 13 06-14-2011 12:21 PM
Question on SAMtools variations calling of a BFAST-aligned SAM file? Ling Bioinformatics 4 02-02-2010 06:26 PM

Thread Tools
Old 11-02-2011, 06:23 AM   #1
Irina Pulyakhina
Location: Oxford

Join Date: Sep 2010
Posts: 24
Default samtools sam file no headers

Dear all,

I have the following problem: my sam file contain no headers, so I can't convert it to bam directly, I get the following error:

> samtools view -S accepted_hits.sam
The tag [ID] required for [PG] not present.
[samopen] no @SQ lines in the header.
[sam_read1] missing header? Abort!

With previous version of samtools you could use "-t" option for this case, but now it doesn't exist anymore:

> samtools view -tS accepted_hits.sam
The tag [ID] required for [PG] not present.
[main_samview] fail to open "accepted_hits.sam" for reading.

So does anyone now how to create bam file from a sam file without headers?

Thanks in advance,
Irina Pulyakhina is offline   Reply With Quote
Old 11-02-2011, 06:34 AM   #2
Location: Cambridge, United Kingdom

Join Date: Jun 2011
Posts: 58

You can try -T ref.fasta (or -t):

samtools view -T /path/to/ref/fasta accepted_hits.sam

cjp is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 07:40 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO