Unconfigured Ad

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

    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.



            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
                      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                      by SEQadmin2



                      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                      ...
                      07-09-2026, 11:10 AM
                    • SEQadmin2
                      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                      by SEQadmin2



                      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                      07-08-2026, 05:17 AM
                    • GATTACAT
                      Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by GATTACAT
                      Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                      07-01-2026, 11:43 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-13-2026, 10:26 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-09-2026, 10:04 AM
                    0 responses
                    31 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-08-2026, 10:08 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-07-2026, 11:05 AM
                    0 responses
                    34 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...