A Python package for In silico PCR and primer verification.
Project description
PyPCRtool
1. Introduction
1.1 About PyPCRtool
PyPCRtool is a Python package designed to perform in silico PCR simulations and visualize the results through gel electrophoresis. The program provides functionalities to specify forward and reverse primer sequences, load DNA sequences of genes or genomes from files, set mismatch tolerances, simulate PCR amplification, check primer specificity, and visualize PCR product bands on a simulated gel.
1.2 System Requirements
- Python 3.6 or higher
- Required Python libraries:
numpy,matplotlib
1.3 Installation Instructions
To install PyPCRtool, use pip:
pip install pypcrtool
Usage
2. Getting Started
2.1 Basic Concepts
- In Silico PCR: Computational technique to simulate PCR amplification.
- Primers: Short DNA sequences that initiate DNA synthesis.
- Gel Electrophoresis: Technique to visualize DNA fragments based on size.
2.2 Quick Start Guide
- Install PyPCRtool.
- Prepare your DNA sequence file in FASTA format.
- Define your forward and reverse primer sequences.
- Run the PyPCRtool to simulate PCR and visualize results.
3. Detailed Usage
3.1 Setting Up Primers
Primer sequences should be provided as plain text strings. Define forward and reverse primers in your script:
forward_primer = "TCGAGAGGAACAGCCAAACT"
reverse_primer = "TTCCTCATGTCCAGGTCCTC"
3.2 Sequence Files and Formats
DNA sequence file should be in FASTA format and should be in your current working directory or folder:
sequence_file = "sequence.fasta"
3.3 Running In Silico PCR
Instantiate the PyPCRtool object and run the simulation:
from pypcrtool.pcr import InSilicoPCR
pcr_tube = InSilicoPCR(forward_primer, reverse_primer, sequence_file)
products = pcr_tube.perform_pcr()
3.4 Printing PCR Products
Display sequence of PCR product on the screen:
pcr_tube.print_products(products)
3.5 Visualizing Gel Electrophoresis
Generate and display the gel image:
pcr_tube.visualize_gel(products)
3.6 Saving PCR Products and Gel Image
Save PCR products to a file:
pcr_tube.save_products(products, "pcr_products.fasta")
Save Gel image to a file:
pcr_tube.visualize_gel(products, save_path="gel_image.png")
3.7 Customizing Mismatch Tolerances
Set mismatch tolerances when creating the PyPCRtool object:
pcr_tube = InSilicoPCR(forward_primer, reverse_primer, sequence_file, forward_mismatch_tolerance=1, reverse_mismatch_tolerance=1)
3.8 Primer Specificity Check
Check if primers bind to unique sites:
pcr_tube.check_primer_specificity()
4. Practice Examples
4.1 Basic PCR Simulation
from pypcrtool.pcr import InSilicoPCR
forward_primer = "TCGAGAGGAACAGCCAAACT"
reverse_primer = "TTCCTCATGTCCAGGTCCTC"
sequence_file = "sequence.fasta"
pcr_tube = InSilicoPCR(forward_primer, reverse_primer, sequence_file)
products = pcr_tube.perform_pcr()
pcr_tube.print_products(products)
pcr_tube.visualize_gel(products)
4.2 Custom Mismatch Tolerances
from pypcrtool.pcr import InSilicoPCR
forward_primer = "TCGAGAGGAACAGCCAAACT"
reverse_primer = "TTCCTCATGTCCAGGTCCTC"
sequence_file = "sequence.fasta"
pcr_tube = InSilicoPCR(forward_primer, reverse_primer, sequence_file, forward_mismatch_tolerance=1, reverse_mismatch_tolerance=2)
products = pcr_tube.perform_pcr()
pcr_tube.print_products(products)
pcr_tube.visualize_gel(products)
4.3 Primer Specificity Analysis
from pypcrtool.pcr import InSilicoPCR
forward_primer = "TCGAGAGGAACAGCCAAACT"
reverse_primer = "TTCCTCATGTCCAGGTCCTC"
sequence_file = "sequence.fasta"
pcr_tube = InSilicoPCR(forward_primer, reverse_primer, sequence_file)
pcr_tube.check_primer_specificity()
products = pcr_tube.perform_pcr()
pcr_tube.print_products(products)
pcr_tube.visualize_gel(products)
5. Troubleshooting
5.1 Common Issues and Solutions
- Error: Sequence file not found: Ensure the file path is correct.
- No PCR products found: Check primer sequences and mismatch tolerances.
5.2 Frequently Asked Questions (FAQ)
- What formats are supported for DNA sequences? FASTA format is supported.
- Can I set different mismatch tolerances for forward and reverse primers? Yes, they can be set individually
Authors
- Ibrahim Zubairu Waziri, Department of Microbiology and Biotechnology, Federal University Dutse, Jigawa State, Nigeria.
- Mustapha Ibrahim Usman, Department of Biological Sciences, Nigeria Police Academy Wudil, Kano State, Nigeria
- Zainab Ali Dandalma, Department of Microbiology and Biotechnology, Federal University Dutse, Jigawa State, Nigeria
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypcrtool-1.1.1.tar.gz.
File metadata
- Download URL: pypcrtool-1.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe80a659d45e57adb57afa86fb7c9c6ed1ec2768a8849d1d748aa9dd8e68d483
|
|
| MD5 |
e08a13286537d5af5966ec59edde9da6
|
|
| BLAKE2b-256 |
c29fb6d963e1b8d405cc3cd3827bb8d8a2e3fe05c057070d45b1dcf9fe88561b
|
File details
Details for the file pypcrtool-1.1.1-py3-none-any.whl.
File metadata
- Download URL: pypcrtool-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
685e1cf29ce9f68a14d5107f2879677f5c68466f6fb2f25e2c0e5d36e73f364a
|
|
| MD5 |
bb5c5eb7680c41c5dd2ff3d1ee3aaea9
|
|
| BLAKE2b-256 |
6e2f127ba7d68457f12daf61649c6f9f6332916b1038d910bf90e65fb023631f
|