SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
bwa sampe very slow natpokah Bioinformatics 25 08-13-2013 10:18 AM
Error when using bwa sampe -r option yjx1217 Bioinformatics 2 01-17-2013 01:11 PM
BWA sampe problem patel Bioinformatics 9 10-24-2011 05:11 AM
bwa sampe problem sszelinger Bioinformatics 3 06-15-2011 05:34 AM
bwa sampe 0.5.7 error? rcorbett Bioinformatics 2 04-22-2010 07:13 AM

Reply
 
Thread Tools
Old 02-16-2011, 01:28 AM   #1
Mali Salmon
Member
 
Location: UK

Join Date: Jul 2008
Posts: 24
Default bwa sampe error

Hi
I'm trying to generate SAM alignment file using BWA version 0.5.9-r16.
I first aligned successfully paired-end reads to the reference using aln:
bwa aln ref.fasta s_1.fq > s1.aln
bwa aln ref.fasta s_2.fq > s2.aln

Then I wanted to use sampe to generate sam file
bws sampe ref.fasta s1.aln s2.aln s_1.fq s_2.fq > s.sam

And i got the following
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[bam_header_read] invalid BAM binary header (this is not a BAM file).
[bwa_read_seq] the maximum barcode length is 15.

Any idea what I did wrong?
Thanks
Mali
Mali Salmon is offline   Reply With Quote
Old 02-16-2011, 06:03 PM   #2
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Could it be running it in BAM mode (the "-b" option in "bwa aln").
nilshomer is offline   Reply With Quote
Old 02-16-2011, 11:51 PM   #3
Mali Salmon
Member
 
Location: UK

Join Date: Jul 2008
Posts: 24
Default

Thanks nil for your reply, but I haven't used the -b option, my input read files are fastq
Any other idea?
Mali
Mali Salmon is offline   Reply With Quote
Old 02-17-2011, 10:19 AM   #4
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Try emailing the bwa help mailling list or sending a PM to lh3 (the author of BWA).

Nils (not a zero )
nilshomer is offline   Reply With Quote
Old 02-17-2011, 04:57 PM   #5
Awesome
Junior Member
 
Location: california

Join Date: Aug 2009
Posts: 7
Default

I have the same problem. I would also like to know the solution. Thanks.
Awesome is offline   Reply With Quote
Old 03-01-2011, 03:04 AM   #6
didlefu
Junior Member
 
Location: Shanghai

Join Date: Dec 2010
Posts: 2
Default

I have the same problem too.
didlefu is offline   Reply With Quote
Old 03-01-2011, 10:45 PM   #7
didlefu
Junior Member
 
Location: Shanghai

Join Date: Dec 2010
Posts: 2
Default

My problem is caused by backstage running.
It works by replacing '>' with '-f'.

bwa aln ref.fasta s_1.fq -f s1.aln
didlefu is offline   Reply With Quote
Old 04-01-2011, 06:41 PM   #8
plattsa
Member
 
Location: Michigan

Join Date: Mar 2009
Posts: 17
Default

I think one easy way to come across this error is by using nohup that can inadvertently result in the console status messages being mixed into the sai output eg

bwa aln ...parameters ... > output.sai

works fine, but

nohup bwa aln ...parameters ... > output.sai &

can generate a completely messed up mix of index and status updates which will cause bwa sampe or samse etc to generate the corrupt header and barcode errors.
plattsa is offline   Reply With Quote
Old 07-08-2011, 07:43 AM   #9
M&M
Member
 
Location: Michigan

Join Date: May 2011
Posts: 10
Default

Plattsa described the source of my error exactly. I found this thread helpful to correct the problem.

http://seqanswers.com/forums/showthread.php?t=12039

Lesson learned: always check for expected output before letting junk alignments run an entire day.
M&M is offline   Reply With Quote
Old 07-29-2011, 05:18 AM   #10
papori
Senior Member
 
Location: berd

Join Date: Dec 2010
Posts: 181
Default how to overcome nohup mess??

Quote:
Originally Posted by plattsa View Post
I think one easy way to come across this error is by using nohup that can inadvertently result in the console status messages being mixed into the sai output eg

bwa aln ...parameters ... > output.sai

works fine, but

nohup bwa aln ...parameters ... > output.sai &

can generate a completely messed up mix of index and status updates which will cause bwa sampe or samse etc to generate the corrupt header and barcode errors.

Hi plattsa,
If i cant stay next to the computer , how can i let the computer run as nohup do, but without its mess??
i found nohup problem only when using BWA aln algorithm...

thanks , papori.
papori is offline   Reply With Quote
Old 07-29-2011, 05:33 AM   #11
M&M
Member
 
Location: Michigan

Join Date: May 2011
Posts: 10
Default Two ways around it

1. Check out Screen. I recommend this because it is easier to keep your jobs organized if you lots of jobs from different programs. I like to open separate 'screens' for each program, and name the screen accordingly. It is essentially like opening a new terminal that you can interactively open close.

Here's a short tutorial
http://ged.msu.edu/angus/tutorials-2...long_jobs.html

(Take a look around the rest of this site too, some great beginner NGS tutorials!)

2. Put your bwa commands in a shell script. Then run
nohup <script.sh> &

This way, the output generated from nohup goes to nohup.out, and the command output is run from inside the script and does not get mixed in.
M&M is offline   Reply With Quote
Old 08-29-2012, 01:17 AM   #12
AGFB
Junior Member
 
Location: switzerland

Join Date: Aug 2012
Posts: 1
Default

although this forum seems out-dated this info may help a poor newbie as it took me a day to solve the problem: as mentioned above if you run bwa aln in the bg you'll receive an error in the next step (bwa sampe) but the second thing you don't wanna forget is when running bwa sampe is the correct order of input files otherwise it won't work: bwa samp ref.fa in1.sai in2.sai in1.fq in2.fa > out.sam
AGFB is offline   Reply With Quote
Old 08-29-2012, 06:36 AM   #13
DZhang
Senior Member
 
Location: East Coast, US

Join Date: Jun 2010
Posts: 177
Default

Mali,

Using .sai instead of .aln may solve your problem.

Best regards,
Douglas
www.contigexpress.com
DZhang is offline   Reply With Quote
Old 08-09-2014, 01:15 AM   #14
sp_wade
Junior Member
 
Location: China

Join Date: Mar 2010
Posts: 9
Smile

It does work!
Thx!

Quote:
Originally Posted by didlefu View Post
My problem is caused by backstage running.
It works by replacing '>' with '-f'.

bwa aln ref.fasta s_1.fq -f s1.aln
sp_wade is offline   Reply With Quote
Old 10-27-2014, 11:25 AM   #15
vyellapa
Member
 
Location: phoenix

Join Date: Oct 2011
Posts: 59
Default

We are getting a similar error when using bams as input with the -b option during bwa aln step. bwa aln completes ok but bwa sampe fails with the error below. Is there a way around it?

[bam_header_read] invalid BAM binary header (this is not a BAM file).
vyellapa is offline   Reply With Quote
Reply

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 09:11 AM.


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