libnano / primer3-py

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

`ThermalAnalysis.run_design` is now thread-safe #96

Closed grinner closed 1 year ago

grinner commented 1 year ago

ThermalAnalysis.run_design is now thread-safe using updated code in new libprimer3flex.c which is refactored from libprimer3.c

  1. renamed seq_args c struct t seq_args_t to prevent namespace collision in localizing seq_args_t data to the ThermalAnalysis class attributes

  2. The primary goals of this libprimer3flex.c library are: a. Remove global variables to make library threadsafe

     1) `pairs` and `max_j_seen` variables are passed as members of `pairs_args_t`
     2) `dpal_arg_to_use`, `thal_arg_to_use` and `thal_olgio_arg_to_use` static variables are now passed in as arguments to `choose_primers()` 
     3) `thermodynamic_alignment_length_error` and `thermodynamic_alignment_length_error_msg` added into `thal_arg_holder` as a matter-of-convenience
    
        i.  `align_thermod` to use 
        ii: `oligo_template_mispriming` 
        ii. `reset_thermodynamic_alignment_length_error()` to reset it

    b. Keep the library C code C instead of C++ code to provide a uniform C interface

  3. test_threadsafe.py now passes primer design tests.