Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThermalAnalysis.run_design is now thread-safe #96

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

grinner
Copy link
Contributor

@grinner grinner commented Mar 22, 2023

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.

@grinner grinner requested a review from benpruitt March 22, 2023 00:35
benpruitt
benpruitt previously approved these changes Mar 22, 2023
…sion

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

The primary goals of this `libprimer3flex.c` library are:
1. Remove global variables to make library threadsafe
    a. `pairs` and `max_j_seen` variables are passed as members of `pairs_args_t`
    b. `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()`
    c. `thermodynamic_alignment_length_error` and `thermodynamic_alignment_length_error_msg`
        added into `thal_arg_holder` as a matter-of-convenience and
      i.  `align_thermod` to use
      ii: `oligo_template_mispriming`
        ii. `reset_thermodynamic_alignment_length_error() to reset it
2. Make the library C code instead of C++ code to provide a uniform C
    interface

tests:
    test_threadsafe.py now passes primer design tests.

    split primer design thread safety test into its own test
@grinner grinner merged commit c820fe7 into libnano:1.2.0-staging Mar 22, 2023
@grinner grinner deleted the grinner-seq_args_t-rename branch March 22, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants