<jupyter_start><jupyter_text>Gibson primer design & assemblyThis notebook describe primer design for assembly of linear DNA fragments by techniques like homologous recombination or Gibson assembly. The goal of this experiemtn is to create a Saccharomyces cerevisiae vector that expresses the cytochrome C1 gene CYC1 with a c-terminal GFP tag using the yeast expression vector p426GPD. We also would like to have a unique restriction site between the promoter in p426GPD (Which is the TDH3 promoter).This notebook designs the necessary primers for this experiment. For more inormation on Gibson assembly, addgene has a nice page [here](https://www.addgene.org/protocols/gibson-assembly/). The first step is to read the sequences from local files. The sequences can also be read directly from genbank using their accession numbers which are:* [V01298](https://www.ncbi.nlm.nih.gov/nuccore/V01298)* [AF298787](https://www.ncbi.nlm.nih.gov/nuccore/AF298787)* [DQ019861](https://www.ncbi.nlm.nih.gov/nuccore/DQ019861)<jupyter_code>from pydna.readers import read
cyc1 = read("cyc1.gb")
cyc1<jupyter_output><empty_output><jupyter_text>The cyc1.gb sequence file only contains the ORF, so we can use it directly. The sequence file can be inspected using the ling above.<jupyter_code>cyc1.isorf()
pUG35 = read("pUG35.gb")
pUG35
p426GPD = read("p426GPD.gb")
p426GPD<jupyter_output><empty_output><jupyter_text>The pUG35 is a plasmid containing the GFP gene. We have to find the exact DNA fragment we want. The pUG35 genbank file contains features, one of which is the GFP ORF. Inspection in ApE concluded that the feature number 5 in the list below is the GFP ORF.<jupyter_code>pUG35.list_features()<jupyter_output><empty_output><jupyter_text>We extract the GFP sequence from Feature 5. The GFP gene is on the antisense strand, but it is returned in the correct orientation:<jupyter_code>gfp=pUG35.extract_feature(5)
gfp.seq
gfp.isorf()<jupyter_output><empty_output><jupyter_text>We need to linearize p426GPD vector before the assembly. The [SmaI](http://rebase.neb.com/rebase/enz/SmaI.html) restriction enzyme cuts between the promoter and the terminator.<jupyter_code>from Bio.Restriction import SmaI
linear_vector= p426GPD.linearize(SmaI)
linear_vector
from pydna.design import primer_design<jupyter_output><empty_output><jupyter_text>We will amplify mosrt of the fragments using PCR, so we have to design primers first.<jupyter_code>cyc1_amplicon = primer_design(cyc1)<jupyter_output><empty_output><jupyter_text>The primer_design function returns an Amplicon object which describes a PCR amplification:<jupyter_code>cyc1_amplicon.figure()
gfp_amplicon = primer_design(gfp)<jupyter_output><empty_output><jupyter_text>Then it is practical to collect all fragments to be assembled in a list or tuple. Note that below, the linear_vector appears both in the beginning and at the end. We do this since we would like to have a circular assembly.<jupyter_code>fragments = ( linear_vector, cyc1_amplicon, gfp_amplicon, linear_vector )<jupyter_output><empty_output><jupyter_text>We would like to have a unique cutting enzyme befor the cyc1 gene, so we should try to find some that dont cut:<jupyter_code>from Bio.Restriction import BamHI
if not any( x.cut(BamHI) for x in fragments ):
    print("no cut!")
else:
    print("cuts!")
from Bio.Restriction import NotI<jupyter_output><empty_output><jupyter_text>BamHI apparently cuts, lets try with NotI<jupyter_code>if not any( x.cut(NotI) for x in fragments ):
    print("no cut!")
else:
    print("cuts!")<jupyter_output>no cut!<jupyter_text>NotI does not cut, lets use this!<jupyter_code>from pydna.dseqrecord import Dseqrecord
site = Dseqrecord(NotI.site)
site.seq
from pydna.design import assembly_fragments
linear_vector.locus = "p426GPD"
cyc1_amplicon.locus = "CYC1"
gfp_amplicon.locus = "GFP"
fragment_list = assembly_fragments((linear_vector, site, cyc1_amplicon,gfp_amplicon,linear_vector))
fragment_list<jupyter_output><empty_output><jupyter_text>We note that the amplicons are now a little bit larger than before. The assembly_fragments function basically adds tails to the primers of amplicon objects to facilitate the assembly. The NotI site is small ,so it was incorporated in the formward PCR primer of the CYC1 Amplicon. We can see that the CYC1 primers are quite a bit longer:<jupyter_code>fragment_list[1].figure()<jupyter_output><empty_output><jupyter_text>Finally, we assemble the fragments using the Assembly class<jupyter_code>from pydna.assembly import Assembly<jupyter_output><empty_output><jupyter_text>We remove the final fragment, since we want a circular fragment.<jupyter_code>fragment_list = fragment_list[:-1]
fragment_list
asm = Assembly(fragment_list)
asm
candidate = asm.assemble_circular()[0]
candidate
p426GPD_CYC1_GFP = candidate
p426GPD_CYC1_GFP.write("p426GPD_CYC1_GFP.gb")
from pydna.amplicon import Amplicon
amplicons1 = [x for x in fragment_list if isinstance(x, Amplicon)]
amplicons1
# Get forward and reverse primer for each Amplicon
primers1 = [(y.forward_primer, y.reverse_primer) for y in amplicons1]
# print primer pairs:
for pair in primers1:
    print(pair[0].format("fasta"))
    print(pair[1].format("fasta"))
    print()<jupyter_output>>f330 CYC1
TAGTTTCGACGGATTCTAGAACTAGTGGATCCCCCGCGGCCGCATGACTGAATTCAAGGC
C

>r330 CYC1
TTCTTCACCTTTAGACATTTACTCACAGGCTTTTTTCA


>f717 feat_AF2987871
AAAAAAGCCTGTGAGTAAATGTCTAAAGGTGAAGAATTATT

>r717 feat_AF2987871
GTATCGATAAGCTTGATATCGAATTCCTGCAGCCCTTATTTGTACAATTCATCCATAC
{'fraction_non_alphanumeric': 0.07525510204081633, 'fraction_numerical': 0.026056851311953354, 'mean_word_length': 6.676923076923077, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 59, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '137977', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1965, 'n_tokens_neox': 1802, 'n_words': 560, 'path': 'notebooks/gibson/gibson.ipynb', 'repo_name': 'MetabolicEngineeringGroupCBMA/pydna-examples', 'size': '5488'}