Unconfigured Ad

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

    #1

    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

          • SEQadmin2
            16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
            by SEQadmin2




            NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
            Today, 06:46 AM
          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-28-2026, 09:57 AM
          0 responses
          22 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-28-2026, 09:51 AM
          0 responses
          14 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          67 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          47 views
          0 reactions
          Last Post SEQadmin2  
          Working...