import math


def melting_temp_gc(seq):
    """Return Melting Temp of Sequence Using Modified (Marmur and Doty, 1962) and  
     (Howley et al., 1979) equations improved to Maximise Accuracy. 
     The equation used is accurate for sequences in the 18-25mer range

     `Tm = 100.5 + (41 * (yG+zC)/(wA+xT+yG+zC)) - (820/(wA+xT+yG+zC)) + 16.6*log10([0.050])
     `
    # source: https://academic.oup.com/bioinformatics/article/21/6/711/199347

    """

    Na = 0.050 # log10([Na+] adjusts for the salt adjustment at 50 mM Na+
    total_nucleotide = sum([(seq.count('A') + seq.count('T') + seq.count('G')+ seq.count('C'))])

    tm_marmurdoty = 64.9 + 41.0 * (((seq.count('G')+ seq.count('C')) -16.4)/ total_nucleotide)

    tm_howley = 100.5 + 41.0 * (((seq.count('G')+ seq.count('C')) -16.4 )/ total_nucleotide)

    - (820.0/total_nucleotide) + 16.6 * math.log10(Na)
   
    # result_tm = "Melting Temp by:: Marmur:{},Howley:{}".format(tm_marmurdoty,tm_howley)
    result_tm = {"mt_marmur":tm_marmurdoty,"mt_howley":tm_howley}
    return result_tm