In [3]:
from tinydb import TinyDB, Query
from Bio.SeqUtils import GC
In [4]:
# Open the database
db = TinyDB('primers.db.json')
In [8]:
# Query for primer 30 and 27
primer_30 = db.get(eid=30)['sequence']
primer_27 = db.get(eid=27)['sequence']
In [9]:
#Verify the sequence:
primer_30
Out[9]:
In [10]:
primer_27
Out[10]:
In [11]:
#Check the GC content of primer 30
GC(primer_30)
Out[11]:
In [12]:
new_primer_30 = primer_30[0:55]
In [13]:
new_primer_30
Out[13]:
In [19]:
end_base = 0
reverse_primer_27 = primer_27[::-1]
for base in reverse_primer_27:
if base == 'G' or base == 'C':
new_primer_27 = reverse_primer_27[end_base:]
print(new_primer_27[::-1])
break
else:
end_base+=1
In [16]:
primer_30
Out[16]:
In [17]:
primer_30[::-1]
Out[17]:
In [20]:
primer_27
Out[20]:
In [21]:
new_primer_27
Out[21]:
In [ ]: