Code Monkey home page Code Monkey logo

primer3's Introduction

Design PCR primers from DNA sequence. Widely used (190k Google hits for "primer3"). From mispriming libraries to sequence quality data to the generation of internal oligos, primer3 does it. C&perl.

Installing

sudo apt-get install -y build-essential g++ cmake git-all

git clone https://github.com/primer3-org/primer3.git primer3

cd primer3/src

make

make test

Run Primer3

./primer3_core ../example

Read the complete Primer3 manual

Primer3 Manual

or see /src/primer3_manual.htm

primer3's People

Contributors

bioinfo-ut avatar brantfaircloth avatar nh13 avatar steverozen avatar triinukoressaar avatar untergasser avatar wholtz avatar zamaudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

primer3's Issues

Use continuous integration to test-compile this project

Noticed a couple of compile warnings that end up being errors in later versions of GCC. Considering how many people use this project for detecting primers, it makes sense to compile-test this project upon every push to the repo surely?

Batching multiple sequences in ntthal

I was wondering the appetite for a PR where we could batch many sequences to run ntthal. I want to perform 100K+ invocations of ntthal, and I'd rather just send ntthal a stream of data and have one ntthal process handle all the requests. I am only modifying the sequences I pass in (-s1 and -s2) so I see a few options:

  1. If -s1 and -s2 are not defined, then ntthal reads in from standard input.
  2. A new argument (-f?) that specifies a file with input sequences to process.

Thanks for considering this idea!

Primer3 issue with the Sequence_ID

Hi everyone,

I am trying to sign primers for my sequences but I have an error that I do not understand the problem.

I made my finputfile.txt and I made the command below:

aka@aka:~/Desk/Primer$ /home/aka/primer3/src/primer3_core < input.txt > result.txt

input.txt

PRIMER_TASK=generic
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_INTERNAL_OLIGO=0
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_OPT_SIZE=20
PRIMER_MIN_SIZE=18
PRIMER_MAX_SIZE=23
PRIMER_MAX_NS_ACCEPTED=1
PRIMER_PRODUCT_SIZE_RANGE=100-150
P3_FILE_FLAG=1
PRIMER_EXPLAIN_FLAG=1
PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/home/coralie/primer3/src/primer3_config/
=
SEQUENCE_ID=Qrob_P0702440.2
SEQUENCE_TEMPLATE=ATGCCTCCATCCTTCATCCACCGCCTACTCATCTCT....AATTGAGGAAGAGGGATTGTTCAATGAGTGGGAAGATTGCAAGACTTTGTTGA
=

It comes out: a results.txt file below, I feel like it's working but I have an error that shows up.

result.txt

    PRIMER_TASK=generic
    PRIMER_PICK_LEFT_PRIMER=1
    PRIMER_PICK_INTERNAL_OLIGO=0
    PRIMER_PICK_RIGHT_PRIMER=1
    PRIMER_OPT_SIZE=20
    PRIMER_MIN_SIZE=18
    PRIMER_MAX_SIZE=23
    PRIMER_MAX_NS_ACCEPTED=1
    PRIMER_PRODUCT_SIZE_RANGE=100-150
    P3_FILE_FLAG=1
    PRIMER_EXPLAIN_FLAG=1
    PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/home/coralie/primer3/src/primer3_config/
    PRIMER_ERROR=Need PRIMER_SEQUENCE_ID if PRIMER_FILE_FLAG is not 0
    =

When I change the SEQUENCE_ID to PRIMER_SEQUENCE_ID it doesn't work at all and shows me this:

PRIMER_TASK=generic
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_INTERNAL_OLIGO=0
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_OPT_SIZE=20
PRIMER_MIN_SIZE=18
PRIMER_MAX_SIZE=23
PRIMER_MAX_NS_ACCEPTED=1
PRIMER_PRODUCT_SIZE_RANGE=100-150
P3_FILE_FLAG=1
PRIMER_EXPLAIN_FLAG=1
PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/home/coralie/primer3/src/primer3_config/
PRIMER_ERROR=Need PRIMER_SEQUENCE_ID if PRIMER_FILE_FLAG is not 0
=
PRIMER_SEQUENCE_ID=Qrob_P0702440.2
SEQUENCE_TEMPLATE=ATGCCTCCATCCTTCATCCACCGCCTACTCATCTCT....AATTGAGGAAGAGGGATTGTTCAATGAGTGGGAAGATTGCAAGACTTTGTTGA
PRIMER_ERROR=Need PRIMER_SEQUENCE_ID if PRIMER_FILE_FLAG is not 0
=
PRIMER_SEQUENCE_ID=test2
SEQUENCE_TEMPLATE=GTAGTCAGTAGACNATGACNACTGACGATGCAGACNACACACACACACACAGCACACAGGTATTAGTGGGCCATTCGATCCCGACCCAAATCGATAGCTACGATGACG
PRIMER_ERROR=Need PRIMER_SEQUENCE_ID if PRIMER_FILE_FLAG is not 0
=
PRIMER_SEQUENCE_ID=test3
SEQUENCE_TEMPLATE=GTAGTCAGTAGACNATGACNACTGACGATGCAGACNACACACACACACACAGCACACAGGTATTAGTGGGCCATTCGATCCCGACCCAAATCGATAGCTACGATGACG
PRIMER_ERROR=Need PRIMER_SEQUENCE_ID if PRIMER_FILE_FLAG is not 0
=

Do you know where this error comes from? Are my primers good in the first case with the error?

Thank you in advance for your help

Have a nice day

Kisekya

ntthal alignment not complete. Incomplete thermodynamic calculation?

ntthal alignment does not show all matching bases as paired. I am unsure if the thermodynamic calculation considers the matched bases or not either.

After pulling master, make clean and make, I see this behavior

./ntthal -s1 GCTCGCGTCGCCTGCTGCTTTTGGCAGGGTAAAAGA -s2 GCTCGCGTCGCCTGCTGCTTTTGGCAGGGTAAAAGA
Calculated thermodynamical parameters for dimer:        dS = -297.472   dH = -99200     dG = -6939.1    t = 24.1818
SEQ     GCTCGCGTCG     TGCTTTTG     GTAAAAGA--
SEQ               CCTGC        GCAGG
STR               GGACG        CGTCC
STR       AGAAAATG     GTTTTCGT     GCTGCGCTCG

The last two 3 bases (for example) on both strands are complementary but not displayed as matches. There's another T/A match 6 back from the 3 end that is also not shown as a match. I see this behavior more often than not (I.E. most heterodimers I look at have this happening).

Does this visualization reflect the thermodynamic calculations? If so, are those matches intentionally excluded? If so, why?

Thanks for reading

(edited get formatting correct)

primer3_core reporting Empty sequence in mispriming library from file that has 0 blank lines

Hi all,
I am currently trying to run primer3 on a mispriming library file I created using all the tandem repeat sequences in the human genome.
The file size is 143M, not sure if this has anything to do with it, but when I try to invoke primer3 I get the following error:

primer3_core: Empty sequence in mispriming library /home/dkennetz/tests/Humrep.txt

When I check the file for empty or blank lines:

grep -cvP '\S' Humrep.txt

It returns 0. Furthermore, I have removed any windows characters such as ^M from lines.

Any help is appreciated.

Install Primer3 on Windows

Hi,

I have some trouble installing Primer3 version 2.4.0 on an Windows 10 system. I downloaded the ZIP file and extracted it. After that I changed folder to "test" and I run the command mingw32-make TESTOPTS=--windows
Then I got the following error message:

cd ..\src & mingw32-make
mingw32-make[1]: Entering directory 'C:/Users/die9s/Desktop/primer3-2.4.0/src'
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  primer3_boulder_main.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o format_output.o format_output.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o read_boulder.o read_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o print_boulder.o print_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  masker.c
masker.c:8:22: fatal error: sys/mman.h: No such file or directory
compilation terminated.
Makefile:226: recipe for target 'masker.o' failed
mingw32-make[1]: *** [masker.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/die9s/Desktop/primer3-2.4.0/src'
Makefile:94: recipe for target 'makeexes' failed
mingw32-make: *** [makeexes] Error 2

Do you have any idea solving this problem?
Thanks in advance
Stefan

Problem with Primer3 installation - bin folder not present

Hi, I am having trouble with the Primer3 installation instructions and am unable to get past instruction 2 from the Primer3 Release 2.3.7 Manual (http://primer3.sourceforge.net/primer3_manual.htm#installMac) for installation on Mac OSX. The manual gives the following instructions:

  1. The binary files are located in the 'bin' [for 'binary'] folder

But there is no folder in the 2.3.7 download (from here http://primer3.sourceforge.net/releases.php) called "bin" and I am therefore unable to get past this point. I also tried downloading a different version of Primer3 directly from SourceForge (https://sourceforge.net/projects/primer3/) but have come up against the same problem.

I wondered if anyone else has encountered this problem, or if the instructions have not been updated for the current release? Any help that you could give me regarding this would be really appreciated!

number of warnings building with clang on macOS

There a several warnings building with clang on macOS that

g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  primer3_boulder_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o format_output.o format_output.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
format_output.c:418:48: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
            if (pa->pick_right_primer && &retval->rev != NULL 
                                          ~~~~~~~~^~~    ~~~~
format_output.c:429:47: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
            if (pa->pick_left_primer && &retval->fwd != NULL 
                                         ~~~~~~~~^~~    ~~~~
format_output.c:851:45: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_left_primer) && (&retval->fwd != NULL )
                                    ~~~~~~~~^~~    ~~~~
format_output.c:858:48: warning: comparison of address of 'retval->intl' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_internal_oligo) && (&retval->intl != NULL )
                                       ~~~~~~~~^~~~    ~~~~
format_output.c:865:46: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_right_primer) && (&retval->rev != NULL )
                                     ~~~~~~~~^~~    ~~~~
format_output.c:888:43: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_left_primer) && (&retval->fwd != NULL )
                                  ~~~~~~~~^~~    ~~~~
format_output.c:907:46: warning: comparison of address of 'retval->intl' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_internal_oligo) && (&retval->intl != NULL )
                                     ~~~~~~~~^~~~    ~~~~
format_output.c:926:44: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_right_primer) && (&retval->rev != NULL )
                                   ~~~~~~~~^~~    ~~~~
8 warnings generated.
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o read_boulder.o read_boulder.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o print_boulder.o print_boulder.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  masker.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -Wno-deprecated  -o libprimer3.o libprimer3.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o p3_seq_lib.o p3_seq_lib.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
ar rv libprimer3.a libprimer3.o p3_seq_lib.o
ar: creating archive libprimer3.a
a - libprimer3.o
a - p3_seq_lib.o
ranlib libprimer3.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o dpal_primer.o dpal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
ar rv libdpal.a dpal_primer.o
ar: creating archive libdpal.a
a - dpal_primer.o
ranlib libdpal.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -ffloat-store  -o thal_primer.o thal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument]
ar rv libthal.a thal_primer.o
ar: creating archive libthal.a
a - thal_primer.o
ranlib libthal.a
gcc -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2   -c -o oligotm.o oligotm.c
ar rv liboligotm.a oligotm.o
ar: creating archive liboligotm.a
a - oligotm.o
ranlib liboligotm.a
ar rv libmasker.a masker.o
ar: creating archive libmasker.a
a - masker.o
ranlib libmasker.a
g++ -g -o primer3_core primer3_boulder_main.o format_output.o read_boulder.o print_boulder.o masker.o libprimer3.a libdpal.a libthal.a liboligotm.a libmasker.a  -lm
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -o ntdpal_main.o ntdpal_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o dpal.o dpal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -o ntdpal ntdpal_main.o dpal.o
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o thal_main.o thal_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -ffloat-store -o thal.o thal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument]
g++ -g -o ntthal thal_main.o thal.o -lm
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o oligotm oligotm_main.c liboligotm.a  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o long_seq_tm_test long_seq_tm_test_main.c oligotm.o  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o primer3_masker masker_main.c libprimer3.a libdpal.a libthal.a liboligotm.a libmasker.a  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]

critical memory error with humrep_and_simple.txt as mispriming library

This quite an odd one I don't know what to make of it.

If I try to design primers using the following primer3 input:
primer3_input.target_56.txt

I get a reproducible critical memory error:

