Skip to content

Commit

Permalink
2.0.0 release (libnano#113)
Browse files Browse the repository at this point in the history
* migrated primer3 header file Cython extern imports to `thermoanalysis.pxi` (libnano#100)

Optional C structure string argument `c_ascii_structure` added to `_ThermoAnalysis`
methods to enable 3rd party use for structures

version bump to 2.0.0a1 due to breaking change

* fix for issue 108 whereby no_structure is not correctly 1 set to 1 when no secondary structure in found (libnano#109)

* Issue 50 update to add list version of (libnano#110)

PRIMER_{PAIR, LEFT, RIGHT, INTERNAL} output dictionary keys.
Retaining original keys as well for compatibility

version bump to 2.0.0

updated CHANGES and cython_help.md for a note about the
`c_ascii_structure` argument

Consistent free of `c_ascii_structure` in thermoanalysis.pyx methods

* fixes missing `thal_result.sec_struct` and `dpal_results.sec_struct` (libnano#112)

initialization to `NULL` in `recalc_primer_sec_struct` in `libprimer3.c`
and `libprimer3flex.c`.  `CHANGES` updated

* doc string update for _ThermoAnalysis.run_design for new list based keys
  • Loading branch information
grinner authored May 31, 2023
1 parent 9cb701b commit 83018cd
Show file tree
Hide file tree
Showing 14 changed files with 1,054 additions and 714 deletions.
12 changes: 12 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Changelog

## Version 2.0.0 (May 30, 2023)

- Migrated primer3 header file Cython extern imports to `thermoanalysis.pxi`
- Optional C structure string argument `c_ascii_structure` added to `_ThermoAnalysis` methods to enable 3rd party use for structures
- Version bump to 2.0.0 due to breaking change
- Fix issue whereby no_structure is not correctly 1 set to 1 when no secondary structure in found
- Add list version of `PRIMER_{PAIR, LEFT, RIGHT, INTERNAL}` to design output dictionary keys.Retaining original keys as well for compatibility.
- Fix for missing `thal_result.sec_struct` and `dpal_results.sec_struct` initialization to `NULL` in `recalc_primer_sec_struct`

## Version 1.2.2 (May 16, 2023)

- Bug fixes for output formatting related to penalty, "problem", and mispriming fields

## Version 1.2.1 (April 28, 2023)

- Bug fixes for `pdh_create_seq_lib` to correct missing `seq_lib` datastructure allocation and variable name typos.
- Increase test coverage to include `misprime_lib` and `mishyb_lib` arguments

Expand All @@ -18,6 +29,7 @@
- `setup.py` `package_data` and `MANIFEST.in` to assist with future builds from `tar.gz` (`conda`)

## Version 1.1.0 (March 1, 2023)

- Added specificity to error non-N IUPAC error for issue #59
- Wheel build support for python 3.8 to move towards following the CPython EOL model for issue #88. See https://devguide.python.org/versions/

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include README.md LICENSE CHANGES AUTHORS setup.py
include .pre-commit-config.yaml dev-requirements.txt setup.cfg
include primer3/*.pxd primer3/*.pyx primer3/*.h
include primer3/*.pxd primer3/*.pxi primer3/*.pyx primer3/*.h
include primer3/src/libprimer3/*.h primer3/src/libprimer3/*.c
include primer3/src/libprimer3/klib/khash.h
include primer3/src/libprimer3/klib/README.md
Expand Down
6 changes: 5 additions & 1 deletion docs/cython_help.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ and to build/install using a standard `setup.py` add the lines (fill in the ...s
...)
```

and it should work
and it should work.

## Notes
- Many `_ThermoAnalysis` methods (e.g. `calc_heterodimer_c`) have C string argument
`c_ascii_structure` to enable 3rd party use for structures reuse
2 changes: 1 addition & 1 deletion primer3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from typing import List

# Per PEP-440 https://peps.python.org/pep-0440/#public-version-identifiers
__version__ = '1.2.2'
__version__ = '2.0.0'
__author__ = 'Ben Pruitt, Nick Conway'
__copyright__ = (
'Copyright 2014-2023, Ben Pruitt & Nick Conway; 2014-2018 Wyss Institute'
Expand Down
1 change: 1 addition & 0 deletions primer3/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ def design_primers(
mishyb_lib: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
'''Run the Primer3 design process.
This is a wrapper around :meth:`_ThermoAnalysis.run_design`.
Args:
seq_args: Primer3 sequence/design args as per Primer3 docs
Expand Down
12 changes: 10 additions & 2 deletions primer3/src/libprimer3/libprimer3.c
Original file line number Diff line number Diff line change
Expand Up @@ -5283,8 +5283,7 @@ recalc_secundary_structures(
num_print = retval->best_pairs.num_pairs;
for (int i = 0 ; i < num_print ; i++) {
recalc_primer_sec_struct(
retval->best_pairs.pairs[i].
left,
retval->best_pairs.pairs[i].left,
0,
pa,
sa,
Expand Down Expand Up @@ -5381,6 +5380,10 @@ recalc_primer_sec_struct(

if (pa->thermodynamic_oligo_alignment==0) {
dpal_results any, end;
/* NOTE: important to set these values to NULL to prevent segfaults */
any.sec_struct = NULL;
end.sec_struct = NULL;

if (p_rec->self_any > 0.0) {
dpal((const unsigned char *) s1, (const unsigned char *) s1_rev,
dpal_arg_to_use->local, DPM_STRUCT, &any);
Expand All @@ -5397,6 +5400,11 @@ recalc_primer_sec_struct(
/* Thermodynamic approach, fwd-primer */
if (pa->thermodynamic_oligo_alignment==1) {
thal_results any, end, hair;
/* NOTE: important to set these values to NULL to prevent segfaults */
any.sec_struct = NULL;
end.sec_struct = NULL;
hair.sec_struct = NULL;

if (p_rec->self_any > 0.0 ) {
thal(
(const unsigned char *) s1,
Expand Down
14 changes: 10 additions & 4 deletions primer3/src/libprimer3/libprimer3flex.c
Original file line number Diff line number Diff line change
Expand Up @@ -6182,8 +6182,7 @@ recalc_secundary_structures(
num_print = retval->best_pairs.num_pairs;
for (int i = 0 ; i < num_print ; i++) {
recalc_primer_sec_struct(
retval->best_pairs.pairs[i].
left,
retval->best_pairs.pairs[i].left,
0,
pa,
sa,
Expand Down Expand Up @@ -6232,7 +6231,7 @@ recalc_primer_sec_struct(
char s1[THAL_MAX_ALIGN+1], s1_rev[THAL_MAX_ALIGN+1];
int overhang_len;
/* s1 is the forward oligo. */
if (primer_type == 0) { /*left */
if (primer_type == 0) { /* left */
if (NULL != sa->overhang_left) {
overhang_len = strlen(sa->overhang_left);
strcpy(s1, sa->overhang_left);
Expand Down Expand Up @@ -6287,9 +6286,11 @@ recalc_primer_sec_struct(
}
p3_reverse_complement(s1_rev, s1);
}

if (pa->thermodynamic_oligo_alignment==0) {
dpal_results any, end;
/* NOTE: important to set these values to NULL to prevent segfaults */
any.sec_struct = NULL;
end.sec_struct = NULL;
if (p_rec->self_any > 0.0) {
dpal(
(const unsigned char*) s1,
Expand Down Expand Up @@ -6322,6 +6323,11 @@ recalc_primer_sec_struct(
/* Thermodynamic approach, fwd-primer */
if (pa->thermodynamic_oligo_alignment==1) {
thal_results any, end, hair;
/* NOTE: important to set these values to NULL to prevent segfaults */
any.sec_struct = NULL;
end.sec_struct = NULL;
hair.sec_struct = NULL;

if (p_rec->self_any > 0.0 ) {
thal(
(const unsigned char*) s1,
Expand Down
3 changes: 2 additions & 1 deletion primer3/src/libprimer3/thal.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ thal(const unsigned char *oligo_f,
const thal_args *a,
const thal_mode mode,
thal_results *o,
const int print_output) /* primer3-py modification argumen */
const int print_output) /* primer3-py modification argument */
{
double* SH;
int i, j;
Expand Down Expand Up @@ -680,6 +680,7 @@ thal(const unsigned char *oligo_f,
if (print_output == 1) { /* primer3-py update to supress undesired printing */
fputs("No secondary structure could be calculated\n", stderr);
}
o->no_structure = 1;
}

if(o->temp == -_INFINITY && (!strcmp(o->msg, ""))) { o->temp=0.0; }
Expand Down
1 change: 1 addition & 0 deletions primer3/src/libprimer3/thalflex.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ thal(
if (print_output == 1) { /* primer3-py update to supress undesired printing */
fputs("No secondary structure could be calculated\n", stderr);
}
o->no_structure = 1;
}

if(o->temp == -_INFINITY && (!strcmp(o->msg, ""))) { o->temp=0.0; }
Expand Down
Loading

0 comments on commit 83018cd

Please sign in to comment.