primer3-org / primer3

Primer3 is a command line tool to select primers for polymerase chain reaction (PCR).
GNU General Public License v2.0
223 stars 64 forks source link

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

Closed drkennetz closed 5 years ago

drkennetz commented 5 years ago

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.

drkennetz commented 5 years ago

Sorry I closed this because I thought it was a mistake in my environment, but it is not. primer3_core runs perfectly on a small mispriming library file, but fails on this large one.

bioinfo-ut commented 5 years ago

It is difficult to tell what's wrong unless we see the exact settings, exact command line options and the repeat file you used. Please provide all the details, then we can try to reproduce the error.

Also, I would suggest using primer3_masker (https://www.ncbi.nlm.nih.gov/pubmed/29360956). It should avoid all the primers that are within tandem repeats and in any other problematic region. It is already integrated into Primer3 code, you just have to switch it on when running primer3_core (PRIMER_MASK_TEMPLATE=1).

drkennetz commented 5 years ago

I did not even know about PRIMER_MARK_TEMPLATE=1, it looks like I also should include the PRIMER_KMER_LISTS_PATH= if this is switched on? If this masks repeats then I will use this instead of the library I put together. There appears to be a link to download KMER_LISTS for primer3 but this is not included by default. The one in the install is 76MB and the one to download is 5GB. If they were close in size I would not bother, but this seems pretty substantial.

drkennetz commented 5 years ago

So my input file looks like this:

SEQUENCE_ID=sample1_gene1_chr1:15000000__
SEQUENCE_TEMPLATE=TGGGCCTCCCCACCTCCACATCTTTGCTCCAGTTGAATGCAGGACACCCTCAGTC...
SEQUENCE_TARGET=199,1
PRIMER_FIRST_BASE_INDEX=1
PRIMER_TASK=pick_detection_primers
PRIMER_MIN_THREE_PRIME_DISTANCE=3
PRIMER_MAX_LIBRARY_MISPRIMING=12.00
PRIMER_PAIR_MAX_LIBRARY_MISPRIMING=20.00
PRIMER_PRODUCT_SIZE_RANGE=200-400
PRIMER_MAX_END_STABILITY=9.0
PRIMER_MAX_SELF_ANY_TH=45.00
PRIMER_MAX_SELF_END_TH=35.00
PRIMER_PAIR_MAX_COMPL_ANY_TH=45.00
PRIMER_PAIR_MAX_COMPL_END_TH=35.00
PRIMER_MAX_HAIRPIN_TH=24.00
PRIMER_MAX_TEMPLATE_MISPRIMING_TH=40.00
PRIMER_PAIR_MAX_TEMPLATE_MISPRIMING_TH=70.00
PRIMER_TM_FORMULA=1
PRIMER_SALT_CORRECTIONS=1
PRIMER_SALT_MONOVALENT=50.0
PRIMER_INTERNAL_SALT_MONOVALENT=50.0
PRIMER_SALT_DIVALENT=1.5
PRIMER_INTERNAL_SALT_DIVALENT=1.5
PRIMER_DNTP_CONC=0.6
PRIMER_INTERNAL_DNTP_CONC=0.6
PRIMER_DNA_CONC=50.0
PRIMER_INTERNAL_DNA_CONC=50.0
PRIMER_THERMODYNAMIC_OLIGO_ALIGNMENT=1
PRIMER_THERMODYNAMIC_TEMPLATE_ALIGNMENT=1
PRIMER_THERMODYNAMIC_PARAMETERS_PATH=/home/dkennetz/primer3/primer3_config/
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_PICK_INTERNAL_OLIGO=1
PRIMER_MAX_POLY_X=3
PRIMER_LEFT_NUM_RETURNED=5
PRIMER_RIGHT_NUM_RETURNED=5
PRIMER_OPT_SIZE=22
PRIMER_MIN_SIZE=18
PRIMER_MAX_SIZE=25
PRIMER_MIN_TM=57
PRIMER_OPT_TM=60
PRIMER_MAX_TM=63
PRIMER_MAX_NS_ACCEPTED=1
PRIMER_KMER_LISTS_PATH=/home/dkennetz/primer3/kmer_lists/
PRIMER_NUM_RETURN=5
P3_FILE_FLAG=1
PRIMER_EXPLAIN_FLAG=1
PRIMER_MASK_TEMPLATE=1
PRIMER_MIN_GC=20
PRIMER_OPT_GC_PERCENT=50
PRIMER_MAX_GC=80
PRIMER_PAIR_MAX_DIFF_TM=3
=

Sequence Template is a bit longer but wouldn't fit. When I try to run command line:

primer3_core --output=primer_dump.txt primer3_input.txt

I get the error:

PRIMER_ERROR=masking template chosen, but path to kmer lists not specified

I also tried adding the kmer lists path below the PRIMER_MASK_TEMPLATE=1 command and returned the same error.

drkennetz commented 5 years ago

Your documentation in the release_notes.txt located here calls it PRIMER_KMER_LISTS_PATH= but digging through your code, it is actually called PRIMER_MASK_KMERLIST_PATH=. When I changed it to PRIMER_MASK_KMERLIST_PATH=, values were returned.

drkennetz commented 5 years ago

Last thing I will write, if the PRIMER_MASK_KMERLIST_PATH= is outside of the primer3 directory, so for example: /home/dkennetz/kmer_lists/ and I pass this as an absolute path to primer3 input primer3_core fails and says: Cannot find the lists file. If I move the downloaded list (5.1GB) into the primer3/kmer_lists/ directory it runs successfully if I pass that path: /home/dkennetz/primer3/kmer_lists/ I'm thinking you guys have this setup to search using relative paths to primer3_core which doesn't make a lot of sense.

bioinfo-ut commented 5 years ago

Absolute path works for me in tests: I replaced relative path in primer_masker_input and primer_masker_output to PRIMER_MASK_KMERLIST_PATH=/mambakodu/mremm/primer3/kmer_lists/ and everything worked as expected.

bioinfo-ut commented 5 years ago

The wrong parameter names in release_notes.txt were fixed and updated.

drkennetz commented 5 years ago

But I am saying if the kmer_lists directory is not in the primer3/ directory it did not work. I downloaded the big one 5.1GB off the link in the readme and put it in my home directory because I did not want to mess with the primer3 structure until I was sure I wanted to make a change. So I tried passing the Primer3_input.txt the path /home/dkennetz/kmer_lists/ outside of /home/dkennetz/primer3/kmer_lists/ and it did not work. You still have your kmer list path inside of primer3. Try it in your home directory and let me know how it goes for you when you get some time so I can see if it is a problem locally. Thanks for your help!

bioinfo-ut commented 5 years ago

Works also with: PRIMER_MASK_KMERLIST_PATH=/mambakodu/mremm/kmer_lists/

Make sure you execute the correct version of primer3_core. (v 2.4.0) If there is an older version somewhere on general path, this could cause errors.

drkennetz commented 5 years ago

Good to know, I will check it out. We have a cluster module and I also have a local copy but they are both 2.4.0... I will look into it more. I appreciate the help with this, you can close the issue if you want!