<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Gibson primer design & assembly
This 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.
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
Step1:  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.
Step2:  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.
Step3:  We extract the GFP sequence from Feature #5. The GFP gene is on the antisense strand, but it is returned in the correct orientation
Step4:  We need to linearize p426GPD vector before the assembly. The SmaI restriction enzyme cuts between the promoter and the terminator.
Step5:  We will amplify mosrt of the fragments using PCR, so we have to design primers first.
Step6:  The primer_design function returns an Amplicon object which describes a PCR amplification
Step7:  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.
Step8:  We would like to have a unique cutting enzyme befor the cyc1 gene, so we should try to find some that dont cut
Step9:  BamHI apparently cuts, lets try with NotI
Step10:  NotI does not cut, lets use this!
Step11:  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
Step12:  Finally, we assemble the fragments using the Assembly class
Step13:  We remove the final fragment, since we want a circular fragment.
<ASSISTANT_TASK:>
Python Code:
from pydna.readers import read
cyc1 = read("cyc1.gb")
cyc1
Explanation: Gibson primer design & assembly
This 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.
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
AF298787
DQ019861
End of explanation
cyc1.isorf()
pUG35 = read("pUG35.gb")
pUG35
p426GPD = read("p426GPD.gb")
p426GPD
Explanation: 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.
End of explanation
pUG35.list_features()
Explanation: 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.
End of explanation
gfp=pUG35.extract_feature(5)
gfp.seq
gfp.isorf()
Explanation: We extract the GFP sequence from Feature #5. The GFP gene is on the antisense strand, but it is returned in the correct orientation:
End of explanation
from Bio.Restriction import SmaI
linear_vector= p426GPD.linearize(SmaI)
linear_vector
from pydna.design import primer_design
Explanation: We need to linearize p426GPD vector before the assembly. The SmaI restriction enzyme cuts between the promoter and the terminator.
End of explanation
cyc1_amplicon = primer_design(cyc1)
Explanation: We will amplify mosrt of the fragments using PCR, so we have to design primers first.
End of explanation
cyc1_amplicon.figure()
gfp_amplicon = primer_design(gfp)
Explanation: The primer_design function returns an Amplicon object which describes a PCR amplification:
End of explanation
fragments = ( linear_vector, cyc1_amplicon, gfp_amplicon, linear_vector )
Explanation: 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.
End of explanation
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
Explanation: We would like to have a unique cutting enzyme befor the cyc1 gene, so we should try to find some that dont cut:
End of explanation
if not any( x.cut(NotI) for x in fragments ):
    print("no cut!")
else:
    print("cuts!")
Explanation: BamHI apparently cuts, lets try with NotI
End of explanation
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
Explanation: NotI does not cut, lets use this!
End of explanation
fragment_list[1].figure()
Explanation: 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:
End of explanation
from pydna.assembly import Assembly
Explanation: Finally, we assemble the fragments using the Assembly class
End of explanation
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()
Explanation: We remove the final fragment, since we want a circular fragment.
End of explanation
<END_TASK>