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
            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
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          33 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          23 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          41 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          45 views
          0 reactions
          Last Post SEQadmin2  
          Working...