Skip to content

Commit

Permalink
Fixed compl_end calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
untergasser committed Aug 16, 2019
1 parent 29aa241 commit d56898f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 29 deletions.
38 changes: 21 additions & 17 deletions src/libprimer3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@ characterize_pair(p3retval *retval,
int update_stats) {
char s1[MAX_PRIMER_LENGTH+1], s2[MAX_PRIMER_LENGTH+1],
s1_rev[MAX_PRIMER_LENGTH+1], s2_rev[MAX_PRIMER_LENGTH+1];
double compl_end;
double compl_end, compl_end2;
pair_stats *pair_expl = &retval->best_pairs.expl;
int must_use = 0;
double min_oligo_tm;
Expand Down Expand Up @@ -4294,16 +4294,21 @@ characterize_pair(p3retval *retval,
if (!must_use) return PAIR_FAILED;
}
/* thermodynamic approach */
if (pa->thermodynamic_oligo_alignment==1 &&
((compl_end = align_thermod(s2, s1_rev, thal_arg_to_use->end1)) > ppair->compl_end ||
(compl_end = align_thermod(s2, s1_rev, thal_arg_to_use->end2)) > ppair->compl_end)) {
if (compl_end > pa->p_args.max_self_end_th) {
if (pa->thermodynamic_oligo_alignment==1) {
compl_end = align_thermod(s2, s1_rev, thal_arg_to_use->end1);
compl_end2 = align_thermod(s2, s1_rev, thal_arg_to_use->end2);
if (compl_end2 > compl_end) {
compl_end = compl_end2;
}
if (compl_end > ppair->compl_end) {
if (compl_end > pa->p_args.max_self_end_th) {
if (update_stats) {
pair_expl->compl_end++;
}
if (!must_use) return PAIR_FAILED;
}
ppair->compl_end = compl_end; /* Is this correct? even if end1 is bigger we write end2?? */
}
ppair->compl_end = compl_end;
}
}

/* ============================================================= */
Expand Down Expand Up @@ -4879,16 +4884,15 @@ recalc_pair_sec_struct(primer_pair *ppair,
free(end3.sec_struct);
end3.sec_struct = NULL;
}
/* most likely wrong - should not be within this else */
thal((const unsigned char *) s2, (const unsigned char *) s1_rev, thal_arg_to_use->end2, THL_STRUCT, &end4); /* Triinu Please check */
if (ppair->compl_end < end4.temp) {
ppair->compl_end = end4.temp;
save_overwrite_sec_struct(&ppair->compl_end_struct, end4.sec_struct);
} else {
if (end4.sec_struct != NULL) {
free(end4.sec_struct);
end4.sec_struct = NULL;
}
}
thal((const unsigned char *) s2, (const unsigned char *) s1_rev, thal_arg_to_use->end2, THL_STRUCT, &end4); /* Triinu Please check */
if (ppair->compl_end < end4.temp) {
ppair->compl_end = end4.temp;
save_overwrite_sec_struct(&ppair->compl_end_struct, end4.sec_struct);
} else {
if (end4.sec_struct != NULL) {
free(end4.sec_struct);
end4.sec_struct = NULL;
}
}
}
Expand Down
22 changes: 16 additions & 6 deletions src/primer3_manual.htm
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,24 @@ <h2><a id="citationRequest">3. CITING PRIMER3</a></h2>
* Untergasser A, Cutcutache I, Koressaar T, Ye J, Faircloth BC, Remm M and Rozen SG.<br>
Primer3--new capabilities and interfaces.<br>
Nucleic Acids Res. 2012 Aug 1;40(15):e115.<br>
<br>
The paper is available at
<a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3424584/">http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3424584/</a><br>
<br>
and <br>
<br>
* Koressaar T and Remm M.<br>
Enhancements and modifications of primer design program Primer3.<br>
Bioinformatics 2007;23(10):1289-91.<br>
<br>
The papers is available at<br>
Bioinformatics 2007;23(10):1289-1291.<br>
The paper is available at
<a href="https://www.ncbi.nlm.nih.gov/pubmed/17379693">https://www.ncbi.nlm.nih.gov/pubmed/17379693</a><br>
<br>
If you use masker function, please cite:<br>
* Koressaar T, Lepamets M, Kaplinski L, Raime K, Andreson R and Remm M.<br>
Primer3_masker: integrating masking of template sequence with primer design software.<br>
Bioinformatics 2018;34(11):1937-1938.<br>
The paper is available at
<a href="https://www.ncbi.nlm.nih.gov/pubmed/29360956">https://www.ncbi.nlm.nih.gov/pubmed/29360956</a><br>
<br>
Source code available at <a href="https://github.com/primer3-org/primer3">https://github.com/primer3-org/primer3</a>.</p>
<h2><a id="licenseExplain">4. FAIR USE OF PRIMER3</a></h2>
<p>
Expand Down Expand Up @@ -501,6 +506,11 @@ <h2><a id="installMac">8. INSTALLATION INSTRUCTIONS - Mac OSX</a></h2>
<br>
The first option is just a shortcut to the second.</p>
<h2><a id="installWindows">9. INSTALLATION INSTRUCTIONS - WINDOWS</a></h2>
<p>Functionality warning<br>
=====================<br>
<br>
The windows version does not support the masker functionality.
</p>
<p>How to install this software<br>
============================<br>
<br>
Expand All @@ -520,8 +530,8 @@ <h2><a id="installWindows">9. INSTALLATION INSTRUCTIONS - WINDOWS</a></h2>
Compile Primer3<br>
---------------<br>
<br>
1. Download and install MinGW64 from<br>
https://sourceforge.net/projects/mingw-w64/files/latest/download
1. Download and install TDM-GCC MinGW Compiler from<br>
https://sourceforge.net/projects/tdm-gcc/
2. Open the windows command line and change to the src folder in
Primer3<br>
3. Run: mingw32-make TESTOPTS=--windows<br>
Expand Down
12 changes: 6 additions & 6 deletions test/primer1_th_output
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ PRIMER_RIGHT_1_HAIRPIN_TH=0.00
PRIMER_LEFT_1_END_STABILITY=3.5100
PRIMER_RIGHT_1_END_STABILITY=3.7200
PRIMER_PAIR_1_COMPL_ANY_TH=38.19
PRIMER_PAIR_1_COMPL_END_TH=35.05
PRIMER_PAIR_1_COMPL_END_TH=39.91
PRIMER_PAIR_1_PRODUCT_SIZE=100
PRIMER_PAIR_2_PENALTY=1.129499
PRIMER_LEFT_2_PENALTY=0.024450
Expand Down Expand Up @@ -659,7 +659,7 @@ PRIMER_RIGHT_0_HAIRPIN_TH=0.00
PRIMER_LEFT_0_END_STABILITY=3.0200
PRIMER_RIGHT_0_END_STABILITY=4.0000
PRIMER_PAIR_0_COMPL_ANY_TH=10.52
PRIMER_PAIR_0_COMPL_END_TH=9.69
PRIMER_PAIR_0_COMPL_END_TH=10.76
PRIMER_PAIR_0_PRODUCT_SIZE=159
PRIMER_PAIR_1_PENALTY=0.227271
PRIMER_LEFT_1_PENALTY=0.179947
Expand Down Expand Up @@ -785,7 +785,7 @@ PRIMER_RIGHT_0_HAIRPIN_TH=32.27
PRIMER_LEFT_0_END_STABILITY=3.3200
PRIMER_RIGHT_0_END_STABILITY=3.3200
PRIMER_PAIR_0_COMPL_ANY_TH=17.42
PRIMER_PAIR_0_COMPL_END_TH=6.65
PRIMER_PAIR_0_COMPL_END_TH=10.45
PRIMER_PAIR_0_PRODUCT_SIZE=109
PRIMER_PAIR_1_PENALTY=0.200309
PRIMER_LEFT_1_PENALTY=0.099786
Expand All @@ -807,7 +807,7 @@ PRIMER_RIGHT_1_HAIRPIN_TH=32.27
PRIMER_LEFT_1_END_STABILITY=5.5400
PRIMER_RIGHT_1_END_STABILITY=3.3200
PRIMER_PAIR_1_COMPL_ANY_TH=21.31
PRIMER_PAIR_1_COMPL_END_TH=18.43
PRIMER_PAIR_1_COMPL_END_TH=21.14
PRIMER_PAIR_1_PRODUCT_SIZE=180
PRIMER_PAIR_2_PENALTY=0.200309
PRIMER_LEFT_2_PENALTY=0.099786
Expand All @@ -829,7 +829,7 @@ PRIMER_RIGHT_2_HAIRPIN_TH=32.27
PRIMER_LEFT_2_END_STABILITY=3.9300
PRIMER_RIGHT_2_END_STABILITY=3.3200
PRIMER_PAIR_2_COMPL_ANY_TH=20.46
PRIMER_PAIR_2_COMPL_END_TH=19.79
PRIMER_PAIR_2_COMPL_END_TH=22.80
PRIMER_PAIR_2_PRODUCT_SIZE=182
PRIMER_PAIR_3_PENALTY=0.295718
PRIMER_LEFT_3_PENALTY=0.252674
Expand Down Expand Up @@ -941,7 +941,7 @@ PRIMER_RIGHT_1_HAIRPIN_TH=0.00
PRIMER_LEFT_1_END_STABILITY=3.5100
PRIMER_RIGHT_1_END_STABILITY=3.7200
PRIMER_PAIR_1_COMPL_ANY_TH=38.19
PRIMER_PAIR_1_COMPL_END_TH=35.05
PRIMER_PAIR_1_COMPL_END_TH=39.91
PRIMER_PAIR_1_PRODUCT_SIZE=100
PRIMER_PAIR_2_PENALTY=1.129499
PRIMER_LEFT_2_PENALTY=0.024450
Expand Down

0 comments on commit d56898f

Please sign in to comment.