Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • samtools: parse error in SAM to BAM conversion

    Greetings, I am a novice user with little experience running command line software. I am enjoying learning, though error messages leave me at a loss.

    Background: I used bwa to create my SAM file. When I attempt to use the "view" option to convert to BAM I receive the following:

    [samopen] SAM header is present: 100 sequences.
    Parse error at line 18750817: unmatched CIGAR operation
    Aborted

    I am unclear as to what the problem is. Any guidance?

    -Chris

  • #2
    Originally posted by chrisW View Post
    Greetings, I am a novice user with little experience running command line software. I am enjoying learning, though error messages leave me at a loss.

    Background: I used bwa to create my SAM file. When I attempt to use the "view" option to convert to BAM I receive the following:

    [samopen] SAM header is present: 100 sequences.
    Parse error at line 18750817: unmatched CIGAR operation
    Aborted

    I am unclear as to what the problem is. Any guidance?

    -Chris
    It may be a bug in the program that produced the BAM; you may be able to post on that program's help mailing list. Optionally, you could print out line "18750817" to show us the offending line.

    Comment


    • #3
      Thank you for getting back to me. I don't know how to get text from the terminal and paste it into these forum windows. I did, however, look at the offending line. It is missing the actual nucleotide and associated Illumina information. Is there an easy way to explain how I can get terminal screen printout into a form I can "cut/paste"? I could then show you exactly what I'm seeing.

      Based on your comments, it appears that bwa perhaps introduced an error in creating the SAM file ...or there may be something off in the datafiles I'm feeding into bwa?

      Again, I appreciate your willingness to help. There is a steep learning curve for me as I've never had any Unix training. I just learned the "sed" function to look at the offending line and see what was wrong.
      -Chris

      Comment


      • #4
        is it the last line in output? i guess it is truncated.

        Comment


        • #5
          No, it's not the last line in output. I'm not sure of the line's exact position in the SAM file, but I printed out the lines prior and after the offending line and they are intact with a nucleotide string followed by what I understand to be Illumina information (perhaps pertaining to quality of the nucleotide call?)

          I would show you what I'm seeing but I don't know how to get output from my terminal window into a form that I can post, other than typing verbatim what I'm seeing into these chat windows. There must be an easier way.

          At this point I don't know if this offending line is the only one in my SAM file or if there are others. It just appears to be the first and thus aborts the SAM --> BAM conversion.

          Thanks for you help.

          Comment


          • #6
            Figured out my terminal to chat cut/paste. So, here are three lines from my .sam file. The middle line is the offending line that brings up the "unmatched CIGAR operation".

            output/

            chriswall@ubuntu:/host/Users/chris.wall/Desktop/Mastigo-genomics/bwa_cw$ sed '18750816,18750818!d' WC.sam
            ILLUMINA-2F52BD:6:50:1169:1446#0 163 NODE_37776_length_48465_cov_160.191483\par 35442 29 59M = 35600 217 TTTTATCGGTGTGTATCGGTGTGTATCGGTGGGCGAGTTTTCAACAAGATTATGGGGCA gggfggggfdae[_aee_eeZ_^]_`aaeS]\FY\`dWZ]_^`_`WcSZXg`dgfcbYV XT:A:U NM:i:2 SM:i:0 AM:i:0 X0:i:1 X1:i:2 XM:i:2 XO:i:0 XG:i:0 MD:Z:7T27G23

            ILLUMINA-2F52BD:6:50:1169:1947#0 83 NODE_51983_length_172857_cov_173.044144\par 119160 60 5 XT:A:U NM:i:1 SM:i:37 AM:i:37 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:39C19

            ILLUMINA-2F52BD:6:50:1178:417#0 83 NODE_43256_length_74978_cov_171.684830\par 68201 60 59M = 67821 -439 CAGAGAAAAGACAGGTGATTATCAGACAACCTACGGATTGATAGGAATTTTGAACCGCA bgdgbgfgf^dddddgdfgffggfbaggZefeae\ggggbfgggegfggggcg`feffe XT:A:U NM:i:0 SM:i:37 AM:i:37 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:59

            /output

            Can this offending line and perhaps any subsequent offending lines be deleted from the .sam file and not introduce a problem?

            Comment


            • #7
              The sequence and qualities are also missing along with the CIGAR. What program generated the SAM file?

              Comment


              • #8
                bwa 0.5.5 package from Ubuntu

                Comment


                • #9
                  Originally posted by chrisW View Post
                  bwa 0.5.5 package from Ubuntu
                  Try the latest source code from the BWA SVN repository.

                  Comment


                  • #10
                    actually 0.5.5 is more stable than the latest release. 1KG has been using it to map >20TB of data and it never fails.

                    Comment


                    • #11
                      Any suggestions for the missing CIGAR?

                      Comment


                      • #12
                        I guess this is a disk error or input error. It is quite unlikely to happen if you read the source code on printing alignments. It has never happened before.

                        Comment


                        • #13
                          parse error using samtools view -bT, ValidateSamFile output: empty seq dictionary!

                          Originally posted by lh3 View Post
                          I guess this is a disk error or input error. It is quite unlikely to happen if you read the source code on printing alignments. It has never happened before.
                          Hello Everyone,
                          I am having trouble converting the sam files to bam using samtools. I used this cmd to convert my sam to bam -

                          samtools view -bT hg19.fa s_chip2.sam > s_chip2.bam
                          I got this error.
                          Parse error at line 7707082: sequence and quality are inconsistent
                          Aborted



                          I ran ValidateSamFile.jar, a picard tool and got the following error, hundreds of them -

                          WARNING: Read name HWI-ST798R:82: D18MUACXX:2:1101:2025:1987, A record is missing a read group
                          ERROR: Record 5, Read name HWI-ST798R:82: D18MUACXX:2:1101:8625:1992, Empty sequence dictionary.


                          I am not sure how to fix this, any help is appreciated.

                          Comment

                          Latest Articles

                          Collapse

                          • seqadmin
                            Essential Discoveries and Tools in Epitranscriptomics
                            by seqadmin


                            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                            Today, 07:01 AM
                          • seqadmin
                            Current Approaches to Protein Sequencing
                            by seqadmin


                            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                            04-04-2024, 04:25 PM

                          ad_right_rmr

                          Collapse

                          News

                          Collapse

                          Topics Statistics Last Post
                          Started by seqadmin, 04-11-2024, 12:08 PM
                          0 responses
                          37 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 04-10-2024, 10:19 PM
                          0 responses
                          41 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 04-10-2024, 09:21 AM
                          0 responses
                          35 views
                          0 likes
                          Last Post seqadmin  
                          Started by seqadmin, 04-04-2024, 09:00 AM
                          0 responses
                          54 views
                          0 likes
                          Last Post seqadmin  
                          Working...
                          X