Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Malfet
    Junior Member
    • Jan 2013
    • 9

    #1

    SAM file without a header. Can't convert to BAM

    Hi, guys! I'm a complete noobie in computational staff and just trying to learn thing. I want to convert SAM file to BAM and my SAM file does not have a header.
    So, I goggle the problem and found one possible solution with -t options from samtools. I created the reference.fa.fai with
    Code:
    samtools faidx reference.fa
    command and then tried to run

    Code:
    samtools view -Sb sam.file -t reference.fa.fai  >  bam.file
    However, I'm getting the error message

    Code:
    [sam_header_read2] 35 sequences loaded.
    Parse error at line 2: missing colon in auxiliary data
    /var/spool/sge//node091/job_scripts/1441097: line 10: 19514 Aborted                 (core dumped) samtools view -Sb $in_file.sam -t /$
    I've tried to use advices from here http://seqanswers.com/forums/showthread.php?t=9650, but still keep getting the same error message.

    Please, help!
  • FractalExpression
    Member
    • Feb 2011
    • 12

    #2
    Maybe try ReplaceSamHeader in Picard http://picard.sourceforge.net/comman...placeSamHeader
    Petri Dish Talk

    Comment

    • Richard Finney
      Senior Member
      • Feb 2009
      • 701

      #3
      Try googling/duckducking your error message ...
      "missing colon in auxiliary data"

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

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


      Sounds like "aux" means the stuff after QUAL(quality filed) in a SAM line (i.e. a text version of the bam record).
      (See line 367 of samtools-0.1.18/bam_import.c ). There's probably invalid OPT (aux) data. That is, the additional annotation information is not properly formatted. Some extra data got a colonectomy or something. (sorry). Just cut out all of the the OPT (aux) data if you don't need it ... something like this ...

      cat original.sam | cut -f1-12 > new.tmp.sam

      or somesuch.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        As Richard mentioned, this means that one of the "tags" in the auxiliary section (the stuff following the quality scores) is malformed. This error is thrown if a tag, including the colons, is less than 6 characters long, or is lacking a colon as the third or fifth character. You might get lucky and just be able to fix the second line of your SAM file in a text editor. Otherwise, you'll need to either cut out the auxiliary info or do a search and replace on the whole file, replacing the affected tag(s).

        Comment

        • Malfet
          Junior Member
          • Jan 2013
          • 9

          #5
          Originally posted by FractalExpression View Post
          Maybe try ReplaceSamHeader in Picard http://picard.sourceforge.net/comman...placeSamHeader
          Thank you very much! Looks like it worked... the resulting file is slightly smaller, that's strange, but end of my old file without header and end of this file are identical, so I'll try to proceed with it further and see what will happen.

          Thanks for your help.

          Comment

          • Malfet
            Junior Member
            • Jan 2013
            • 9

            #6
            Originally posted by Richard Finney View Post
            See previous discussions:
            Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc

            http://seqanswers.com/forums/showthread.php?t=14902
            I tried to follow these advices, but it did not help me and I was still getting the same error message. However, it looks like that the Picardtools suggested by FractalExpression worked, so I'll try to proceed the file.

            Comment

            • swbarnes2
              Senior Member
              • May 2008
              • 910

              #7
              Try

              Code:
              samtools view -Sbh sam.file   >  bam.file
              instead

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                by SEQadmin2



                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                ...
                Today, 09:55 AM
              • SEQadmin2
                New Genomics Technologies Take Aim at Long-Standing Limits
                by SEQadmin2


                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                ...
                09-28-2026, 10:25 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, Today, 05:39 AM
              0 responses
              10 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, Yesterday, 09:56 AM
              0 responses
              13 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-09-2026, 11:14 AM
              0 responses
              26 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 09-29-2026, 09:51 AM
              0 responses
              77 views
              0 reactions
              Last Post SEQadmin2  
              Working...