Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • BWA sam and Samtools sam->bam conversion problem

    Hello all,

    I have a SAM file create with BWA, but I cannot convert it to BAM because of the following:

    samtools view -S foo.sam -b -o foo.bam
    [samopen] no @SQ lines in the header.
    [main_samview] random alignment retrieval only works for indexed BAM files.



    The SAM file looks like this:


    head foo.sam
    5_gECOjxwXsN1 0 contig00025 28520 37 35M = 28520 0 AACGNTACTATCGTGACATGCGTGCAGGATTACAC abb^D[a`ab^`Y`a_[___^[ON\X`_Y]`_aa\ XT:A:U NM:i:1 X0:i:1 X1:i:0 XM:i:1 XO:i:0 XG:i:0 MD:Z:4T30
    3_8ICOjxwXsN1 4 * 0 0 * * 0 0 ACTCNAGGGTTCGATTCCCTTCAACCGCCCCATAA a`WYD[aaaW_^_[^^W`]`]\^`\V][[_]QV\\
    3_GUCOjxwXsN1 4 * 0 0 * * 0 0 TTGCNTCCTTCTTCTGCCTTCGTTGGCTCAGATTG `aaYDRb_a[a`]^X^`]`aa`]XVT]R[^`TZVY
    5_BWCOjxwXsN1 0 contig00138 59297 37 35M = 59297 0 TATATACAGGAATCCATTGTTGTTTAGATTCAGTT ab`b`baaaa`b``ZY]YW^aS[_]OLT_VRS]UZ XT:A:U NM:i:0 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:35
    7_NZCOjxwXsN1 16 contig00115 1617 37 35M = 1617 0 AGGTAGCCGTATCGGAAGGTGCGGCTGGATCACCT MSKNT\V^TSWW`\`Z^Z\Q\\___a`a_`ZDY`] XT:A:U NM:i:0 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:35
    3_2VCOjxwXsN1 16 contig00005 66001 37 35M = 66001 0 CTTAATGGGTGAAGATGTCTACACACCTGGAAAAG aaaaa`a``aa_aaaa`aab_b`b[aabaaaabaa XT:A:U NM:i:0 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:35
    5_kVCOjxwXsN1 4 * 0 0 * * 0 0 CTACACCTAAGTTACATCGTCCATTATTTTCCAAT aaaaaaaabaa_aa_a__a^a[[``\a`a][\`[_
    1_GbCOjxwXsN1 0 contig00105 1098 37 35M = 1098 0 CCAGACAACTAGGATGTTGGCTTAGAAGCAGCCAT ```_aabaaa`ba`Y`S[_`_^]a^a`_YaYSUXT XT:A:U NM:i:0 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:35
    5_fTCOjxwXsN1 4 * 0 0 * * 0 0 TTAGCTTTAACCATTTTCTTTTTGTCTAAAGCAAA aabb__\_aaabU_^^[^`[\_`aWaa``_^a``_
    3_VWCOjxwXsN1 16 contig00027 14175 37 35M = 14175 0 GTTTAACGCGTTCACGTTCGCCACGCGCATCATAA T\`a\\a]]V]aa_aaaaaaaaY`abab_aaabba XT:A:U NM:i:0 X0:i:1 X1:i:0 XM:i:0 XO:i:0 XG:i:0 MD:Z:35



    Suggestions are welcome.



    Martin

  • #2
    Originally posted by maasha View Post
    samtools view -S foo.sam -b -o foo.bam
    Try
    Code:
    samtools view -S -b foo.sam > foo.bam
    There is no argument to the -S option.

    Comment


    • #3
      In addition, please use the latest bwa-0.5.4. 0.4.9 does not print SAM header.

      Comment


      • #4
        Yup, it was a BWA version problem. I did not realize that BWA now have its own spot on Sourceforge - with newer versions than 0.5.0. The Maq website is misleading (at least it mislead me ).

        All is good now. Thanks.

        Comment


        • #5
          Hi
          I used your command, but seems it is not working properly
          samtools view -S -b SAM.sam' > bam1.bam
          Why I got the following line:
          [samopen] SAM header is present: 94 sequences.

          Finally I got the BAM file, but it is empty

          Comment


          • #6
            i use the latest SRA tool kit to convert sra to sam but also no header. (-S -b -r )

            Comment


            • #7
              I am using the latest version of BWA and SAMTOOLS. I get following error when trying to convert from SAM to BAM with the following command:

              samtools view -bS chunkalign.1.sam > chunkalign.1.bam

              Parse warning at line 27: mapped sequence without CIGAR
              Parse error at line 27: sequence and quality are inconsistent
              Aborted

              Comment

              Latest Articles

              Collapse

              • 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
              • seqadmin
                Strategies for Sequencing Challenging Samples
                by seqadmin


                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                03-22-2024, 06:39 AM

              ad_right_rmr

              Collapse

              News

              Collapse

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