*** Error in `primer3_core': double free or corruption (!prev): 0x00005561456236d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x81299)[0x2b87b0aec299]
primer3_core(+0x12a98)[0x556142d4aa98]
primer3_core(+0x12b21)[0x556142d4ab21]
primer3_core(+0x2ac4)[0x556142d3aac4]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x2b87b0a8d555]
...

If I remove the mispriming library, things run fine.
If I remove all sequences beyond LTR4 (i.e. that's the last one), then it runs fine.
If I include LTR5 (the following one), I get the memory error.
If I remove only LTR5 (the one after LTR4), I get a memory error.

The memory error happens AFTER it spits out all the primer pairs.

I did a clean download of the file from https://github.com/primer3-org/primer3/blob/main/src/humrep_and_simple.txt

I am running the latest primer3:

USAGE: primer3_core [--format_output] [--default_version=1|--default_version=2] [--io_version=4] [--p3_settings_file=<file_path>] [--echo_settings_file] [--strict_tags] [--output=<file_path>] [--error=<file_path>] [input_file]
This is primer3 (libprimer3 release 2.5.0)

I still think I must be doing something odd, but at this point I'm a bit at a loss.

Scoring pre-selected primers?

Hello! I was wondering if there was a way to use the primer3 command line tool/api to directly retrieve a score for a set of primers. Assuming the forward and reverse primers are known, but the input sequence itself is not.

Thank you in advance!

Patch for building 2.4.0 on mac os x

The error I was getting is as follows:

g++ -c -g -Wall -O2 -std=c++11  -o libprimer3.o libprimer3.cc
libprimer3.cc:52:19: error: expected namespace name
  using namespace __gnu_cxx;
                  ^
1 error generated.
make: *** [libprimer3.o] Error 1

The patch is as follows:

diff --git a/src/libprimer3.cc b/src/libprimer3.cc
index c1b558c..1e4715c 100644
--- a/src/libprimer3.cc
+++ b/src/libprimer3.cc
@@ -47,10 +47,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <ctype.h> /* toupper */
 #include <unordered_map>
 +#ifdef __GLIBCXX__
 namespace std
 {
   using namespace __gnu_cxx;
 }
+#endif
  #include "libprimer3.h"

Feature request: Multiple structures from thal

I'm using bindings to the primer3 C code and I would like to get multiple structures (in decreasing dG from most stable to some cut off) from thal. I'm curious how difficult this would be, where to look in the current code, and if this is an idea you all have considered and have ideas about. Thanks!

Return all primers for pick_sequencing_primers task

  • I noticed that only one primer would be returned if the task is pick_sequencing_primers, instead of a list of primer candidates, even if I ask primer3 to return multiple primers using PRIMER_NUM_RETURN.

  • I checked the source code and the it appears that the one primer return behavior is enforced by using pick_only_best_primer function (which is only used when pick sequencing primers ) .

    pick_only_best_primer(start, length, &retval->rev,

  • My question: Is there any specific reason to return only the "best primer" for pick_sequencing_primers task, and is it possible to update primer3 so that returning multiple primer candidates is an option (e.p. using pick_primer_range function)?

Thanks!

Question on calcHairpin dg discrepancy

I'm observing a discrepancy in the dg given by calcHairpin for 'TTAACCTCAGATCCTAAGCCGCACAAAGTTGCGGCTTAGGATCTGA', a sequence from a paper I am reading.

image

  • In blue is primer3's hairpin dg on y and primer3's hairpin Tm on x for four sequences including that above, which is the last datapoint.
  • In orange is another software package's hairpin dg on y.
  • The slight offset is due to minor differences in parameterization.
  • Three of the sequences give concordant dgs for the two softwares

I expect the dgs to correlate with each other and to the hairpin Tm. Any idea why I see an aberration for this particular sequence?

Thank you for your time.

Getting different output from primer3plus and primer3 when using default setting

Hi,
We are trying to get the same primer output from primer3_core using as what we got on primer3plus. However, I tried to apply the same setting as we used on primer3plus and got different results. I tried default setting on both as well but still got different output.
Since the newest version of primer3 manual is 2.4.0, is there any difference between default parameter settings in the current version of primer3plus and primer3?
[I found that the primer3_core output is more restrict on optimal primer size btw]
Thanks a lot!

PRIMER_THERMODYNAMIC_PARAMETERS_PATH does not resolve correctly without trailing slash

Setting PRIMER_THERMODYNAMIC_PARAMETERS_PATH fails with a file not found error when the path specified does not contain a trailing slash.

E.g. an input file ending in

PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/opt/primer3_config
=

Will faill, with Unable to open file /opt/primer3_configstack.ds.

On Linux, paths ending without a trailing slash are valid directory paths.

primer3 2.3.7 hangs but not 2.4.0

Input:

SEQUENCE_PRIMER_REVCOMP=CTCTACCTATAAATCTTCCCACTA
SEQUENCE_PRIMER=GGAAAGATGAAAAATTATAACCAAGCATAATAT
PRIMER_EXPLAIN_FLAG=1
PRIMER_FIRST_BASE_INDEX=1
PRIMER_PICK_INTERNAL_OLIGO=0
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_MIN_SIZE=18
PRIMER_MAX_SIZE=34
PRIMER_MIN_TM=54.0
PRIMER_TASK=check_primers
PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/path/to/primer3-2.3.7/src/primer3_config/
=

Running primer3_core < in hangs in v2.3.7 but not 2.4.0. Since 2.4.0 is a release, I have also submitted a PR to primer3's bioconda recipe: bioconda/bioconda-recipes#10122

gcc 7.2.1: compile error

$ make
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  primer3_boulder_main.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o format_output.o format_output.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o read_boulder.o read_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o print_boulder.o print_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  masker.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -Wno-deprecated  -o libprimer3.o libprimer3.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o p3_seq_lib.o p3_seq_lib.c
ar rv libprimer3.a libprimer3.o p3_seq_lib.o
ar: creating libprimer3.a
a - libprimer3.o
a - p3_seq_lib.o
ranlib libprimer3.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o dpal_primer.o dpal.c
dpal.c: In function ‘void print_align(const unsigned char*, const unsigned char*, int (*)[1600][3], int, int, const dpal_args*)’:
dpal.c:1036:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(i=j;i<j+70;i++) fprintf(stderr, "%c",sy[i]); fprintf(stderr,"\n");
     ^~~
dpal.c:1036:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     for(i=j;i<j+70;i++) fprintf(stderr, "%c",sy[i]); fprintf(stderr,"\n");
                                                      ^~~~~~~
ar rv libdpal.a dpal_primer.o
ar: creating libdpal.a
a - dpal_primer.o
ranlib libdpal.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -ffloat-store  -o thal_primer.o thal.c
thal.c: In function ‘void thal(const unsigned char*, const unsigned char*, const thal_args*, thal_results*)’:
thal.c:429:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if ('\0' == oligo_f) {
                ^~~~~~~
thal.c:434:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if ('\0' == oligo_r) {
                ^~~~~~~
thal.c: In function ‘void tableStartATS(double, double (*)[5])’:
thal.c:1200:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    for (i = 0; i < 5; ++i)
    ^~~
thal.c:1203:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
      atpS[0][3] = atpS[3][0] = atp_value;
      ^~~~
thal.c: In function ‘void tableStartATH(double, double (*)[5])’:
thal.c:1212:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    for (i = 0; i < 5; ++i)
    ^~~
thal.c:1216:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
      atpH[0][3] = atpH[3][0] = atp_value;
      ^~~~
make: *** [Makefile:207: thal_primer.o] Error 1

$ g++ --version
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$

Nested structure for primer results

Consider this example adapted from the one of your test cases:

>>> sequence_template = 'GCTTGCATGCCTGCAGGTCGACTCTAGAGGATCCCCCTACATTTTAGCATCAGTGAGTACAGCATGCTTACTGGAAGAGAGGGTCATGCAACAGATTAGGAGGTAAGTTTGCAAAGGCAGGCTAAGGAGGAGACGCACTGAATGCCATGGTAAGAACTCTGGACATAAAAATATTGGAAGTTGTTGAGCAAGTNAAAAAAATGTTTGGAAGTGTTACTTTAGCAATGGCAAGAATGATAGTATGGAATAGATTGGCAGAATGAAGGCAAAATGATTAGACATATTGCATTAAGGTAAAAAATGATAACTGAAGAATTATGTGCCACACTTATTAATAAGAAAGAATATGTGAACCTTGCAGATGTTTCCCTCTAGTAG'
>>> seq_args = { 'SEQUENCE_ID': 'MH1000','SEQUENCE_TEMPLATE': sequence_template,}
>>> global_args = {
            'PRIMER_OPT_SIZE': 20,
            'PRIMER_PICK_INTERNAL_OLIGO': 1,
            'PRIMER_INTERNAL_MAX_SELF_END': 8,
            'PRIMER_MIN_SIZE': 18,
            'PRIMER_MAX_SIZE': 25,
            'PRIMER_OPT_TM': 60.0,
            'PRIMER_MIN_TM': 57.0,
            'PRIMER_MAX_TM': 63.0,
            'PRIMER_MIN_GC': 20.0,
            'PRIMER_MAX_GC': 80.0,
            'PRIMER_MAX_POLY_X': 100,
            'PRIMER_INTERNAL_MAX_POLY_X': 100,
            'PRIMER_SALT_MONOVALENT': 50.0,
            'PRIMER_DNA_CONC': 50.0,
            'PRIMER_MAX_NS_ACCEPTED': 0,
            'PRIMER_MAX_SELF_ANY': 12,
            'PRIMER_MAX_SELF_END': 8,
            'PRIMER_PAIR_MAX_COMPL_ANY': 12,
            'PRIMER_PAIR_MAX_COMPL_END': 8,
            'PRIMER_PRODUCT_SIZE_RANGE': [[75,100],[100,125],[125,150],[150,175],[175,200],[200,225]],
        }
>>> binding_res = bindings.designPrimers(seq_args, global_args)
>>> type(binding_res)
<class 'dict'>
>>> print(repr(binding_res).replace(", '", ",\n'"))
{'PRIMER_LEFT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 32, low tm 1366, high tm 189, ok 673',
'PRIMER_RIGHT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 80, low tm 1484, high tm 126, high hairpin stability 5, ok 565',
'PRIMER_INTERNAL_EXPLAIN': 'considered 3367, too many Ns 27, GC content failed 92, low tm 2862, high tm 17, high hairpin stability 15, ok 354',
'PRIMER_PAIR_EXPLAIN': 'considered 671, unacceptable product size 659, no internal oligo 5, ok 7',
'PRIMER_LEFT_NUM_RETURNED': 5,
'PRIMER_RIGHT_NUM_RETURNED': 5,
'PRIMER_INTERNAL_NUM_RETURNED': 5,
'PRIMER_PAIR_NUM_RETURNED': 5,
'PRIMER_PAIR_0_PENALTY': 1.373239688566116,
'PRIMER_LEFT_0_PENALTY': 1.3299057711502655,
'PRIMER_RIGHT_0_PENALTY': 0.043333917415850465,
'PRIMER_INTERNAL_0_PENALTY': 6.224608874676505,
'PRIMER_LEFT_0_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_RIGHT_0_SEQUENCE': 'TCTCCTCCTTAGCCTGCCTT',
'PRIMER_INTERNAL_0_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_LEFT_0': (46, 21),
'PRIMER_RIGHT_0': (132, 20),
'PRIMER_INTERNAL_0': (69, 24),
'PRIMER_LEFT_0_TM': 59.670094228849734,
'PRIMER_RIGHT_0_TM': 59.95666608258415,
'PRIMER_INTERNAL_0_TM': 57.775391125323495,
'PRIMER_LEFT_0_GC_PERCENT': 52.38095238095238,
'PRIMER_RIGHT_0_GC_PERCENT': 55.0,
'PRIMER_INTERNAL_0_GC_PERCENT': 50.0,
'PRIMER_LEFT_0_SELF_ANY_TH': 10.513588697583486,
'PRIMER_RIGHT_0_SELF_ANY_TH': 0.0,
'PRIMER_INTERNAL_0_SELF_ANY_TH': 0.0,
'PRIMER_LEFT_0_SELF_END_TH': 10.513588697583486,
'PRIMER_RIGHT_0_SELF_END_TH': 0.0,
'PRIMER_INTERNAL_0_SELF_END_TH': 0.0,
'PRIMER_LEFT_0_HAIRPIN_TH': 42.52778282883122,
'PRIMER_RIGHT_0_HAIRPIN_TH': 0.0,
'PRIMER_INTERNAL_0_HAIRPIN_TH': 34.31335532251251,
'PRIMER_LEFT_0_END_STABILITY': 4.06,
'PRIMER_RIGHT_0_END_STABILITY': 4.35,
'PRIMER_PAIR_0_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_0_COMPL_END_TH': 0.0,
'PRIMER_PAIR_0_PRODUCT_SIZE': 87,
'PRIMER_PAIR_1_PENALTY': 1.5090296435631672,
'PRIMER_LEFT_1_PENALTY': 1.3299057711502655,
'PRIMER_RIGHT_1_PENALTY': 0.17912387241290162,
'PRIMER_INTERNAL_1_PENALTY': 6.224608874676505,
'PRIMER_LEFT_1_SEQUENCE': 'GCATCAGTGAGTACAGCATGC',
'PRIMER_RIGHT_1_SEQUENCE': 'CAGTGCGTCTCCTCCTTAGC',
'PRIMER_INTERNAL_1_SEQUENCE': 'ACTGGAAGAGAGGGTCATGCAACA',
'PRIMER_LEFT_1': (46, 21),
'PRIMER_RIGHT_1': (139, 20),
...
'PRIMER_PAIR_4_COMPL_ANY_TH': 0.0,
'PRIMER_PAIR_4_COMPL_END_TH': 0.0,
'PRIMER_PAIR_4_PRODUCT_SIZE': 84}

This is a single flat dictionary, but there is obvious nested structure here with the five primers sets 0 to 4, could we not have a (optional) nested dict?:

These make sense as top level entries:

'PRIMER_LEFT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 32, low tm 1366, high tm 189, ok 673',
'PRIMER_RIGHT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 80, low tm 1484, high tm 126, high hairpin stability 5, ok 565',
'PRIMER_INTERNAL_EXPLAIN': 'considered 3367, too many Ns 27, GC content failed 92, low tm 2862, high tm 17, high hairpin stability 15, ok 354',
'PRIMER_PAIR_EXPLAIN': 'considered 671, unacceptable product size 659, no internal oligo 5, ok 7',

These would be redundant under my idea:

'PRIMER_LEFT_NUM_RETURNED': 5,
'PRIMER_RIGHT_NUM_RETURNED': 5,
'PRIMER_INTERNAL_NUM_RETURNED': 5,
'PRIMER_PAIR_NUM_RETURNED': 5,

All the rest have an index and would be better a list of dicts or named tuples:

'PRIMER_PAIR': [5 entry list],
'PRIMER_LEFT': [5 entry list],.
'PRIMER_RIGHT': [5 entry list],
'PRIMER_INTERNAL': [5 entry list],

Here the PRIMER_PAIR entry could be:

[{'PENALTY': 1.373239688566116, 'COMPL_ANY_TH': 0.0, 'COMPL_END_TH': 0.0, 'PRODUCT_SIZE': 87}, ...]

And the PRIMER_LEFT entry could be:

[{PENALTY': 1.3299057711502655, 'SEQUENCE': 'GCATCAGTGAGTACAGCATGC', 'COORDS': (46, 21), 'TM': 59.670094228849734, 'GC_PERCENT': 52.38095238095238, 'SELF_ANY_TH': 10.513588697583486, 'SELF_END_TH': 10.513588697583486, 'HAIRPIN_TH': 42.52778282883122, 'END_STABILITY': 4.06}, ...]

(You'd need a key for 'PRIMER_LEFT_0': (46, 21), though - maybe COORDS?)

etc.

This could be requested by a keyword argument to preserve backward compatibility?

The oligotm tool has been outdated

The oligotm tools still uses backward compatible calculation. Given this primer pair as an example:

Template: CCTGCATAATTCATGAAAAGAGCTTGCCATCCCTCCAGGTAGATATTAATTCTCGCAATCAGTGGTTGTAGTTCAGCAAAATTCAGTTTGGAGCTGGACAACGGAAGCCCGAGACTAGAGTACACCTGGGGGAAATTTTTCTACTTTGCAGTGGAGGATTGCTGCTACTGCTAGAGCTTGAGTTTCAGCACTATCTTGTGGAAGCCTGGAGTTCCTGCTGTAGCCTGTTAGCCATTGCTTTGGCTGTGATCTTGATGGAGCAAATCTGTAGCCGGAGGGACTAGCATAATATGATGAGGATC

Primer F:  AGACTAGAGTACACCTGGGG
Primer R: GCTCCATCAAGATCACAGCC

If you use oligotm, the Tm of primer F is 53.30 (still backward compatible calculation)

However, in the output of current version primer3 the Tm of primer F is 57.17

critical memory error

Hello,
Thank you again for the prompt fix of #57. I re-ran the full suite with release 2.6.0 and we now have a much higher success rate. We still have a memory error in one case (attached). I don't know if it's related or not.
Please let me know if there's any other information I can provide.
Jocelyne

*** Error in `primer3_core': corrupted size vs. prev_size: 0x00005623d9247e20 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7f3e4)[0x2aff71f0a3e4]
/lib64/libc.so.6(+0x814db)[0x2aff71f0c4db]
primer3_core(+0x13ead)[0x5623d5b36ead]
primer3_core(+0x13f41)[0x5623d5b36f41]
primer3_core(+0x2ac4)[0x5623d5b25ac4]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x2aff71ead555]
primer3_core(+0x326d)[0x5623d5b2626d]

