design PCR primers with primer3 on command line
1
0
Entering edit mode
3.1 years ago

Dear all,

I am trying to use PRIMER3 to design primers on the Linux command line. Following the manual, I prepared a file called PRIME with the Boulder-IO syntax:

SEQUENCE_ID=e6 
SEQUENCE_TEMPLATE=ATGTTTCAGGACCCACAGGAGCGACCCATAAAGTTACCAGATTTATGCACAGAGCTGCAAACAACTATACATGATATAATATTAGAATGTGTGTACTGCAAGCAACAGTTACTGCGACGTGAGGTATATGACTTTGCTTT
TCGGGATTTATGCATAGTATATAGAGATGGGAATCCATATGCAGTGTGTGATAAATGTTTAAAGTTTTATTCTAAAATTAGTGAGTATAGATATTATTGTTATAGTTTGTATGGAACAACATTAGAACAGCAATACAACA
AACCGTTGTGTGATTTGTTGATTAGGTGTATTAACTGTCAAAAGCCACTGTGTCCTGAAGAAAAGCAAAGACATCTGGACAAAAAGCAAAGATTCCATAATATAAGGGGTCGGTGGACCGGTCGATGTATGTCTTGTTGC
AGATCATCAAGAACACGTAGAGAAACCCAGCTGTAA
PRIMER_TASK=generic 
PRIMER_PICK_LEFT_PRIMER=1 
PRIMER_PICK_INTERNAL_OLIGO=1 
PRIMER_PICK_RIGHT_PRIMER=1 
PRIMER_OPT_SIZE=18 
PRIMER_MIN_SIZE=15 
PRIMER_MAX_SIZE=21 
PRIMER_MAX_NS_ACCEPTED=0     
PRIMER_PRODUCT_SIZE_RANGE=75-100 
PRIMER_EXPLAIN_FLAG=1     
=

Launching primer3 with the suggested syntax of primer3_core < file I get:

$ primer3_core < PRIME
SEQUENCE_ID=e6 
SEQUENCE_TEMPLATE=ATGTTTCAGGACCCACAGGAGCGACCCATAAAGTTACCAGATTTATGCACAGAGCTGCAAACAACTATACATGATATAATATTAGAATGTGTGTACTGCAAGCAACAGTTACTGCGACGTGAGGTATATGACTTTGCTTTTCGGGATTTATGCATAGTATATAGAGATGGGAATCCATATGCAGTGTGTGATAAATGTTTAAAGTTTTATTCTAAAATTAGTGAGTATAGATATTATTGTTATAGTTTGTATGGAACAACATTAGAACAGCAATACAACAAACCGTTGTGTGATTTGTTGATTAGGTGTATTAACTGTCAAAAGCCACTGTGTCCTGAAGAAAAGCAAAGACATCTGGACAAAAAGCAAAGATTCCATAATATAAGGGGTCGGTGGACCGGTCGATGTATGTCTTGTTGCAGATCATCAAGAACACGTAGAGAAACCCAGCTGTAA
PRIMER_TASK=generic 
PRIMER_PICK_LEFT_PRIMER=1 
PRIMER_PICK_INTERNAL_OLIGO=1 
PRIMER_PICK_RIGHT_PRIMER=1 
PRIMER_OPT_SIZE=18 
PRIMER_MIN_SIZE=15 
PRIMER_MAX_SIZE=21 
PRIMER_MAX_NS_ACCEPTED=0     
PRIMER_PRODUCT_SIZE_RANGE=75-100 
PRIMER_EXPLAIN_FLAG=1     
PRIMER_ERROR=Unrecognized PRIMER_TASK
=
primer3_core: Unrecognized PRIMER_TASK

I tried to remove the file by sending the variables as argument by enclosing the data in " but I got:

