Browse Source

Add source of python program.

master
William Davis 1 year ago
parent
commit
bd6c764f44
  1. 44
      pcr.py

44
pcr.py

@ -0,0 +1,44 @@
#!/usr/bin/env python3
"""Command line utility for getting pcr recipes"""
from termcolor import colored
def main():
while True:
print("Note: this script may be partially broken")
print("Select recipe: 1. taq-pro red 2. choice taq 3. NEB taq 4. Readymix PCR Sigma")
recipe = int(input("> "))
if recipe not in range(1, 5):
print("Invalid choice")
else:
break
print("How many tubes required for this PCR?")
tube_number = int(input("> "))
reagents = [
'H2O:\t\t',
'Buffer:\t\t',
'DNTPs:\t\t',
'Primer F:\t',
'Primer R:\t',
'Taq:\t\t']
#'DNA:\t\t']
cookbook = {
1: [9.00, 0, 0, 1.25, 1.25, 12.50, 1],
2: [6.65, 1, 0.1, 0.50, 0.50, 0.25, 1],
3: [19.875, 2.5, 0.5, 0.50, 0.50, 0.125, 1],
# 4: [19, 0, 0, 2.50, 2.50, 25, 1]}
4: [4, 0, 0, 0.50, 0.50, 5, 1]}
for index, reagent in enumerate(reagents):
if cookbook[recipe][index] > 0:
volume = str(round(cookbook[recipe][index] * tube_number, 8)) + "\tµl"
print(reagent + volume)
#print(colored(reagent + volume, 'white'))
print("Reaction vol:\t" + str(sum(cookbook[recipe])) + "\tµl")
#print(colored("Reaction vol:\t" + str(sum(cookbook[recipe])) + "\tµl", 'green'))
if __name__ == "__main__":
main()
Loading…
Cancel
Save