primer3_input.target_9.txt

problem installing on Win10

I also have problem installing it on Win 10:
make
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 primer3_boulder_main.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o format_output.o format_output.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o read_boulder.o read_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o print_boulder.o print_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 masker.c
In file included from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/i686-pc-cygwin/bits/gthr.h:148:0,
from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/ext/atomicity.h:35,
from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/bits/ios_base.h:39,
from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/ios:42,
from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/istream:38,
from /usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/fstream:38,
from masker.c:1:
/usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/i686-pc-cygwin/bits/gthr-default.h: In function ‘int __gthread_mutex_timedlock(__pthread_mutex_t**, const __gthread_time_t*)’:
/usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/i686-pc-cygwin/bits/gthr-default.h:768:12: error: ‘pthread_mutex_timedlock’ was not declared in this scope
return _gthrw(pthread_mutex_timedlock) (__mutex, __abs_timeout);
^
/usr/lib/gcc/i686-pc-cygwin/7.3.0/include/c++/i686-pc-cygwin/bits/gthr-default.h:768:12: note: suggested alternative: ‘__gthread_mutex_timedlock’
make: *** [Makefile:226: masker.o] Error 1

How to set the SEQUENCE_TARGET or SEQUENCE_EXCLUDED_REGION parameter?

I am trying to design primers for a sequence that contains a target region in 200-700 bp position. Here shows a diagram:
image

I have tried to set SEQUENCE_TARGET=200,300 or SEQUENCE_EXCLUDED_REGION=200,300 expecting PCR amplicon covers the target region. But primer3 (v2.5.0) only return primer pairs that overlap the target region.
How can I change the parameters?

Here are the parameters options:
primer3_test.txt

