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.



            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
                      Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                      by SEQadmin2



                      CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                      Despite this, “CRISPR helped turn genome editing from a specialized technique into
                      ...
                      07-31-2026, 11:01 AM
                    • SEQadmin2
                      Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                      by SEQadmin2


                      Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                      The systematic characterization of the human proteome has
                      ...
                      07-20-2026, 11:48 AM
                    • 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

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 07-31-2026, 02:55 AM
                    0 responses
                    18 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-24-2026, 12:17 PM
                    0 responses
                    16 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-23-2026, 11:41 AM
                    0 responses
                    16 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-20-2026, 11:10 AM
                    0 responses
                    26 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...