Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DNAjunk
    Member
    • Jun 2009
    • 62

    #1

    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!
  • drio
    Senior Member
    • Oct 2008
    • 323

    #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

    • DNAjunk
      Member
      • Jun 2009
      • 62

      #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

      • drio
        Senior Member
        • Oct 2008
        • 323

        #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

        • DNAjunk
          Member
          • Jun 2009
          • 62

          #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

          • krobison
            Senior Member
            • Nov 2007
            • 734

            #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

            • lh3
              Senior Member
              • Feb 2008
              • 686

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

              Comment

              • simonandrews
                Simon Andrews
                • May 2009
                • 870

                #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

                • milad621
                  Junior Member
                  • Mar 2012
                  • 2

                  #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

                  • DNAjunk
                    Member
                    • Jun 2009
                    • 62

                    #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

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      The Factors Reshaping Genome Assembly
                      by SEQadmin2



                      When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...
                      11-24-2026, 07:04 AM
                    • SEQadmin2
                      16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                      by SEQadmin2





                      NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
                      10-30-2026, 06:46 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 11-23-2026, 11:11 AM
                    0 responses
                    28 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 11-17-2026, 06:27 AM
                    0 responses
                    41 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 11-12-2026, 07:59 AM
                    0 responses
                    61 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 11-05-2026, 09:25 AM
                    0 responses
                    67 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...