Skip to content

Commit

Permalink
add both dmso and formamide additives, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
olgatsiouri1996 committed May 27, 2023
1 parent 4477da9 commit 38b92a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# tm_calculator_gui
Calculates the melting temperature of a user imported forward and reverse primer based on the SantaLucia, 1998 salt correction formula used also in primer3 and primer blast. It can correct the tm calculation based on the existence of additives formamide & DMSO.
## Windows and ubuntu linux GUI stadalone programs
GUI executables are avaliable in: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7977708.svg)](https://doi.org/10.5281/zenodo.7977708)
GUI executables are avaliable in: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7978091.svg)](https://doi.org/10.5281/zenodo.7978091)
## Citation
Olga Tsiouri. (2023). Tm calculator GUI: Windows and ubuntu linux GUI apps that calculate the melting temperature of a user imported forward and reverse primer based on primer blast default parameters. Zenodo. https://doi.org/10.5281/zenodo.7977708
Olga Tsiouri. (2023). Tm calculator GUI: Windows and ubuntu linux GUI apps that calculate the melting temperature of a user imported forward and reverse primer based on primer blast default parameters. Zenodo. https://doi.org/10.5281/zenodo.7978091
## Depedences
1. python3.10
2. anaconda/miniconda
Expand Down
43 changes: 21 additions & 22 deletions tm_calculator_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
from Bio.SeqUtils import MeltingTemp as mt
from Bio.Seq import Seq
# imput parameters
@Gooey(required_cols=2, program_name='Tm calculator(Celsius)', default_size=(700, 740), header_bg_color= '#DCDCDC', terminal_font_color= '#000000', terminal_panel_color= '#DCDCDC',terminal_font_size=14, clear_before_run=True)
@Gooey(required_cols=2, program_name='Tm calculator(Celsius)', default_size=(740, 740), header_bg_color= '#DCDCDC', terminal_font_color= '#000000', terminal_panel_color= '#DCDCDC',terminal_font_size=20, clear_before_run=True)
def main():
ap = GooeyParser()
ap.add_argument("-forward", "--Forward primer", required=True, type=str, help="forward primer sequence")
ap.add_argument("-reverse", "--Reverse primer", required=True, type=str, help="reverse primer sequence")
ap.add_argument("-forward", "--Forward primer", required=True, type=str, help="Forward primer sequence")
ap.add_argument("-reverse", "--Reverse primer", required=True, type=str, help="Reverse primer sequence")
ap.add_argument("-Na", "--Na", required=False, type=float, default=50.0, help="Na+ concentration")
ap.add_argument("-Mg", "--Mg", required=False, type=float, default=1.5, help="Mg2+ concentration")
ap.add_argument("-dNTPs", "--dNTPs", required=False, type=float, default=0.6, help="dNTPs concentration")
ap.add_argument("-additive", "--additive", required=False, type=str, default="no", choices=["no","yes"], help="correct Tm calculation based on additive/s concertrations")
ap.add_argument("-type", "--additive type", required=False, type=str, default="DMSO", choices=["DMSO","formamide"], help="additive type used")
ap.add_argument("-per", "--percentage of DSMO", required=False, type=float, default=2.0, help="%DMSO concertration")
ap.add_argument("-decrease", "--decrease of DMSO", required=False, type=float, default=0.65, help="How much should Tm decrease per percent DMSO")
ap.add_argument("-conc", "--percentage of formamide", required=False, type=float, default=1.0, help="".join(["%","formamide concertration"]))
ap.add_argument("-dec", "--decrease of formamide", required=False, type=float, default=0.65, help="How much should Tm decrease per percent formamide")
ap.add_argument("-additive", "--PCR additive", required=False, type=str, default="no", choices=["no","yes"], help="Correct Tm calculation based on the additive's concertrations")
ap.add_argument("-type", "--Additive type", required=False, type=str, default="DMSO", choices=["DMSO","formamide"], help="Additive type used")
ap.add_argument("-per", "--Percentage of DSMO", required=False, type=float, default=2.0, help="%DMSO concertration")
ap.add_argument("-Decrease", "--Decrease of DMSO", required=False, type=float, default=0.65, help="How much should Tm Decrease per percent DMSO")
ap.add_argument("-conc", "--Percentage of formamide", required=False, type=float, default=1.0, help="".join(["%","formamide concertration"]))
ap.add_argument("-dec", "--Decrease of formamide", required=False, type=float, default=0.65, help="How much should Tm Decrease per percent formamide")
args = vars(ap.parse_args())
# import forward primer
frwd = Seq(args['Forward primer'])
Expand All @@ -27,23 +27,22 @@ def main():
# calculate Tm of reverse primer
tmr = round(mt.Tm_NN(rever, Na=args['Na'], Mg=args['Mg'], dNTPs=args['dNTPs']), 2)
# if DMSO or formamide is added fix Tm calculation
if args['additive'] == "no":
print(f'The Tm of the forward primer is: {tmf}') # creates the celsius symbol
if args['PCR additive'] == "no":
# print to GUI console
print(f'The Tm of the forward primer is: {tmf}')
print(f'The Tm of the reverse primer is: {tmr}')
print(f'The Tm difference between the primers is: {abs(round(tmf-tmr, 2))}') # abs will keep the difference positive
else:
if args['additive type'] == "DMSO":
fixedtmf = round(mt.chem_correction(tmf, DMSO=args['percentage of DSMO'],DMSOfactor=args['decrease of DMSO']) ,2)
print(f'The Tm of the forward primer is: {fixedtmf}')
fixedtmr = round(mt.chem_correction(tmr, DMSO=args['percentage of DSMO'],DMSOfactor=args['decrease of DMSO']) ,2)
print(f'The Tm of the reverse primer is: {fixedtmr}')
print(f'The Tm difference between the primers is: {abs(round(fixedtmf-fixedtmr, 2))}') # abs will keep the difference positive
if args['Additive type'] == "DMSO":
fixedtmf = round(mt.chem_correction(tmf, DMSO=args['Percentage of DSMO'],DMSOfactor=args['Decrease of DMSO']) ,2)
fixedtmr = round(mt.chem_correction(tmr, DMSO=args['Percentage of DSMO'],DMSOfactor=args['Decrease of DMSO']) ,2)
else:
fixedtmf = round(mt.chem_correction(tmf, fmd=args['percentage of formamide'],fmdfactor=args['decrease of formamide']) ,2)
print(f'The Tm of the forward primer is: {fixedtmf}')
fixedtmr = round(mt.chem_correction(tmr, fmd=args['percentage of formamide'],fmdfactor=args['decrease of formamide']) ,2)
print(f'The Tm of the reverse primer is: {fixedtmr}')
print(f'The Tm difference between the primers is: {abs(round(fixedtmf-fixedtmr, 2))}') # abs will keep the difference positive
fixedtmf = round(mt.chem_correction(tmf, fmd=args['Percentage of formamide'],fmdfactor=args['Decrease of formamide']) ,2)
fixedtmr = round(mt.chem_correction(tmr, fmd=args['Percentage of formamide'],fmdfactor=args['Decrease of formamide']) ,2)
# print to GUI console
print(f'The Tm of the forward primer is: {fixedtmf}')
print(f'The Tm of the reverse primer is: {fixedtmr}')
print(f'The Tm difference between the primers is: {abs(round(fixedtmf-fixedtmr, 2))}') # abs will keep the difference positive

if __name__ == '__main__':
main()

0 comments on commit 38b92a8

Please sign in to comment.