SEQUENCE_TARGET=200,300
PRIMER_TASK=generic
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_NUM_RETURN=5
PRIMER_MAX_NS_ACCEPTED=0
PRIMER_PRODUCT_SIZE_RANGE=500-800
PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/home/lhs/softwares/primer3-master/src/primer3_config/
PRIMER_THERMODYNAMIC_OLIGO_ALIGNMENT=1
PRIMER_THERMODYNAMIC_TEMPLATE_ALIGNMENT=1
PRIMER_MAX_SELF_ANY_TH=20.00
PRIMER_PAIR_MAX_COMPL_ANY_TH=20.00
PRIMER_MAX_SELF_END_TH=20.00
PRIMER_PAIR_MAX_COMPL_END_TH=20.00
PRIMER_MAX_HAIRPIN_TH=20.00
PRIMER_OUTSIDE_PENALTY=-1.0
PRIMER_EXPLAIN_FLAG=1
P3_FILE_FLAG=1
=
SEQUENCE_ID=test1
SEQUENCE_TEMPLATE=ACCCTATTTCCACCTATCCAAAATGGAGAAAGTTCATGTTGACTTAGACGCAGACAGCCCATTCGTCAAGTCACTGCAAAGATGCTTTCCACATTTTGAGATAGAAGCAACGCAGGTCACTGACAATGACCATGCTAATGCTAGGGCGTTTTCGCACCTAGCTACTAAGCTCATTGAGGGAGAAGTGGATACAGACCAGGTGATCCTGGATATCGGGAGCGCGCCTGTAAGGCACACGCATTCCAAACATAAGTACCACTGCATTTGCCCAATGAAGAGCGCAGAAGACCCTGACAGACTCTACCGCTACGCAGACAAGCTTAGAAAGAGTGATGTCACTGACAAATGTATTGCCTCTAAGGCCGCGGACCTGCTAACAGTAATGTCGACGCCTGACGCTGAGACACCCTCGTTATGCATGCACACTGACTCAACTTGCAGGTACCACGGCTCCGTGGCCGTATATCAGGATGTATATGCAGTGCATGCACCGACTTCCATTTACTACCAGGCGCTGAAAGGTGTACGAACTATCTATTGGATCGGGTTCGATACTACACCGTTCATGTATAAGAACATGGCAGGCGCCTACCCTACATACAACACTAATTGGGCCGATGAAAGTGTGTTGGAAGCCAGAAATATAGGGCTGGGTAGTTCAGACTTGCACGAAAAGAGTTTCGGAAAAGTATCCATTATGAGGAAGAAGAAATTACAACCCACCAATAAAGTAATATTTTCTGTGGGGTCAACTATTTATACTGAAGAGAGAATACTGTTACGCAGTTGGCATCTACCTAATGTTTTTCATCTAAAAGGTAAAACTAGCTTTACAGGCAGATGTAACACTATCGTCAGCTGCGAAGGTTACGTTGTCAAGAAGATTACGCTCAGTCCTGGGATTTACGGGAAAGTGGATAATCTTGCTTCGACCATGCACCGAGAGGGATTCTTAAGTTGCAAGGTTACAGATACGTTAAGAGGGGAGAGGGTCTCTTTT
=

The results show that primer3 failed to design primer pairs cover the target region:
primer3_test.p3.txt

PRIMER_LEFT_0=296,20
PRIMER_RIGHT_0=876,20

PRIMER_LEFT_1=292,20
PRIMER_RIGHT_1=876,20

PRIMER_LEFT_2=294,20
PRIMER_RIGHT_2=876,20

PRIMER_LEFT_3=296,20
PRIMER_RIGHT_3=874,20

PRIMER_LEFT_4=292,20
PRIMER_RIGHT_4=874,20

Any answers are appreciated.

Final record not terminated by '=' value

Hi guys,

I'm trying to run primer3 release 2.4.0 on Ubuntu 18.04 LTS using an input file generated by the program MSDB (Microsatellite Search and Building Database). But I get an error saying the final record is not terminated by an '=', but it is. See the output below (include the command I used).

deon@deon-ubuntu:~/Software/primer3/src$

./primer3_core /home/deon/Documents/Microsatellite_Design/Tri/primer_design_TRI_short.txt
SEQUENCE_ID=1
SEQUENCE_TEMPLATE=gccgccgagctaggcctggatcggtcggtctcggcaatcgccgagataaagaggaactcgcgaactttcgttgaaacaatgggaggggcttggctgaggctattagcccggttttgatgccaggcgttatcaagagttgaagccgagccttcaacatcaaccttctttcaggccgccatcttgattccccttgctcccatCCGCCGCCGCCGCCGCCGCCGacgacgccgccgacgacgactaagttttgtaagcttcgaggaagttcgtagaaggagccggcaagcaagcgctattacgtcaactcattattccggtcattttcaataagcgatagtctttcgttggcaacaggcatactgcggccgctcatcaaccatattattaattgctaatattaaaagtcctttcacgaatcctt
SEQUENCE_TARGET=201,21
PRIMER_MAX_END_STABILITY=250.0
PRIMER_PRODUCT_SIZE_RANGE=100-280

SEQUENCE_ID=2
SEQUENCE_TEMPLATE=aaatataattacttataatataattataaaaatacatttacttattaactatggaaattataaaattaatggaaattacttaatcaaatttattttcaatttttcaattttaatttataactttctaaacctaacaatagatacttttatattttatttactttcaccgcttttgtataaaaaaaaaacttactatgagcATAATAATAATAATAATAATAatggtattaacaataattacaaataataaaatttacagcagagtaatatgacattaatgttttgataataaagaccacattgttaaaaataaagaaaagctctccattgaatgaatacatatcaacgttattgtcgcatatgacaaaatagctttcatgctttcgagtaatatatttctatataatataattcaataagc
SEQUENCE_TARGET=201,21
PRIMER_MAX_END_STABILITY=250.0
PRIMER_PRODUCT_SIZE_RANGE=100-280

; Final record not terminated by '='value: 50.0alue: 250.0

