fulcrumgenomics / prymer

Python Primer Design Library
https://prymer.readthedocs.io/en/latest/
MIT License
8 stars 0 forks source link

Consider `OffTargetDetector._to_amplicons` specifying alignment strand for primer pairs #76

Open ameynert opened 2 weeks ago

ameynert commented 2 weeks ago

If the primer pair is oriented with the left primer on the positive strand and right primer negative, the amplicon span should have Strand.POSITIVE.

GGTCCAGTTCAAGTGCTGGGAGAGCATCCTCCACAAGGTCTAGTGGTATGGTGGT
L>>>>>>>>>>                                                                                    <<<<<<<<<<R

If the primer pair is oriented with the left primer on the negative strand and the right primer positive, the amplicon span should have Strand.NEGATIVE.

ACCACCATACCACTAGACCTTGTGGAGGATGCTCTCCCAGCACTTGAACTGGACC
R>>>>>>>>>>                                                                                    <<<<<<<<<<L

(randomly generated sequence used as example).

clintval commented 2 weeks ago

I would support this

From what I can tell, when generating an amplicon span from a PrimerPair, we inherit the strand of the primers during replacement of the end property of the left primer span:

https://github.com/fulcrumgenomics/prymer/blob/5d79a52064fbc331e77ed2c626eaf15a85c3d524/prymer/api/primer_pair.py#L252

But we don't account for strand when generating an amplicon span from a pair hit:

https://github.com/fulcrumgenomics/prymer/blob/5d79a52064fbc331e77ed2c626eaf15a85c3d524/prymer/offtarget/offtarget_detector.py#L425