ALLCools icon indicating copy to clipboard operation
ALLCools copied to clipboard

checking expected strand merge behavior for CG-mC

Open chooliu opened this issue 2 years ago • 0 comments

Hi Hanqing:

Hope you're well!

I was using extract-allc to merge CG counts across strands on version 1.0.8 of allcools. I encountered the following and wanted to check if this was the expected behavior / if you had any recommendations.

Example command:

allcools extract-allc --allc_path $allcin --output_prefix $allcout \
   --mc_contexts CGN --chrom_size_path $refchromsizes --strandness merge

Example region in the output .allc across different samples:

Sample1.allc.tsv.gz
chr22   10525685        -       CGA     2       2       1
chr22   10525686        +       CGG     1       1       1
Sample2.allc.tsv.gz
chr22   10525684        +       CGC     1       1       1
chr22   10525686        +       CGG     1       1       1
Sample3.allc.tsv.gz
chr22   10525684        +       CGC     0       1       1
chr22   10525686        +       CGG     1       1       1
Sample4.allc.tsv.gz
chr22   10525684        +       CGC     1       1       1
chr22   10525686        +       CGG     2       2       1
Sample5.allc.tsv.gz
chr22   10525684        +       CGC     0       3       1
chr22   10525686        +       CGG     1       3       1
Sample6.allc.tsv.gz
chr22   10525685        -       CGA     2       2       1
chr22   10525686        +       CGG     1       1       1

The ultimate goal might be to compare, for example, methylation at that "...84" position across samples. Can't say for certain because I don't have the original alignments, but I wonder if Sample1 and Sample6 may just have happened to have coverage at position 85 but not 84.

Was hoping to check with you if (1) this is the expected output, or if I ran something incorrectly here. More generally, is it (2) more intuitive to make it so strand-merged output is always relative to the cytosine on the reference + strand? If so, not sure if it requires a major code change or a user could just normalize the files by calculating CorrectPos = Pos - 1 when Strand == "-" after extract-allc.

chooliu avatar Mar 21 '23 22:03 chooliu