Seqanswers Leaderboard Ad

Collapse

Announcement

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

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

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


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

      Comment


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


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


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


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

              • seqadmin
                Exploring the Dynamics of the Tumor Microenvironment
                by seqadmin




                The complexity of cancer is clearly demonstrated in the diverse ecosystem of the tumor microenvironment (TME). The TME is made up of numerous cell types and its development begins with the changes that happen during oncogenesis. “Genomic mutations, copy number changes, epigenetic alterations, and alternative gene expression occur to varying degrees within the affected tumor cells,” explained Andrea O’Hara, Ph.D., Strategic Technical Specialist at Azenta. “As...
                07-08-2024, 03:19 PM
              • seqadmin
                Exploring Human Diversity Through Large-Scale Omics
                by seqadmin


                In 2003, researchers from the Human Genome Project (HGP) announced the most comprehensive genome to date1. Although the genome wasn’t fully completed until nearly 20 years later2, numerous large-scale projects, such as the International HapMap Project and 1000 Genomes Project, continued the HGP's work, capturing extensive variation and genomic diversity within humans. Recently, newer initiatives have significantly increased in scale and expanded beyond genomics, offering a more detailed...
                06-25-2024, 06:43 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 07-10-2024, 07:30 AM
              0 responses
              19 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 07-03-2024, 09:45 AM
              0 responses
              197 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 07-03-2024, 08:54 AM
              0 responses
              207 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 07-02-2024, 03:00 PM
              0 responses
              190 views
              0 likes
              Last Post seqadmin  
              Working...
              X