Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • stuartrbaker
    Junior Member
    • Jan 2011
    • 2

    SAM/CIGAR for deletion before first match

    Hi all,
    This is my first post here. Just searching this site has answered so many questions I've had previously, but I can't find an answer to this one. If I have hard trimmed some bases from the beginning of my reads after alignment, this leaves me with the possibility of a correctly-mapped deletion beginning a read. The SAM spec seems ambiguous to me on this topic, and if this is valid, which position should I take to be the leftmost mapped position? For example, say I hard trim the first three bases from the following aligned read:

    reference: ACTGACGTCA
    read: ACTCGTCA
    CIGAR: 3M2D5M

    This is now:

    read: CGTCA
    CIGAR 3H2D5M

    There may not be a correct answer to this question, so maybe I'm just asking will SAMTOOLS pileup get confused by this?
    Thanks!

    Stuart
  • Heisman
    Senior Member
    • Dec 2010
    • 534

    #2
    I think if you hardclip the first 3 then the CIGAR shouldn't show any deletion; you would be aligning the read "CGTCA", which directly matches the reference.

    Comment

    • stuartrbaker
      Junior Member
      • Jan 2011
      • 2

      #3
      Thank you for your reply. While I can opt out of this behavior from the aligner, I don't want to do this because very much want to retain the deletion. In these cases the deletion is correctly identified and aligned, and actually more "interesting" data than a match. I have written my software to deal with a leading deletion, but I am just curious about whether there is an official usage with SAM.

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #4
        I think your usage looks sane - it would be worth bringing this up on the samtools-devel mailing list. I suspect similar examples could occur in assembly editors, e.g. Gap5 might generate this kind of CIGAR string too after a manual edit.

        Comment

        • jkbonfield
          Senior Member
          • Jul 2008
          • 146

          #5
          I'm not sure what Gap5 will do without checking, but it may depend on whether the usual has manually added gaps with * characters.

          I think starting in a deletion is fine, although it's hard to justify the existance of it instead of a positional change. However given the deleted base does have its own location in the reference I would expect samtools to work, although I haven't verified it.

          Where things start to break down is with sequences that start with an insertion or padding character. This can be a useful and valid alignment, but it causes confusion to samtools as the first used base occurs before the mapping position.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Pathogen Surveillance with Advanced Genomic Tools
            by seqadmin




            The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
            03-24-2025, 11:48 AM
          • seqadmin
            New Genomics Tools and Methods Shared at AGBT 2025
            by seqadmin


            This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

            The Headliner
            The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
            03-03-2025, 01:39 PM
          • seqadmin
            Investigating the Gut Microbiome Through Diet and Spatial Biology
            by seqadmin




            The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
            02-24-2025, 06:31 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 03-20-2025, 05:03 AM
          0 responses
          41 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-19-2025, 07:27 AM
          0 responses
          46 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-18-2025, 12:50 PM
          0 responses
          36 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-03-2025, 01:15 PM
          0 responses
          191 views
          0 reactions
          Last Post seqadmin  
          Working...