def test_primer_Design(): ''' test_primer_design''' a=Dseqrecord("atgactgctaacccttccttggtgttgaacaagatcgacgacatttcgttcgaaacttacgatg") b=Dseqrecord("ccaaacccaccaggtaccttatgtaagtacttcaagtcgccagaagacttcttggtcaagttgcc") c=Dseqrecord("tgtactggtgctgaaccttgtatcaagttgggtgttgacgccattgccccaggtggtcgtttcgtt") primer_pairs = assembly_primers([a,b,c]) frags=[] for (f,r),t in zip(primer_pairs,[a,b,c]): frags.append(pcr(f,r,t)) asm=Assembly(frags) assert asm.linear_products[0].seguid() == "1eNv3d_1PqDPP8qJZIVoA45Www8" frags=[] primer_pairs = assembly_primers([a,b,c], circular=True) for (f,r),t in zip(primer_pairs,[a,b,c]): frags.append(pcr(f,r,t)) #print frags asm=Assembly(frags) assert asm.circular_products[0].cseguid() == "V3Mi8zilejgyoH833UbjJOtDMbc"
def test_primer_Design_with_linker(self): ''' test_primer_design''' from pydna import Dseqrecord, Assembly, pcr, assembly_primers b = Dseqrecord("agctactgactattaggggttattctgatcatctgatctactatctgactgtactgatcta") l = Dseqrecord("AAATTTCCCGGG") c = Dseqrecord("tctgatctactatctgactgtactgatctattgacactgtgatcattctagtgtattactc") ((bf,br),(cf,cr)) = assembly_primers((b,l,c)) nb = pcr((bf,br),b) nc = pcr((cf,cr),c) asm1 = Assembly((nb,nc)) self.assertEqual(asm1.linear_products[0].seguid(),(b+l+c).seguid(),'l95igKB8iKAKrvvqE9CYksyNx40') b = Dseqrecord("agctactgactattaggggttattctgatcatctgatctactatctgactgtactgatcta") l = Dseqrecord("AAATTTCCCGGG") c = Dseqrecord("tctgatctactatctgactgtactgatctattgacactgtgatcattctagtgtattactc") ((bf,br),(cf,cr)) = assembly_primers((b,l,c), circular = True) nb = pcr((bf,br),b) nc = pcr((cf,cr),c) asm = Assembly((nb,nc)) self.assertEqual((b+l+c).looped().cseguid(), asm.circular_products[0].cseguid(), 'qMEHxKkTsWIXkbqGA5O35631eMU')
def test_primer_Design_with_linker(): ''' test_primer_design''' from pydna import Dseqrecord, Assembly, pcr, assembly_primers b = Dseqrecord("agctactgactattaggggttattctgatcatctgatctactatctgactgtactgatcta") l = Dseqrecord("AAATTTCCCGGG") c = Dseqrecord("tctgatctactatctgactgtactgatctattgacactgtgatcattctagtgtattactc") ((bf,br),(cf,cr)) = assembly_primers((b,l,c)) nb = pcr((bf,br),b) nc = pcr((cf,cr),c) asm1 = Assembly((nb,nc)) assert asm1.linear_products[0].seguid(),(b+l+c).seguid() == 'l95igKB8iKAKrvvqE9CYksyNx40' b = Dseqrecord("agctactgactattaggggttattctgatcatctgatctactatctgactgtactgatcta") l = Dseqrecord("AAATTTCCCGGG") c = Dseqrecord("tctgatctactatctgactgtactgatctattgacactgtgatcattctagtgtattactc") ((bf,br),(cf,cr)) = assembly_primers((b,l,c), circular = True) nb = pcr((bf,br),b) nc = pcr((cf,cr),c) asm = Assembly((nb,nc)) #print (b+l+c).looped().seq assert (b+l+c).looped().cseguid() == asm.circular_products[0].cseguid() #print (b+l+c).looped().cseguid() == 'jdHXfQI5k4Sk2ESiZYfKv4oP2FI' assert (b+l+c).looped().cseguid() == 'jdHXfQI5k4Sk2ESiZYfKv4oP2FI'
# import pydna # template = pydna.read(">t\ntacactcaccgtctatcattatctactatcgactgtatcatctgatagcac") # p1 = pydna.read(">p1\ntacactcaccgtctatcattatc", ds = False) # p2 = pydna.read(">p2\ngtgctatcagatgatacagtcg", ds = False) # ann = pydna.Anneal((p1, p2), template) import pydna a = pydna.Dseqrecord("atgactgctaacccttccttggtgttgaacaagatcgacgacatttcgttcgaaacttacgatg") b = pydna.Dseqrecord( "ccaaacccaccaggtaccttatgtaagtacttcaagtcgccagaagacttcttggtcaagttgcc" ) c = pydna.Dseqrecord( "tgtactggtgctgaaccttgtatcaagttgggtgttgacgccattgccccaggtggtcgtttcgtt" ) primer_pairs = pydna.assembly_primers([a, b, c], circular=True) p = [] for t, (f, r) in zip([a, b, c], primer_pairs): p.append(pydna.pcr(f, r, t)) obj = pydna.Assembly(p) # print(assemblyobj) # @memorize("function") # def times_two(n): # return n*2 # # @memorize("method") # class Doubler(object): # def __init__(self, n): # self.n=n # self.key=str(n)