# Code and protocols for making oligopools for ordering proteins
### Setting up the code
```
conda create --name oligo python=3.10
```
```
conda activate oligo
pip install oligopoolio
```
## Quick start
```
from oligopoolio.oligos import get_oligos
SEED = 128
random.seed(SEED)
numpy.random.seed(SEED)
min_gc = 0.25
max_gc = 0.65
min_tm = 10
max_tm = 1000
min_segment_length = 90
max_segment_length = 130
max_length = 500
df = pd.read_csv('AS_inference_ML_codon_optimized.csv')
# Note you need to add in the reverse primer to the end of the sequence i.e. you add on the sequence that is the end
primer_lower = 'GATCCGGC'.lower()
output_directory = '.'
oligo_df = get_oligos(df, 'CodonOptimized', 'id', output_directory, 'gaaataattttgtttaactttaagaaggagatatacat', primer_lower, sequence_end='CTCGAGCACCACCACCACCACCACTGA',
min_gc=min_gc, max_gc=max_gc, min_tm=min_tm, max_tm=max_tm, min_segment_length=min_segment_length, max_segment_length=max_segment_length,
genbank_file="base-pet22b-base-anm.gb", insert_position=5193, simple=True, codon_optimize=False)
oligo_df.to_csv(f'oligos_simple.csv', index=False)
```
This is the backbone I'm putting it into: `base-pet22b-base-anm.gb`.
This will output a csv file with the oligos and also all the genes cut into oligos put into the supplied backbone.
### Dependencies
None outside python for the primer generation.
For the demultiplexing and annotating reads you'll need the following tools added to your path.
1. clustal-omega
2. samtools
3. minimap2
## Generic primers order:
Generic primers:
a. 5’: `gaaataattttgtttaactttaagaaggagatatacat`
b. 3’: `CTCGAGCACCACCACCACCACCACTGAGATCCGGCTGCTAACAAAGC` (i.e. rev comp of 5’ to 3’ region of the end) Histag + 006 primer commonly used in the Arnold lab
## Step 1:
Codon optimize your gene sequences for whichever organism you are planning on expressing with.
I do this using IDT. You can bulk upload your sequences and then download them as a fasta file. **This is your input to this tool!**
#### Getting primers
To generate a primer for a single sequence you would do:
```
from oligopoolio import *
# Placeholder gene ends (replace with your actual gene sequences)
gene = "ATGAGCGATCTGCATAACGAGTCCATTTTTATTACCGGCGGCGGATCGGGATTAGGGCTGGCGCTGGTCGAGCGATTTAT\
CGAAGAAGGCGCGCAGGTTGCCACGCTGGAACTGTCGGCGGCAAAAGTCGCCAGTCTGCGTCAGCGATTTGGCGAACATA\
AATAATCGCGCATTAAGCGGTGTGATGATCAACGCTGATGCGGGTTTAGCGATTCGCGGCATTCGCCACGTAGCGGCTGG\
GCTGGATCTTTAA"
# Standard pET-22b(+) primer sequences
forward_plasmid_primer = "GGAGATATACATATG"
reverse_plasmid_primer = "GCTTTGTTAGCAGCCGGATCTCA"
# Desired Tm range for optimization
desired_tm = 62.0 # Target melting temperature in °C
tm_tolerance = 5.0 # Allowable deviation from the desired Tm
# Generate and optimize forward primer
min_length = 13
max_length = 20
forward_gene_primer, forward_tm = optimize_primer(forward_plasmid_primer, gene, desired_tm, 'forward',
min_length, max_length, tm_tolerance)
reverse_gene_primer, reverse_tm = optimize_primer(reverse_plasmid_primer, gene, desired_tm, 'reverse',
min_length, max_length, tm_tolerance)
```
To generate a primer for a fasta file of sequences you would do the following (this will output it for IDT):
```
make_primers_IDT(fasta_file, remove_stop_codon=True, his_tag='',
max_length=60, min_length=15, tm_tolerance=30, desired_tm=62.0,
forward_primer='gaaataattttgtttaactttaagaaggagatatacat',
reverse_primer='ctttgttagcagccggatc')
```
#### Get flanking primers e.g. you want to PCR a gene out of E.coli
You need the GFF file, you can download this from NCBI, and the gene sequence (here you don't need to
do the optimization from IDT since it is already in the nucleotide sequence).
```
gff_file = f'{test_data_dir}genome_NEB_B/genomic.gff'
reference_fasta = f'{test_data_dir}genome_NEB_B/GCF_001559615.2_ASM155961v2_genomic.fna'
gene_name = 'ysgA'
seqid, start, end, strand, upstream_flank, downstream_flank, gene_seq = get_flanking_primers(gene_name,
gff_file,
reference_fasta)
```
### Simple pools:
Here you have a simple pool with only DNA sequences < 350nt.
When you have short sequences you just need to ensure that you create the gene sequences with an overhang to the backbone.
Then you can use universal primers to amplify the pool (see Generic primers above).
command:
```
make_oligo_single(codon_optimized_fasta, forward_primer='gaaataattttgtttaactttaagaaggagatatacat',
forward_primer_len=15, reverse_primer='gatccggctgctaacaaag', reverse_primer_len=15, max_len=320)
```
### Chimera pools:
Here you have pools with sequences between 350nt and 700nt (e.g. the protoglobins.) In this case the pool will have two sequences for each one, and we need an "overhang" to join
the two parts of the sequence together. So essentially, you want 1) an overhang with the backbone, 2) an overlap with the other sequence, 3) you need to order primers for both the 5-->3 and 3--> for the overhang
to ensure it amplifies correctly.
Again this is just your codon optimized DNA sequences for your genes you want to order, note they should be less than 640 base pairs!
command:
```
make_oligo_double(codon_optimized_fasta, forward_primer='gaaataattttgtttaactttaagaaggagatatacat',
forward_primer_len=15, reverse_primer='gatccggctgctaacaaag', reverse_primer_len=15, max_len=640,
overlap_len=9)
```
##### Chimera pool explanation:
Part 1 is the start of the gene:
- 15bp upstream + gene to 50% of gene
- Forward primer of the start: gaaataattttgtttaactttaagaaggagatatacat
Part 2 is the end of the gene:
- 3’ PCR reverse complement: gcagccaactcagcttcctttcgggctttgttagcagccggatc
- 5’3’ 15bp overlap + the Part1 of the gene + last 50% of sequence + overlap with 3’ primer: e.g. end of this is CCCAATCCACGTCTTgatccggctgctaac
#### Example of a chimera
Gaaggagatatacat = overlap with backbone
Gcagcgtgttcgtcgttt = overlap between the two oligos
Gatccggctgctaac = Overlap with the 3’ primer backbone
**Oligo for part 1:**
gaaggagatatacatATGGACGACCTGGAACGTGCAGGCAAAGATGCGTGGACATTTGAAAAGGCATTAGCGCGCCTGGAAGAAGTAGTAGAACGTCTGGAGAGTGCAGACCTGCCATTGGATAAGGCATTAAGTCTTTACGAGGAGGGCACCCGCCTTGTTCGTTATCTGAACGGTGAATTGAATCGTTTTGAgcagcgtgttcgtcgttt
**Oligo for part 2:**
gcagcgtgttcgtcgtttGCGCGAAGAGGAGGTATCCCCGGAACCTAAAGTCAGTGAGGGGTTTGCTCCCGCGTCAGAAAATGAGTTGTTTCCCTTCGAGGGAGAGGAAGATTTCGCGGAGTGGGAGGATGAAATCGAATTTGAGGAGGAGTTCCCCGGCGAAGAGGAAGAGGGTGATGATCCCAATCCACGTCTTgatccggctgctaac
**Middle of the gene primers:**
- Overhang 5’--> 3’: GCAGCGTGTTCGTCGTTT
- Overhang reverse complement 3’-->5’: AAACGACGAACACGCTGC
### Primer design
All the primer design stuff here is just appended so you should have checked your primers before. I do check the primers using primer3 and provide feedback about the melting temp.
### Debugging bench stuff
This is all use as is, if you find that some of the sequneces didn't amplify, the best thing you can do is to try debugging whether it was the designs or ya messed up a wetlab step.
Some simple things to try:
- PCR amplify specifically the shortest one and the middle one and the longest one
- Clone them in individually and check manually to ensure that there is not a design issue
- Be aware of ones which have a secondary structure hairpin
Raw data
{
"_id": null,
"home_page": "https://github.com/arianemora/oligopoolio/",
"name": "oligopoolio",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "oligopools, protein-engineering",
"author": "Ariane Mora",
"author_email": "ariane.n.mora@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/27/17/87c888c1f0273ac5aae855d1a0813e8503f72d696176e02f92abe3513530/oligopoolio-0.0.8.tar.gz",
"platform": null,
"description": "# Code and protocols for making oligopools for ordering proteins\n\n### Setting up the code\n\n```\nconda create --name oligo python=3.10\n```\n\n```\nconda activate oligo\npip install oligopoolio\n```\n\n## Quick start\n```\nfrom oligopoolio.oligos import get_oligos\nSEED = 128\nrandom.seed(SEED)\nnumpy.random.seed(SEED)\n\nmin_gc = 0.25\nmax_gc = 0.65\nmin_tm = 10\nmax_tm = 1000\nmin_segment_length = 90\nmax_segment_length = 130\nmax_length = 500\n\ndf = pd.read_csv('AS_inference_ML_codon_optimized.csv')\n# Note you need to add in the reverse primer to the end of the sequence i.e. you add on the sequence that is the end\nprimer_lower = 'GATCCGGC'.lower()\noutput_directory = '.'\n\noligo_df = get_oligos(df, 'CodonOptimized', 'id', output_directory, 'gaaataattttgtttaactttaagaaggagatatacat', primer_lower, sequence_end='CTCGAGCACCACCACCACCACCACTGA',\n min_gc=min_gc, max_gc=max_gc, min_tm=min_tm, max_tm=max_tm, min_segment_length=min_segment_length, max_segment_length=max_segment_length,\n genbank_file=\"base-pet22b-base-anm.gb\", insert_position=5193, simple=True, codon_optimize=False)\noligo_df.to_csv(f'oligos_simple.csv', index=False)\n\n```\n\nThis is the backbone I'm putting it into: `base-pet22b-base-anm.gb`.\nThis will output a csv file with the oligos and also all the genes cut into oligos put into the supplied backbone.\n\n### Dependencies \nNone outside python for the primer generation. \n\nFor the demultiplexing and annotating reads you'll need the following tools added to your path. \n1. clustal-omega \n2. samtools \n3. minimap2 \n\n## Generic primers order:\n\nGeneric primers: \na.\t5\u2019: `gaaataattttgtttaactttaagaaggagatatacat`\nb.\t3\u2019: `CTCGAGCACCACCACCACCACCACTGAGATCCGGCTGCTAACAAAGC` (i.e. rev comp of 5\u2019 to 3\u2019 region of the end) Histag + 006 primer commonly used in the Arnold lab \n\n\n## Step 1: \n\nCodon optimize your gene sequences for whichever organism you are planning on expressing with. \n\nI do this using IDT. You can bulk upload your sequences and then download them as a fasta file. **This is your input to this tool!**\n\n#### Getting primers\nTo generate a primer for a single sequence you would do:\n\n```\nfrom oligopoolio import *\n\n# Placeholder gene ends (replace with your actual gene sequences)\ngene = \"ATGAGCGATCTGCATAACGAGTCCATTTTTATTACCGGCGGCGGATCGGGATTAGGGCTGGCGCTGGTCGAGCGATTTAT\\\nCGAAGAAGGCGCGCAGGTTGCCACGCTGGAACTGTCGGCGGCAAAAGTCGCCAGTCTGCGTCAGCGATTTGGCGAACATA\\\nAATAATCGCGCATTAAGCGGTGTGATGATCAACGCTGATGCGGGTTTAGCGATTCGCGGCATTCGCCACGTAGCGGCTGG\\\nGCTGGATCTTTAA\"\n\n# Standard pET-22b(+) primer sequences\nforward_plasmid_primer = \"GGAGATATACATATG\"\nreverse_plasmid_primer = \"GCTTTGTTAGCAGCCGGATCTCA\"\n\n# Desired Tm range for optimization\ndesired_tm = 62.0 # Target melting temperature in \u00b0C\ntm_tolerance = 5.0 # Allowable deviation from the desired Tm\n\n# Generate and optimize forward primer\nmin_length = 13\nmax_length = 20\nforward_gene_primer, forward_tm = optimize_primer(forward_plasmid_primer, gene, desired_tm, 'forward',\n min_length, max_length, tm_tolerance)\nreverse_gene_primer, reverse_tm = optimize_primer(reverse_plasmid_primer, gene, desired_tm, 'reverse',\n min_length, max_length, tm_tolerance)\n```\n\nTo generate a primer for a fasta file of sequences you would do the following (this will output it for IDT):\n\n```\nmake_primers_IDT(fasta_file, remove_stop_codon=True, his_tag='',\n max_length=60, min_length=15, tm_tolerance=30, desired_tm=62.0,\n forward_primer='gaaataattttgtttaactttaagaaggagatatacat',\n reverse_primer='ctttgttagcagccggatc')\n```\n\n\n#### Get flanking primers e.g. you want to PCR a gene out of E.coli\n\nYou need the GFF file, you can download this from NCBI, and the gene sequence (here you don't need to \ndo the optimization from IDT since it is already in the nucleotide sequence).\n```\ngff_file = f'{test_data_dir}genome_NEB_B/genomic.gff'\nreference_fasta = f'{test_data_dir}genome_NEB_B/GCF_001559615.2_ASM155961v2_genomic.fna'\ngene_name = 'ysgA'\nseqid, start, end, strand, upstream_flank, downstream_flank, gene_seq = get_flanking_primers(gene_name,\n gff_file,\n reference_fasta)\n```\n\n### Simple pools:\nHere you have a simple pool with only DNA sequences < 350nt.\n\nWhen you have short sequences you just need to ensure that you create the gene sequences with an overhang to the backbone. \nThen you can use universal primers to amplify the pool (see Generic primers above).\n\n\ncommand:\n```\nmake_oligo_single(codon_optimized_fasta, forward_primer='gaaataattttgtttaactttaagaaggagatatacat', \n forward_primer_len=15, reverse_primer='gatccggctgctaacaaag', reverse_primer_len=15, max_len=320)\n```\n\n### Chimera pools:\nHere you have pools with sequences between 350nt and 700nt (e.g. the protoglobins.) In this case the pool will have two sequences for each one, and we need an \"overhang\" to join \nthe two parts of the sequence together. So essentially, you want 1) an overhang with the backbone, 2) an overlap with the other sequence, 3) you need to order primers for both the 5-->3 and 3--> for the overhang \nto ensure it amplifies correctly.\n\nAgain this is just your codon optimized DNA sequences for your genes you want to order, note they should be less than 640 base pairs! \n\ncommand:\n```\nmake_oligo_double(codon_optimized_fasta, forward_primer='gaaataattttgtttaactttaagaaggagatatacat', \n forward_primer_len=15, reverse_primer='gatccggctgctaacaaag', reverse_primer_len=15, max_len=640, \n overlap_len=9)\n```\n##### Chimera pool explanation:\n\nPart 1 is the start of the gene: \n-\t15bp upstream + gene to 50% of gene \n-\tForward primer of the start: gaaataattttgtttaactttaagaaggagatatacat \n\n\nPart 2 is the end of the gene: \n-\t3\u2019 PCR reverse complement: gcagccaactcagcttcctttcgggctttgttagcagccggatc \n-\t5\u2019\uf0e03\u2019 15bp overlap + the Part1 of the gene + last 50% of sequence + overlap with 3\u2019 primer: e.g. end of this is CCCAATCCACGTCTTgatccggctgctaac \n\n\n#### Example of a chimera\nGaaggagatatacat = overlap with backbone \nGcagcgtgttcgtcgttt = overlap between the two oligos \nGatccggctgctaac = Overlap with the 3\u2019 primer backbone \n\n**Oligo for part 1:** \ngaaggagatatacatATGGACGACCTGGAACGTGCAGGCAAAGATGCGTGGACATTTGAAAAGGCATTAGCGCGCCTGGAAGAAGTAGTAGAACGTCTGGAGAGTGCAGACCTGCCATTGGATAAGGCATTAAGTCTTTACGAGGAGGGCACCCGCCTTGTTCGTTATCTGAACGGTGAATTGAATCGTTTTGAgcagcgtgttcgtcgttt\n\n**Oligo for part 2:** \ngcagcgtgttcgtcgtttGCGCGAAGAGGAGGTATCCCCGGAACCTAAAGTCAGTGAGGGGTTTGCTCCCGCGTCAGAAAATGAGTTGTTTCCCTTCGAGGGAGAGGAAGATTTCGCGGAGTGGGAGGATGAAATCGAATTTGAGGAGGAGTTCCCCGGCGAAGAGGAAGAGGGTGATGATCCCAATCCACGTCTTgatccggctgctaac\n\n**Middle of the gene primers:** \n-\tOverhang 5\u2019--> 3\u2019: GCAGCGTGTTCGTCGTTT \n-\tOverhang reverse complement 3\u2019-->5\u2019: AAACGACGAACACGCTGC \n\n\n### Primer design\nAll the primer design stuff here is just appended so you should have checked your primers before. I do check the primers using primer3 and provide feedback about the melting temp.\n\n\n### Debugging bench stuff\nThis is all use as is, if you find that some of the sequneces didn't amplify, the best thing you can do is to try debugging whether it was the designs or ya messed up a wetlab step.\n\nSome simple things to try: \n-\tPCR amplify specifically the shortest one and the middle one and the longest one \n-\tClone them in individually and check manually to ensure that there is not a design issue \n-\tBe aware of ones which have a secondary structure hairpin \n\n\n",
"bugtrack_url": null,
"license": "GPL3",
"summary": null,
"version": "0.0.8",
"project_urls": {
"Bug Tracker": "https://github.com/arianemora/oligopoolio/",
"Documentation": "https://github.com/arianemora/oligopoolio/",
"Homepage": "https://github.com/arianemora/oligopoolio/",
"Source Code": "https://github.com/arianemora/oligopoolio/"
},
"split_keywords": [
"oligopools",
" protein-engineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "79f23cbed7610c9d8dcc840c071feea1807082e368ac413e4f032c7c726fd5dd",
"md5": "4411c3dd0089b272ee72cc20d3c5c423",
"sha256": "68284b8fe268aef09a608bc7d95f30acce05dba82bf1368e977dfd872c16f625"
},
"downloads": -1,
"filename": "oligopoolio-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4411c3dd0089b272ee72cc20d3c5c423",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 25844,
"upload_time": "2025-07-22T07:28:56",
"upload_time_iso_8601": "2025-07-22T07:28:56.337814Z",
"url": "https://files.pythonhosted.org/packages/79/f2/3cbed7610c9d8dcc840c071feea1807082e368ac413e4f032c7c726fd5dd/oligopoolio-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "271787c888c1f0273ac5aae855d1a0813e8503f72d696176e02f92abe3513530",
"md5": "6e77fe04bf8fe34127743d5f093db53d",
"sha256": "64b75fb2ced62e1517b2daac8885a08d3be6bf60df913e100cb1c64c4d7ba7e5"
},
"downloads": -1,
"filename": "oligopoolio-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "6e77fe04bf8fe34127743d5f093db53d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 28481,
"upload_time": "2025-07-22T07:28:57",
"upload_time_iso_8601": "2025-07-22T07:28:57.333307Z",
"url": "https://files.pythonhosted.org/packages/27/17/87c888c1f0273ac5aae855d1a0813e8503f72d696176e02f92abe3513530/oligopoolio-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-22 07:28:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "arianemora",
"github_project": "oligopoolio",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "scikit-learn",
"specs": []
},
{
"name": "sciutil",
"specs": []
},
{
"name": "seaborn",
"specs": []
},
{
"name": "sciviso",
"specs": []
},
{
"name": "statsmodels",
"specs": []
},
{
"name": "biopython",
"specs": []
},
{
"name": "jupyterlab",
"specs": []
},
{
"name": "primer3-py",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "gffutils",
"specs": []
},
{
"name": "npysearch",
"specs": []
}
],
"lcname": "oligopoolio"
}