; Final record not terminated by '='value: 50.0Y value: `250.0

number of 'ok' primers is sometimes negative

For primer3 v2.5.0 with the following input:

PRIMER_TASK=pick_sequencing_primers
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_PICK_LEFT_PRIMER=0
PRIMER_EXPLAIN_FLAG=1
SEQUENCE_TEMPLATE=TGCTTTCAATCATGTGGGTGATTTTATAGATTGTCATCACCAGCGCGCGC
=

Results in the output:

PRIMER_TASK=pick_sequencing_primers
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_PICK_LEFT_PRIMER=0
PRIMER_EXPLAIN_FLAG=1
SEQUENCE_TEMPLATE=TGCTTTCAATCATGTGGGTGATTTTATAGATTGTCATCACCAGCGCGCGC
PRIMER_RIGHT_EXPLAIN=considered 175, low tm 109, high tm 27, high hairpin stability 5, ok -4
PRIMER_LEFT_NUM_RETURNED=0
PRIMER_RIGHT_NUM_RETURNED=1
PRIMER_INTERNAL_NUM_RETURNED=0
PRIMER_PAIR_NUM_RETURNED=0
PRIMER_RIGHT_0_PENALTY=1.086067
PRIMER_RIGHT_0_SEQUENCE=CGCGCTGGTGATGACAATCT
PRIMER_RIGHT_0=46,20
PRIMER_RIGHT_0_TM=61.086
PRIMER_RIGHT_0_GC_PERCENT=55.000
PRIMER_RIGHT_0_SELF_ANY_TH=5.56
PRIMER_RIGHT_0_SELF_END_TH=0.00
PRIMER_RIGHT_0_HAIRPIN_TH=33.61
PRIMER_RIGHT_0_END_STABILITY=2.4000
=

I don't believe it is valid for the number of ok primers to be negative.

Could primer3 design primers based on alignment

In the documents, I see, I can use multi templates in the file, such as so

SEQUENCE_ID=test1
SEQUENCE_TEMPLATE=GACTGATCGATGCTAGCTACGATCGATCGATGCATGCTAGCTAGCTAGCTGCTAGC
=
SEQUENCE_ID=test2
SEQUENCE_TEMPLATE=CATCATCATCATCGATGCTAGCATCNNACGTACGANCANATGCATCGATCGT
=
SEQUENCE_ID=test3
SEQUENCE_TEMPLATE=NACGTAGCTAGCATGCACNACTCGACNACGATGCACNACAGCTGCATCGATGC
=

But they produce separate results for themselves one by one, not considering them as alignment, or what should I do to design primers based on alignment
My setting is here.

PIMER_TASK=generic
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_INTERNAL_OLIGO=1
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_OPT_SIZE=20
PRIMER_MIN_SIZE=15
PRIMER_MAX_SIZE=26
PRIMER_MAX_NS_ACCEPTED=0
PRIMER_PRODUCT_SIZE_RANGE=500-600
SEQUENCE_EXCLUDED_REGION=500,900
PRIMER_EXPLAIN_FLAG=1
=

The salt ion correction formula in file thal.c is inconsistent with that in file oligotm.c

@brantfaircloth @untergasser @zamaudio @ioanacut @bioinfo-ut
Thank you very much for your outstanding contribution to this project. About salt concentration correction formula, I checked file thal.c and file oligotm.c.
There is only one function in file thal.c that implements method santalucia, and three implemented method in file oligotm.c, schildkraut, santalucia, owczarzy. Can you add the other two methods to file thal.c.

file thal.c

static double
saltCorrectS (double mv, double dv, double dntp)
{
  if(dv <= 0) dntp = dv;
  return 0.368*((log((mv + 120*(sqrt(fmax(0.0, dv - dntp)))) / 1000)));
}

file oligotm.c

double
oligotm(const  char *s,
     double DNA_nM,
     double K_mM,
     double divalent_conc,
     double dntp_conc,
     tm_method_type  tm_method,
     salt_correction_type salt_corrections)
{
  register int dh = 0, ds = 0;
  register char c;
  double delta_H, delta_S;
  double Tm; /* Melting temperature */
  double correction;
  int len, sym;
  const char* seq = s;
  if(divalent_to_monovalent(divalent_conc, dntp_conc) == OLIGOTM_ERROR) {
    return OLIGOTM_ERROR;
  }

  /** K_mM = K_mM + divalent_to_monovalent(divalent_conc, dntp_conc); **/
  if (tm_method != breslauer_auto
      && tm_method != santalucia_auto) {
    return OLIGOTM_ERROR;
  }
  if (salt_corrections != schildkraut
      && salt_corrections != santalucia
      && salt_corrections != owczarzy) {
    return OLIGOTM_ERROR;
  }

  len = ((int)strlen(s)-1);

  sym = symmetry(s); /*Add symmetry correction if seq is symmetrical*/
  if( tm_method == breslauer_auto ) {
    ds=108;
  }
  else {
    if(sym == 1) {
      ds+=14;
    }

    /** Terminal AT penalty **/

    if (    (strncmp("A", s, 1) == 0)
        ||  (strncmp("T", s, 1) == 0) )  {
      ds += -41;
      dh += -23;
    } else if (   (strncmp("C", s, 1) == 0)
              ||  (strncmp("G", s, 1) == 0) ) {
      ds += 28;
      dh += -1;
    }
    s += len;
    if (  (strncmp("T", s, 1) == 0)
       || (strncmp("A", s, 1) == 0) ) {
      ds += -41;
      dh += -23;
    } else if ( (strncmp("C", s, 1) == 0)
              ||(strncmp("G", s, 1) == 0) ) {
      ds += 28;
      dh += -1;
    }
    s -= len;
  }
  /* Use a finite-state machine (DFA) to calucluate dh and ds for s. */
  c = *s; s++;
  if (tm_method == breslauer_auto) {
    if (c == 'A') goto A_STATE;
    else if (c == 'G') goto G_STATE;
    else if (c == 'T') goto T_STATE;
    else if (c == 'C') goto C_STATE;
    else if (c == 'N') goto N_STATE;
    else goto ERROR;
    STATE(A);
    STATE(T);
    STATE(G);
    STATE(C);
    STATE(N);
  } else {
    if (c == 'A') goto A_STATE2;
    else if (c == 'G') goto G_STATE2;
    else if (c == 'T') goto T_STATE2;
    else if (c == 'C') goto C_STATE2;
    else if (c == 'N') goto N_STATE2;
    else goto ERROR;
    STATE2(A);
    STATE2(T);
    STATE2(G);
    STATE2(C);
    STATE2(N);
  }


 DONE:  /* dh and ds are now computed for the given sequence. */
  delta_H = dh * -100.0;  /*
         * Nearest-neighbor thermodynamic values for dh
         * are given in 100 cal/mol of interaction.
         */
  delta_S = ds * -0.1;     /*
          * Nearest-neighbor thermodynamic values for ds
          * are in in .1 cal/K per mol of interaction.
          */
  Tm=0;  /* Melting temperature */
  len=len+1;

   /**********************************************/
  if (salt_corrections == schildkraut) {
     K_mM = K_mM + divalent_to_monovalent(divalent_conc, dntp_conc);
     correction = 16.6 * log10(K_mM/1000.0) - T_KELVIN;
     Tm = delta_H / (delta_S + 1.987 * log(DNA_nM/4000000000.0)) + correction;
  } else if (salt_corrections== santalucia) {
    K_mM = K_mM + divalent_to_monovalent(divalent_conc, dntp_conc);
    delta_S = delta_S + 0.368 * (len - 1) * log(K_mM / 1000.0 );
    if(sym == 1) { /* primer is symmetrical */
      /* Equation A */
      Tm = delta_H / (delta_S + 1.987 * log(DNA_nM/1000000000.0)) - T_KELVIN;
    } else {
      /* Equation B */
      Tm = delta_H / (delta_S + 1.987 * log(DNA_nM/4000000000.0)) - T_KELVIN;
    }
  } else if (salt_corrections == owczarzy) {
    double gcPercent=0;
    double free_divalent; /* conc of divalent cations minus dNTP conc */
    int i;

    /**** BEGIN: UPDATED SALT BY OWCZARZY *****/
    /* different salt corrections for monovalent (Owczarzy et al.,2004)
      and divalent cations (Owczarzy et al.,2008) */
    /* competition bw magnesium and monovalent cations, see Owczarzy et al., 2008 Figure 9 and Equation 16 */

    static const double crossover_point = 0.22; /* depending on the value of div_monov_ratio respect
               to value of crossover_point Eq 16 (divalent corr, Owczarzy et al., 2008)
               or Eq 22 (monovalent corr, Owczarzy et al., 2004) should be used */
    double div_monov_ratio;
    static double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0;

    for(i = 0; i <= len && seq != NULL && seq != '\0';) {
      if(*seq == 'C' || *seq == 'G') {
        gcPercent++;
      }
      seq++;
      i++;
    }
    gcPercent = (double)gcPercent/((double)len);

    if(dntp_conc >= divalent_conc) {
      free_divalent = 0.00000000001; /* to not to get log(0) */
    } else {
      free_divalent = (divalent_conc - dntp_conc)/1000.0;
    }

    if(K_mM==0) {
      div_monov_ratio = 6.0;
    } else {
      div_monov_ratio = (sqrt(free_divalent))/(K_mM/1000); /* if conc of monov cations is provided
                    a ratio is calculated to further calculate
                    the _correct_ correction */
    }
    if (div_monov_ratio < crossover_point) {
      /* use only monovalent salt correction, Eq 22 (Owczarzy et al., 2004) */
      correction
        = (((4.29 * gcPercent) - 3.95) * pow(10,-5) * log(K_mM / 1000.0))
          + (9.40 * pow(10,-6) * (pow(log(K_mM / 1000.0),2)));
    } else {
      /* magnesium effects are dominant, Eq 16 (Owczarzy et al., 2008) is used */
      b =- 9.11 * pow(10,-6);
      c = 6.26 * pow(10,-5);
      e =- 4.82 * pow(10,-4);
      f = 5.25 * pow(10,-4);
      a = 3.92 * pow(10,-5);
      d = 1.42 * pow(10,-5);
      g = 8.31 * pow(10,-5);
      if(div_monov_ratio < 6.0) {
        /* in particular ratio of conc of monov and div cations
        *             some parameters of Eq 16 must be corrected (a,d,g) */
        a = 3.92 * pow(10,-5) * (0.843 - (0.352 * sqrt(K_mM/1000.0) * log(K_mM/1000.0)));
        d = 1.42 * pow(10,-5) * (1.279 - 4.03 * pow(10,-3) * log(K_mM/1000.0) - 8.03 * pow(10,-3) * pow(log(K_mM/1000.0),2));
        g = 8.31 * pow(10,-5) * (0.486 - 0.258 * log(K_mM/1000.0) + 5.25 * pow(10,-3) * pow(log(K_mM/1000.0),3));
      }

      correction = a + (b * log(free_divalent))
                  + gcPercent * (c + (d * log(free_divalent)))
                  + (1/(2 * (len - 1))) * (e + (f * log(free_divalent))
                  + g * (pow((log(free_divalent)),2)));
    }
    /**** END: UPDATED SALT BY OWCZARZY *****/
    if (sym == 1) {
      /* primer is symmetrical */
      /* Equation A */
      Tm = 1/((1/(delta_H
                    /
              (delta_S + 1.9872 * log(DNA_nM/1000000000.0)))) + correction) - T_KELVIN;
    } else {
      /* Equation B */
      Tm = 1/((1/(delta_H
          /
        (delta_S + 1.9872 * log(DNA_nM/4000000000.0)))) + correction) - T_KELVIN;
    }
  } /* END else if (salt_corrections == owczarzy) { */


   /***************************************/
   return Tm;
ERROR:  /*
    * length of s was less than 2 or there was an illegal character in
    * s.
    */
  return OLIGOTM_ERROR;
}

poly_x calculation failures

The documentation doesn't cover how Ns are handled when evaluating for MAX_POLY_X, but with the current implementation, 'GGGNNN' violates MAX_POLY_X=5. I take this to mean that the MAX_POLY_X evaluation should always be based on the worst possible case (all 3 Ns could be Gs). However, 'GGGNGG' does not currently violate MAX_POLY_X=5 nor does 'NNNNNG' even though substituting Ns for Gs in these examples would result in a run 6 identical base pairs.

Possible BUG: No triloop and tetraloop bonuses for entropy?

According to SantaLucia (2004):
For hairpins of length 3 Gibbs free energy can be calculated by the following equation:
dG◦37(total) = dG◦37(Hairpin of 3) + dG◦37(triloop bonus) + closing AT penalty.
Hairpin loop dH◦ and dS◦ are computed with equations analogous for Gibbs free energy.

Primer3 uses equation dS◦37(total) = dS◦37(Hairpin of 3) + dS◦37(triloop bonus) + dS(closing AT penalty) to calculate entropy in calc_hairpin function in thal.c file.

If I printf values, I can see that triloop bonus and tetraloop bonus are not applied for entropy. Could you confirm that it's done intentionally? I can't find confirmation in SantaLucia 2004 that triloop and tetraloop bonuses for entropy equal 0.

For input "/ntthal -s1 AGGCAGAATGCCT -a HAIRPIN" my output of intermediate calculations is:
I'm going to start calc_hairpin method with parameters i: 5, j: 9, numSeq1[i]: 0, numSeq1[j]: 3
loopSize: 3
loop size is <= 30, I'm going to add 0.000000 to enthalpy and -11.280000 to entropy
Hairpin properties after size-based correction: Enthalpy 0.000000, Entropy -11.280000
Your loop is 3 bp! I need to add AT-penalty if I can. AT penalty is enthalpy: 2200.000000, entropy: 6.900000
New enthalpy: 2200.000000, new entropy: -4.380000
Triloop bonus for enthalpy is: -1500.000000
Triloop bonus for entropy is: 0.000000
New enthalpy after triloop bonus: 700.000000, new entropy: -4.380000
calc_hairpin method is finished. Return enthalpy: 700.000000, entropy: -4.380000

Thank you so much for such indispensable tool!

Regards,
Oleg

Crash in check_primers if primers are perfect match

Primer3 version: 2.5.0

Input file:

PRIMER_TASK=check_primers
SEQUENCE_PRIMER=CACCCCCATCAAACTCTTACTCA
SEQUENCE_PRIMER_REVCOMP=TGAGTAAGAGTTTGATGGGGGTG
=

Output:

temporaryprimer3:libprimer3.cc:4065, assertion (ppair->right->start - ppair->left->start + 1 > 0) failed
Aborted (core dumped)

Primer3 not finding microsatellite primers from reference genome

I have a full published plant genome (280Mb). I ran MISA to identify microsatellite regions and found approx 100,000 hits. I then formatted the output files for Primer3 (I used my own script to include 150bp either side of the identified SSR) and ran with default settings. From this I got zero suggested primers (I increased maximum primer size and decreased minimum melting temperature as suggested - still no hits). Thus, I set PRIMER_EXPLAIN_FLAG=1 and have 200000+ (forward & reverse) files. As I understand all these discarded "primers" listed in these files failed. Could someone please explain why a complete genome would yield no hits. For example, for the following discarded primer has the following metrics:

21 20 0 50.00 59.490 3.00 1.00 0.510

Quality is 0.51 (as I understand this is good - i.e. low; from the example file downloaded with the software the selected/outputted primers have quality of 3, which is worse as I understand); self-annealing values are also low/good (3 & 1); GC is 50% & temp is 59.49 - are these the reasons it is not accepted under defaults?

If P3 cannot find particularly likely candidate primers, what strategy should I use to select the best potential primers from the files I have created?

Any help much appreciated thanks

Clive

Question re TEMPLATE_MISPRIMING parameters

is there a way to restrict the consideration of primer mispriming to a certain number of bases from the 3' end of the primer? In other words, make it so that the PRIMER_MAX_TEMPLATE_MISPRIMING parameter ("The maximum allowed similarity to ectopic sites in the template. ") only takes into account a specified portion of the primer nearest the 3' end. Is that possible?

Multiplexing assays takes a lot of time

Running the primer3_core , primer_tk pre takes a lot of time. Is there a way to improve processing and decrease time? This will really help with the purpose of using Primer TK when we are looking to design primers for multiplexed assays.

install problem

My computer is win7 x64 and I installed python2.7 x64 and Microsoft Visual C++ Compiler for Python 2.7. I have used pip install, python setup.py install, and git method.
All of them will showed the problems as following:

thal.c
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s

rc\libprimer3\thal.c(116) : error C2099: initializer is not a constant
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(349) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(418) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(429) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(430) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(438) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(440) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(442) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(444) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(450) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(454) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(459) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(474) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(475) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(479) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(480) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(500) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(503) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(510) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(549) : warning C4013: 'isfinite' undefined; assuming extern
returning int
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(741) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(754) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(767) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(814) : warning C4996: 'strcpy': This function or variable m
ay be unsafe. Consider using strcpy_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(815) : warning C4996: 'strcat': This function or variable m
ay be unsafe. Consider using strcat_s instead. To disable deprecation, use CRT
SECURE_NO_WARNINGS. See online help for details.
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(832) : warning C4013: 'fmax' undefined; assuming extern ret
urning int
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1884) : error C2143: syntax error : missing ';' before 'typ
e'
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1885) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1885) : warning C4047: '=' : 'int' differs in levels of ind
irection from 'double *'
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1886) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1886) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1887) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1887) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1948) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1948) : warning C4047: 'function' : 'double *' differs in l
evels of indirection from 'int'
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1948) : warning C4024: 'RSH' : different types for formal a
nd actual parameter 3
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1949) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1949) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1949) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1949) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1950) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1950) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1950) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1950) : error C2109: subscript requires array or pointer ty
pe
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1955) : error C2065: 'SH' : undeclared identifier
c:\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\primer3\s
rc\libprimer3\thal.c(1955) : warning C4022: 'free' : pointer mismatch for actual
parameter 1
error: command 'C:\Users\RM\AppData\Local\Programs\Common\Micro
soft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit statu
s 2

----------------------------------------

Command "c:\python27\python.exe -u -c "import setuptools, tokenize;file='c:
\users\RM\appdata\local\temp\pip-install-6hsiy1\primer3-py\setup.py
';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n'
);f.close();exec(compile(code, file, 'exec'))" install --record c:\users\ron
gming\appdata\local\temp\pip-record-9btr_x\install-record.txt --single-version-e
xternally-managed --compile" failed with error code 1 in c:\users\RM\appda
ta\local\temp\pip-install-6hsiy1\primer3-py\

feature request: ability to specify left and right primer overhangs

Some pcr experiments required adding overhangs to primers, e.g. restriction sites or homology arms. It would be nice to be able to tell primer3 about left and right primer overhangs that should be taken into account when doing hairpin and self-dimer scoring for the final primer.

how to determine the integer input for SEQUENCE_OVERLAP_JUNCTION_LIST

Hi,

I have a question regarding to how to determine the integer input for SEQUENCE_OVERLAP_JUNCTION_LIST. Suppose I have a gene which have 3 exons with their length of 10,12,15 respectively. In this case, what should be the input integer for SEQUENCE_OVERLAP_JUNCTION_LIST? Is it something like "10 22 37" where 22 is first two exon's length and 37 is the all three's. If yes, what if this gene is on reverse strand? Is this going to be a different integer list?

Thank you

PRIMER_LOWERCASE_MASKING=1 has no effect

As title says, even when lowercase masking is set in the settings file it has no affect on the primers returned. Many that are returned are entirely within a lowercase masked region.

Edit: this only seems to happen in the command-line program (primer3-2.4.0). Using the same settings file for both the web and command-line version of primer3 returns different results. (The web version works correctly but the command-line version seems to ignore the PRIMER_LOWERCASE_MASKING flag)

How to connect primer 3 with emboss 6.6.0

Hi,I tried to relate primer3_core with eprimer3 by creating softlinks under bin folders and export path to emboss_primer3/32_core. Unfortunately, they didn't work, and always :reported the error that" unable to read sequence; Died: eprimer3/32 terminated: Bad values fpr sequence and no prompt. My IO platform is ubuntu18.04.
Would you mind fixing it?
Thanks a lot

How to exclude specific target regions?

For example, polyN have trouble to sanger sequencing, therefore it is better not to place primer pairs around it.

The tag SEQUENCE_EXCLUDED_REGION is not suitable, as it tells primer3 to exclude primer overlaping regions, not internal regions

TIM截图20190626101120

Take this figure as an example, I want primer A instead of primer B.

Although I can manually extract the amplicon sequences of all the primer pairs, it seems more efficient if we can exclude them in the first step.

Wrong melting temperature in check_primer task

When performing check_primers task via commandline I get completely wrong melting temperatures. Only noticed this now, and this is so unfortunate, because I've been using the tool for years. Below is an example: the actual melting temperature (according to online tools, such as the ThermoFisher primer check) is 68C, and here it says TM=59.738. Since the default parameters on the site are 57 to 62 this shouldn't even pass, supposedly.

SEQUENCE_ID=test123
PRIMER_TASK=check_primers
PRIMER_MIN_SIZE=18
PRIMER_MAX_SIZE=27
SEQUENCE_PRIMER=AGCGGTAGCCACGTTCTG
PRIMER_EXPLAIN_FLAG=1
PRIMER_LEFT_EXPLAIN=considered 1, ok 1
PRIMER_LEFT_NUM_RETURNED=1
PRIMER_TM_FORMULA=1
PRIMER_LEFT_EXPLAIN=considered 1, ok 1
PRIMER_LEFT_NUM_RETURNED=1
PRIMER_RIGHT_NUM_RETURNED=0
PRIMER_INTERNAL_NUM_RETURNED=0
PRIMER_PAIR_NUM_RETURNED=0
PRIMER_LEFT_0_PENALTY=2.261671
PRIMER_LEFT_0_SEQUENCE=AGCGGTAGCCACGTTCTG
PRIMER_LEFT_0=0,18
PRIMER_LEFT_0_TM=59.738
PRIMER_LEFT_0_GC_PERCENT=61.111
PRIMER_LEFT_0_SELF_ANY_TH=0.00
PRIMER_LEFT_0_SELF_END_TH=0.00
PRIMER_LEFT_0_HAIRPIN_TH=46.67
PRIMER_LEFT_0_END_STABILITY=3.0200

Makefile should provide an install target

src/Makefile should provide an install target, so that users can run make install PREFIX=/path/to/install and all binaries and libraries are installed in the right place.

Compiler error on Ubuntu 16.04

g++ -c -g -Wall -O2  -o libprimer3.o libprimer3.cc
In file included from /usr/include/c++/5/unordered_map:35:0,
                 from libprimer3.cc:48:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
libprimer3.cc:52:19: error: '__gnu_cxx' is not a namespace-name
   using namespace __gnu_cxx;
                   ^
libprimer3.cc:52:28: error: expected namespace-name before ';' token
   using namespace __gnu_cxx;
                            ^
libprimer3.cc:129:13: error: 'unordered_map' in namespace 'std' does not name a template type
 static std::unordered_map<int, primer_pair*> **pairs;
             ^
libprimer3.cc: In function 'void free_pair_memory(int)':
libprimer3.cc:1124:3: error: 'unordered_map' is not a member of 'std'
   std::unordered_map<int, primer_pair*> *hmap;
   ^
libprimer3.cc:1124:22: error: expected primary-expression before 'int'
   std::unordered_map<int, primer_pair*> *hmap;
                      ^
libprimer3.cc:1125:3: error: 'unordered_map' is not a member of 'std'
   std::unordered_map<int, primer_pair*>::iterator it;
   ^
libprimer3.cc:1125:22: error: expected primary-expression before 'int'
   std::unordered_map<int, primer_pair*>::iterator it;
                      ^
libprimer3.cc:1131:5: error: 'hmap' was not declared in this scope
     hmap = pairs[i];
     ^
libprimer3.cc:1131:12: error: 'pairs' was not declared in this scope
     hmap = pairs[i];
            ^
libprimer3.cc:1133:12: error: 'it' was not declared in this scope
       for (it=hmap->begin(); it!=hmap->end(); it++) {
            ^
libprimer3.cc:1138:14: error: type '<type error>' argument given to 'delete', expected pointer
       delete hmap;
              ^
libprimer3.cc:1141:8: error: 'pairs' was not declared in this scope
   free(pairs);
        ^
libprimer3.cc: In function 'void choose_pair_or_triple(p3retval*, const p3_global_settings*, const seq_args*, const dpal_arg_holder*, const thal_arg_holder*, const thal_arg_holder*, pair_array_t*)':
libprimer3.cc:1352:3: error: 'unordered_map' is not a member of 'std'
   std::unordered_map<int, primer_pair*> *hmap, *best_hmap = NULL;
   ^
libprimer3.cc:1352:22: error: expected primary-expression before 'int'
   std::unordered_map<int, primer_pair*> *hmap, *best_hmap = NULL;
                      ^
libprimer3.cc:1356:3: error: 'unordered_map' is not a member of 'std'
   std::unordered_map<int, primer_pair*>::iterator it;
   ^
libprimer3.cc:1356:22: error: expected primary-expression before 'int'
   std::unordered_map<int, primer_pair*>::iterator it;
                      ^
libprimer3.cc:1360:3: error: 'pairs' was not declared in this scope
   pairs =
   ^
libprimer3.cc:1361:6: error: 'unordered_map' is not a member of 'std'
     (std::unordered_map<int, primer_pair*>**) 
      ^
libprimer3.cc:1361:25: error: expected primary-expression before 'int'
     (std::unordered_map<int, primer_pair*>**) 
                         ^
libprimer3.cc:1361:25: error: expected ')' before 'int'
libprimer3.cc:1384:7: error: 'hmap' was not declared in this scope
       hmap = pairs[i];  
       ^
libprimer3.cc:1398:16: error: 'it' was not declared in this scope
           for (it=hmap->begin(); it!=hmap->end(); it++) {
                ^
libprimer3.cc:1404:16: error: 'best_hmap' was not declared in this scope
    if (hmap == best_hmap) best_hmap = NULL;
                ^
libprimer3.cc:1405:18: error: type '<type error>' argument given to 'delete', expected pointer
           delete hmap;
                  ^
libprimer3.cc:1434:16: error: 'it' was not declared in this scope
           for (it=hmap->begin(); it!=hmap->end(); it++) {
                ^
libprimer3.cc:1440:16: error: 'best_hmap' was not declared in this scope
    if (hmap == best_hmap) best_hmap = NULL;
                ^
libprimer3.cc:1441:18: error: type '<type error>' argument given to 'delete', expected pointer
           delete hmap;
                  ^
libprimer3.cc:1457:18: error: 'it' was not declared in this scope
             for (it=hmap->begin(); it!=hmap->end(); it++) {
                  ^
libprimer3.cc:1463:18: error: 'best_hmap' was not declared in this scope
      if (hmap == best_hmap) best_hmap = NULL;
                  ^
libprimer3.cc:1464:13: error: type '<type error>' argument given to 'delete', expected pointer
      delete hmap;
             ^
libprimer3.cc:1554:11: error: 'it' was not declared in this scope
           it = hmap->find(j);
           ^
libprimer3.cc:1575:3: error: 'best_hmap' was not declared in this scope
   best_hmap = hmap;
   ^
libprimer3.cc:1587:27: error: 'unordered_map' in namespace 'std' does not name a template type
           hmap = new std::unordered_map<int, primer_pair*>;
                           ^
libprimer3.cc:1587:41: error: expected primary-expression before 'int'
           hmap = new std::unordered_map<int, primer_pair*>;
                                         ^
libprimer3.cc:1650:15: error: 'best_hmap' was not declared in this scope
               best_hmap = hmap;
               ^
libprimer3.cc:1704:9: error: 'best_hmap' was not declared in this scope
       (*best_hmap)[the_best_j] = NULL;
         ^
make: *** [libprimer3.o] Error 1
Makefile:168: recipe for target 'libprimer3.o' failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.