Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priesgo
    Member
    • Aug 2012
    • 22

    #1

    CRAM compression and TLEN SAM's field

    Hi there,

    I'm evaluating the CRAM compression. So, I'm comparing the same BAM sample pre and post CRAM compression.

    I found that in my data the TLEN (Template Length) field is sistematically modified summing 1 to this value.

    For instance an original read like:
    Code:
    SRR107049.155163702     163     1       69171   44      76M     =       69404   [B][COLOR="Red"]308[/COLOR][/B]     CTATGGAGGAATCGTGTTTGGAAACCTTCTTATTGTCATAACAGTGGTATCTGACTCCCACCTTCACTCTCCCATG    S?;<CC>D=?@=C<>D?A@F?@CC
    D3A?<C?>=>G?CA=:AE>E@HC><??CDAEABD??:9=<AAFCBCABE<>S    RG:Z:SRR107049  NM:i:0  OQ:Z:GGG@AFDE@E@BC@CBFGFFAFEDD4>B9DBD??EDBC?;AD<ADEC>?C=DBDE@AD>A;:;=>EGEBE>BE<A9
    After compression/decompression looks like:
    Code:
    2       163     1       69171   44      76M     =       69404   [B][COLOR="Red"]309[/COLOR][/B]     CTATGGAGGAATCGTGTTTGGAAACCTTCTTATTGTCATAACAGTGGTATCTGACTCCCACCTTCACTCTCCCATG    S?;<CC>D=?@=C<>D?A@F?@CCD3A?<C?>=>G?CA=:AE>E@HC><??CDAEABD??:9=<AAFCBCABE<>S    RG:Z:SRR107049

    Anybody knows something about this issue? I have gone through some posts that talk about differences among the aligners in the TLEN calculation.

    Other changes that are OK for me are the read name which are replaced by numbers and tags which are removed, except the read group tag.


    Thanks!
    Pablo.
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    An issue like that was reported on the cram mailing list last year, actually a Picard bug:
    $ samtools view NA12878.mapped.illumina.mosaik.CEU.exome.20110411.chr20.bam 20:64000-65000 | cut -f -9 SRR098401.102568768 147 20 63932 64 76M = 63912 -95 SRR098401.7377046 99 20 63987 65 76M = 641...


    What version of the cram-tools do you have?

    Comment

    • BAMseek
      Senior Member
      • Apr 2011
      • 124

      #3
      The magnitude of TLEN is "the number of bases from the leftmost mapped base to the rightmost mapped base".

      So you should be able to check the other read and calculate TLEN to see which is right.

      Assuming that the other read also has 76 matches, then I would think

      TLEN = 69404 + 76 - 69171 = 309.

      Which aligner did you use for the original BAM file?

      Justin

      Comment

      • priesgo
        Member
        • Aug 2012
        • 22

        #4
        Thanks for your answers!
        maubp, I am using version 1.00-b244 and it is linked to Picard 1.79.
        Justin, this data is an Illumina exome from the 1000 Genomes Project. As it is reported in the project information, it was aligned with Mosaik (don't know the version).

        By the way this is the mate-pair:
        Code:
        SRR107049.155163702     83      1       69404   39      76M     =       69171   -308    TGGTGACCCCCATAGCCATGGGCTGTGACAGATATAGAGCAATATGCAAGCCCCTACACTACACTACAATTATGTG    ##############################################EABFCC@G?>E=E;<H>F>>F@>B=>>B>S    RG:Z:SRR107049  NM:i:4  OQ:Z:##############################################?CBECCAEC=>;A<:FBDCBDEDDDDADDD
        The value of 309 also makes sense for me. By the way, Justin, I saw you assumed that the mate-pair had a length of 76 just as his mate. And this is correct as you can see above, do mates usually have the same length?


        Pablo.

        Comment

        • BAMseek
          Senior Member
          • Apr 2011
          • 124

          #5
          Hi Pablo,
          Yeah, it looks like Picard might be giving the right answer on this. Not sure which downstream tools rely on TLEN - the only thing I can think of is possibly the genomic viewers.

          Paired-end reads won't necessarily be the same length (for example, if there was some trimming done to the reads to remove adapters). And even if they were the same length, they may not have the same number of aligned bases. To calculate the length of an alignment, I think it is #M (match/mismatch) + #D (deletions) + #N (skips). An alignment can have soft clips (bases at the ends of the read that aren't aligned), and those wouldn't be counted towards the length of the alignment. I just got lucky that it also happened to be 76M.

          best,
          Justin

          Comment

          • priesgo
            Member
            • Aug 2012
            • 22

            #6
            Thanks again Justin,

            Yes, it seems to be an issue with the original file, don't know if coming from mosaik or somewhere else.

            Pablo.

            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
            26 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 10:48 AM
            0 responses
            20 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            36 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            43 views
            0 reactions
            Last Post SEQadmin2  
            Working...