fulcrumgenomics / prymer

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

Decouple `OffTargetDetector` from the `prymer` data structures #81

Open msto opened 4 days ago

msto commented 4 days ago

It'd be helpful if OffTargetDetector did not require Oligo or PrimerPair objects as input.

The off-target detection does not use any of the primer-related metrics that appear on these classes (e.g. tm, penalty), and this design constraint makes it challenging to reuse this functionality in other contexts.

I think the detection methods could be re-written to accept strings (or string tuples, for pair checking) as input. We could also consider accepting a Protocol for any class that includes a sequence or bases attribute.

tfenne commented 2 days ago

My 2c is that this is likely an "and", not an "instead of". I would object to there being two sets of functions:

However, long term I think it is useful to have functions that take the richer objects. There are features I'd like to implement in OffTargetDetector that would require them (or a much more complicated Protocol), including:

The functions that take just strings would not be able to do this, but that doesn't mean we shouldn't have them as an alternative.