Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • query
    Junior Member
    • Feb 2009
    • 3

    BAM/SAM to a gapped multiple sequence alignment

    Are there any tools out there that would convert a SAM/BAM file to a gapped multiple sequence alignment of the reads and the reference? I am looking for a text formatted output (like fasta) of this rather than a vizualization tool.
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    It is a non trivial task since the SAM/BAM format isn't a multiple sequence alignment but a collection of pairwise alignments to the reference. The problem comes with conflicting inserts.

    e.g. Suppose the first insert is between columns 10 and 11. Most reads say there is no insert here, one read says there should a A, another says AT, a third ATG and a forth says TG. How do you align that? Maybe:

    --- (most reads)
    A--
    AT-
    ATG
    -TG

    That was a fairly easy example - but what if there was another group of reads with an insert of C at this point?

    My point is the conversion would require doing this kind of realignment for every insert.

    Comment

    • lh3
      Senior Member
      • Feb 2008
      • 686

      #3
      This is why SAM has a "P" operation, but for now few use that.

      Comment

      • query
        Junior Member
        • Feb 2009
        • 3

        #4
        I understand that this is non-trivial and choices have to be made. I was wondering if a trivial converter that mostly assumes single-base insertions and makes the most obvious choices for a multi-base insertions was available.

        Are there any aligners present that provide the padding information?

        Comment

        • jkbonfield
          Senior Member
          • Jul 2008
          • 146

          #5
          Originally posted by query View Post
          Are there any tools out there that would convert a SAM/BAM file to a gapped multiple sequence alignment of the reads and the reference? I am looking for a text formatted output (like fasta) of this rather than a vizualization tool.
          I had some code that performed a column wise "samtools pileup", so insertions would get their own rows in the output rather than shoehorning them into the same line via +seq. It needs some tidying up as it's no longer so standalone (it's part of my BAM reading code in Gap5), but could be made so again if it's useful.

          As others have pointed out this is only half the problem though. It's not going to get your data aligned better and put P CIGAR operators in. I'm not aware of tools to automatically do this, but I'm sure some must exist.

          Comment

          • Sylphide
            Member
            • Feb 2011
            • 11

            #6
            I would also like to obtain "alignments" from SAM/BAM. Since the samtools tview allows to view the alignment it should be possible to obtain these "alignments" in text format, no ?

            Comment

            • himakr
              Junior Member
              • Mar 2011
              • 3

              #7
              SAM/BAM Learning

              Hi,

              Can anyone help me in learning SAM/BAM and PileUp? Any tutorial avalable for self study?

              Hima
              Hima Raman
              Università Milano Bicocca
              Dip. medicina clinica e prevenzione
              via Cadore, 48
              20052 Monza (MB)

              Comment

              Latest Articles

              Collapse

              • 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.

                Introduction

                The systematic characterization
                ...
                Today, 10:07 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
              • 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

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 07-13-2026, 10:26 AM
              0 responses
              28 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-09-2026, 10:04 AM
              0 responses
              38 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-08-2026, 10:08 AM
              0 responses
              25 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-07-2026, 11:05 AM
              0 responses
              35 views
              0 reactions
              Last Post SEQadmin2  
              Working...