Purpose

Check the GC-content of all the primers.


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]:
'CACTATAGGCTAGCCTCGAGAGCAAAAGCAGGTCAATTATATTCAGTATGGAAAGAATAA'

In [10]:
primer_27


Out[10]:
'ACTCTAGAGGTACCACGCGTGTAGAAACAAGGTCGTTTTTAAACTATTCAGCATTAATTG'

In [11]:
#Check the GC content of primer 30
GC(primer_30)


Out[11]:
38.333333333333336

Conclusion

Trim primers to increase GC content


In [12]:
new_primer_30 = primer_30[0:55]

In [13]:
new_primer_30


Out[13]:
'CACTATAGGCTAGCCTCGAGAGCAAAAGCAGGTCAATTATATTCAGTATGGAAAG'

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


ACTCTAGAGGTACCACGCGTGTAGAAACAAGGTCGTTTTTAAACTATTCAGCATTAATTG

In [16]:
primer_30


Out[16]:
'CACTATAGGCTAGCCTCGAGAGCAAAAGCAGGTCAATTATATTCAGTATGGAAAGAATAA'

In [17]:
primer_30[::-1]


Out[17]:
'AATAAGAAAGGTATGACTTATATTAACTGGACGAAAACGAGAGCTCCGATCGGATATCAC'

In [20]:
primer_27


Out[20]:
'ACTCTAGAGGTACCACGCGTGTAGAAACAAGGTCGTTTTTAAACTATTCAGCATTAATTG'

In [21]:
new_primer_27


Out[21]:
'GTTAATTACGACTTATCAAATTTTTGCTGGAACAAAGATGTGCGCACCATGGAGATCTCA'

In [ ]: