libnano / primer3-py

Simple oligo analysis and primer design
https://libnano.github.io/primer3-py
GNU General Public License v2.0
157 stars 43 forks source link

(v0.6.1) Bindings fail in python 3.10? #114

Closed kvertacnik closed 1 year ago

kvertacnik commented 1 year ago

primer3.bindings.design_primers() works fine in python 3.11 but if I try 3.10 (because I also need pysam) I get the error: AttributeError: module 'primer3.bindings' has no attribute 'design_primers'. Did you mean: 'designPrimers'?

Then when I try primer3.bindings.designPrimers() I get the error: primerdesign.setSeqArgs(seq_args) TypeError: Value of SEQUENCE_ID is not of type unicode or bytes

Let me know if I can provide additional information. Thanks!

benpruitt commented 1 year ago

The API was all camelCase until v1.0.0 at which point we switched to snake_case, so if you're using v0.6.1 in your Python 3.10 environment, then you should use designPrimers rather than design_primers.

Can you provide the value of SEQUENCE_ID set in your seq_args? Looks like it's probably None or some other type (like int or float) which is resulting in the TypeError. I believe you can omit it entirely and everything should be fine, but if you include it, it needs to be bytes or a str (ref)

kvertacnik commented 1 year ago

Thanks for pointing me towards the right error message!