Primer3Plus¶
v1.0.8. (Changelog)
Github: https://github.com/jvrana/primer3-py-plus
Primer3Plus is a Python DNA primer design tool based off of primer3 1 2 and the Python primer3 wrapper https://pypi.org/project/primer3-py/.
design = Design()
t = "AGCGTCGTGTATGGTAGTGTATTTGCGTTGACGTTGCTGACGTCGTTGAGTCGT"
design.settings.template(t)
design.settings.product_size((len(t), len(t)))
design.settings.as_cloning_task()
design.run()
design = Design()
design.settings.template("AGCGTCGTGTATGGTAGTGTATTTGCGTTGACGTTGCTGACGTCGTTGAGTCGT")
design.settings.as_cloning_task()
design.settings.left_sequence("AGCGTCGTGTATGGTAGTG")
design.run_and_optimize(5)
For more info, take a look at the API Docs
For a list of design parameters available, take a look at the BoulderIO Parameters
For more examples, see the Usage Docs and some of the following:
Getting started¶
Installation¶
pip install primer3plus -U
Making a primer design task¶
The preferred way to start a design is to use the primer3plus.Design.settings()
property, which provides many helper methods for setting parameters.
If you’re using an interactive notebook or terminal, hitting TAB after typing
design.settings will provide all of the standard design settings
design = Design()
design.settings.left_sequence('AGCGTCGTGTATGGTAGTG')
design.settings.template('AGGGGCGGAGGTGTAGTCGTCGTTAGCGTTAGTCTA')
You can also interact with the parameters more directly. To get the parameters, use
the get
method. From there you can set the value,
print parameter information, set defaults
param = design.get('LEFT_SEQUENCE')
# print parameter information
print(param)
# print help url
print(param.help())
# set a new value
param.value = "AGGTAGTAT"
# set back to the default value
param.set_default()
You can set the value of the parameter using value or using the
set <primer3plus.Design.set()
method:
design.set('LEFT_SEQUENCE', 'AGGTATTAGTATATGATAT')
You can also access descriptors of the parameters. Since there are many parameters, this is useful in interactive environments:
design.SEQUENCE_ID.help()
design.SEQUENCE_ID.value = "Seq11123123"
To view all of the parameters as a dictionary, use:
print(dict(design.params))
Running design tasks¶
To run, simply use the run
method:
design.run()
Provided is also a primer3 relaxation procedure, which will gradually relax parameters such as melting temperature and primer size until primer pairs are found:
design.run_and_optimize(5) # run for max of 5 iterations