$ primer3_core "SEQUENCE_ID=e6 
> SEQUENCE_TEMPLATE=ATGTTTCAGGACCCACAGGAGCGACCCATAAAGTTACCAGATTTATGCACAGAGCTGCAAACAACTATACATGATATAATATTAGAATGTGTGTACTGCAAGCAACAGTTACTGCGACGTGAGGTATATGACTTTGCTTTTCGGGATTTATGCATAGTATATAGAGATGGGAATCCATATGCAGTGTGTGATAAATGTTTAAAGTTTTATTCTAAAATTAGTGAGTATAGATATTATTGTTATAGTTTGTATGGAACAACATTAGAACAGCAATACAACAAACCGTTGTGTGATTTGTTGATTAGGTGTATTAACTGTCAAAAGCCACTGTGTCCTGAAGAAAAGCAAAGACATCTGGACAAAAAGCAAAGATTCCATAATATAAGGGGTCGGTGGACCGGTCGATGTATGTCTTGTTGCAGATCATCAAGAACACGTAGAGAAACCCAGCTGTAA
> PRIMER_TASK=generic 
> PRIMER_PICK_LEFT_PRIMER=1 
> PRIMER_PICK_INTERNAL_OLIGO=1 
> PRIMER_PICK_RIGHT_PRIMER=1 
> PRIMER_OPT_SIZE=18 
> PRIMER_MIN_SIZE=15 
> PRIMER_MAX_SIZE=21 
> PRIMER_MAX_NS_ACCEPTED=0     
> PRIMER_PRODUCT_SIZE_RANGE=75-100 
> PRIMER_EXPLAIN_FLAG=1     
> =
> "
Error opening file SEQUENCE_ID=e6 
SEQUENCE_TEMPLATE=ATGTTTCAGGACCCACAGGAGCGACCCATAAAGTTACCAGATTTATGCACAGAGCTGCAAACAACTATACATGATATAATATTAGAATGTGTGTACTGCAAGCAACAGTTACTGCGACGTGAGGTATATGACTTTGCTTTTCGGGATTTATGCATAGTATATAGAGATGGGAATCCATATGCAGTGTGTGATAAATGTTTAAAGTTTTATTCTAAAATTAGTGAGTATAGATATTATTGTTATAGTTTGTATGGAACAACATTAGAACAGCAATACAACAAACCGTTGTGTGATTTGTTGATTAGGTGTATTAACTGTCAAAAGCCACTGTGTCCTGAAGAAAAGCAAAGACATCTGGACAAAAAGCAAAGATTCCATAATATAAGGGGTCGGTGGACCGGTCGATGTATGTCTTGTTGCAGATCATCAAGAACACGTAGAGAAACCCAGCTGTAA
PRIMER_TASK=generic 
PRIMER_PICK_LEFT_PRIMER=1 
PRIMER_PICK_INTERNAL_OLIGO=1 
PRIMER_PICK_RIGHT_PRIMER=1 
PRIMER_OPT_SIZE=18 
PRIMER_MIN_SIZE=15 
PRIMER_MAX_SIZE=21 
PRIMER_MAX_NS_ACCEPTED=0     
PRIMER_PRODUCT_SIZE_RANGE=75-100 
PRIMER_EXPLAIN_FLAG=1     
=

The same is true if I add a \n at the end of each line.

My questions are:

  1. how shall I write the file to feed primer3_core?

  2. Is there a way to avoid the file and give the data as arguments to primer3_core?

Thnak you

pcr primer3 command line • 2.7k views
ADD COMMENT
1
Entering edit mode
3.1 years ago

Hello marongiu.luigi ,

check each line of your PRIME file that there are no whitespaces at the end.

primer3 tells you what its problem is:

PRIMER_ERROR=Unrecognized PRIMER_TASK

I could reproduce thhis with the file content you've posted above. It turned out that you have whitespace at the end of the line PRIMER_TASK=generic. After removing those the next error arises due to the same problem,

fin swimmer

ADD COMMENT
0
Entering edit mode

Thank you, now it works for me as well. It was a very tricky bit. It there a way to pass the parameters directly without need of a file?

ADD REPLY
0
Entering edit mode

By the way, I still getting an error at the end of the computation:

PRIMER_ERROR=Input line with no '=': ; Input line with no '=': ; Input line with no '=': ; Final record not terminated by '='
=
primer3_core: Input line with no '=': ; Input line with no '=': ; Input line with no '=': ; Final record not terminated by '='

The = I placed at the end doesn't have spaces and it is followed by a newline.

ADD REPLY
1
Entering edit mode

and it is followed by a newline.

Remove this new line.

ADD REPLY
0
Entering edit mode

Perfect, thank you. Now it went smoothly.

ADD REPLY

Login before adding your answer.

Traffic: 1470 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6