Header Leaderboard Ad

Collapse

How to create a SAM/BAM file from scratch

Collapse

Announcement

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

  • How to create a SAM/BAM file from scratch

    Hi
    Does anybody have written a script or programme that creates a SAM or BAM file based on the following alignment information:

    1) 454-reads
    2) read qualtities
    3) reference sequence(s)
    4) read alignment information (e.g. read X aligns from (read-)position X_i to position X_j with reference Y, position Y_i to Y_j )

    Many thanks for suggestions!

  • #2
    Normally that is being taken care by your aligner of choice. Doesn't your aligner dump alignments in S|Bam format? If you still want to create your bams, take a look to the samtools API or the picard tools (both have examples on how to use the api). Also, you may want to take a pick to the source code of the bwa, bfast, etc... to see how they dump the alignments in BAM format.
    -drd

    Comment


    • #3
      I am using a in-house mapping program that works fine, however it doesn't create BAM/SAM output (also gsMapper/newbler doesn't generate BAM/SAM, right?)

      Comment


      • #4
        I am not sure about gsMapper, I think newbler does not dump in SAM/BAM format currently. What's the programming language you use in your in-house mapper? I'd suggest you add support to bam/sam at the core of the tool.
        -drd

        Comment


        • #5
          it is written in C programming language.

          I've tried to convert ACE files via AMOS to SAM, but there were too many errors during conversion...

          Comment


          • #6
            Read the SAM documentation carefully; it should be pretty easy to make a basic SAM file (I'm considering crossing this bridge myself for a small custom realigner) without much trouble.

            http://samtools.sourceforge.net/SAM1.pdf

            After one go at it, re-posting with any specific challenges/questions (or success!) would probably help us both work through it.
            Last edited by krobison; 09-08-2010, 06:01 AM.

            Comment


            • #7
              Ssaha2 (G1K is using that) or bwasw or novoalign (have not tried).

              Comment


              • #8
                BAM is trickier, but writing SAM files is pretty straight forward. The trickiest part is getting the flag values set correctly, which can be a pain if you're not used to bitwise operations. There have been quite a few posts on here which covered that though.

                Comment


                • #9
                  I have the same problem. How did you solve your's DNAjunk?
                  I want to create a same file from sequence reads, the reference genome, and matched positions.
                  Is there any open source software to create sam file with just these informations?

                  Comment


                  • #10
                    Hi

                    I did not proceed making my own sam/bam files.

                    As for 454 read-mapping, the latest 454 mapping software can create BAM files. Also, GMAP, which I often use, outputs alignments in SAM format.

                    Comment

                    Working...
                    X