Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Mali Salmon
    Member
    • Jul 2008
    • 24

    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
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    Could it be running it in BAM mode (the "-b" option in "bwa aln").

    Comment

    • Mali Salmon
      Member
      • Jul 2008
      • 24

      #3
      Thanks nil for your reply, but I haven't used the -b option, my input read files are fastq
      Any other idea?
      Mali

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

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

        Nils (not a zero )

        Comment

        • Awesome
          Bioinformatician
          • Aug 2009
          • 7

          #5
          I have the same problem. I would also like to know the solution. Thanks.

          Comment

          • didlefu
            Junior Member
            • Dec 2010
            • 2

            #6
            I have the same problem too.

            Comment

            • didlefu
              Junior Member
              • Dec 2010
              • 2

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

              bwa aln ref.fasta s_1.fq -f s1.aln

              Comment

              • plattsa
                Member
                • Mar 2009
                • 17

                #8
                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.

                Comment

                • M&M
                  Member
                  • May 2011
                  • 10

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

                  Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc


                  Lesson learned: always check for expected output before letting junk alignments run an entire day.

                  Comment

                  • papori
                    Senior Member
                    • Dec 2010
                    • 181

                    #10
                    how to overcome nohup mess??

                    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.

                    Comment

                    • M&M
                      Member
                      • May 2011
                      • 10

                      #11
                      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


                      (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.

                      Comment

                      • AGFB
                        Junior Member
                        • Aug 2012
                        • 1

                        #12
                        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

                        Comment

                        • DZhang
                          Senior Member
                          • Jun 2010
                          • 177

                          #13
                          Mali,

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

                          Best regards,
                          Douglas

                          Comment

                          • sp_wade
                            Junior Member
                            • Mar 2010
                            • 9

                            #14
                            It does work!
                            Thx!

                            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

                            Comment

                            • vyellapa
                              Member
                              • Oct 2011
                              • 59

                              #15
                              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).

                              Comment

                              Latest Articles

                              Collapse

                              • mylaser
                                Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                                by mylaser
                                Kheloyar – Everything You Need to Know About Kheloyaar Login and Kheoyar Id
                                If you are looking for an online gaming platform that offers a user-friendly experience, Kheloyar has become a name that many users search for. Whether you're interested in creating a new account, accessing your dashboard through Kheloyaar Login, or learning how to obtain a Kheoyar Id, understanding the platform's features and account process is essential.
                                This guide explains everything you need to know about...
                                Today, 01:13 AM
                              • SEQadmin2
                                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                                by SEQadmin2



                                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                                ...
                                07-09-2026, 11:10 AM
                              • SEQadmin2
                                Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                                by SEQadmin2



                                Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                                There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                                07-08-2026, 05:17 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 07-09-2026, 10:04 AM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-08-2026, 10:08 AM
                              0 responses
                              10 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-07-2026, 11:05 AM
                              0 responses
                              22 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-02-2026, 11:08 AM
                              0 responses
                              31 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...