You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When aligning reads with pbmm2 the CIGAR strings use 'X' and '=' instead of 'M'. This causes issues with the split_cigar function in transcript_utils.py. I am trying the following patch to add support pbmm2 CIGAR strings but there may be other places in the code where this could be an issue. Any thoughts on the patch below and support for X/= CIGAR strings would be most appreciated.
--- /sc/arion/work/miniconda3/envs/talon/lib/python3.8/site-packages/talon/transcript_utils.py~ 2023-06-25 10:41:50.811784000 -0400
+++ /sc/arion/work/miniconda3/envs/talon/lib/python3.8/site-packages/talon/transcript_utils.py 2023-07-13 17:26:59.877099000 -0400
@@ -68,6 +68,10 @@
for op,ct in zip(ops, counts):
if op == "M":
matches += ct
+ if op == "X":
+ matches += ct
+ if op == "=":
+ matches += ct
if op == "D":
total_bases += ct
@@ -108,7 +112,7 @@
the number of bases that each operation applies to. """
alignTypes = re.sub('[0-9]', " ", cigar).split()
- counts = re.sub('[A-Z]', " ", cigar).split()
+ counts = re.sub('[A-Z=]', " ", cigar).split()
counts = [int(i) for i in counts]
return alignTypes, counts
@@ -130,7 +134,7 @@
ops, counts = split_cigar(cigar)
for op,ct in zip(ops, counts):
- if op in ["H", "M", "N", "D"]:
+ if op in ["H", "M", "N", "D", "X", "="]:
end += ct
return end - 1
The text was updated successfully, but these errors were encountered:
When aligning reads with pbmm2 the CIGAR strings use 'X' and '=' instead of 'M'. This causes issues with the
split_cigar
function intranscript_utils.py
. I am trying the following patch to add support pbmm2 CIGAR strings but there may be other places in the code where this could be an issue. Any thoughts on the patch below and support for X/= CIGAR strings would be most appreciated.The text was updated successfully, but these errors were encountered: