def chem_correction(melting_temp, DMSO=0, fmd=0, DMSOfactor=0.75, fmdfactor=0.65, fmdmethod=1, GC=None):
 if DMSO:
  melting_temp -= (DMSOfactor * DMSO)
 if fmd:
  if (fmdmethod == 1):
   melting_temp -= (fmdfactor * fmd)
  if (fmdmethod == 2):
   if ((GC is None) or (GC < 0)):
    raise ValueError("'GC' is missing or negative")
   melting_temp += (((0.453 * (GC / 100.0)) - 2.88) * fmd)
  if (fmdmethod not in (1, 2)):
   raise ValueError("'fmdmethod' must be 1 or 2")
 return melting_temp

def chem_correction ( melting_temp , DMSO = 0 , fmd = 0 , DMSOfactor = 0.75 , fmdfactor = 0.65 , fmdmethod = 1 , GC = None ) : if DMSO : melting_temp -= ( DMSOfactor * DMSO ) if fmd : if ( fmdmethod == 1 ) : melting_temp -= ( fmdfactor * fmd ) if ( fmdmethod == 2 ) : if ( ( GC is None ) or ( GC < 0 ) ) : raise ValueError ( "'GC' is missing or negative" ) melting_temp += ( ( ( 0.453 * ( GC / 100.0 ) ) - 2.88 ) * fmd ) if ( fmdmethod not in ( 1 , 2 ) ) : raise ValueError ( "'fmdmethod' must be 1 or 2" ) return melting_temp
correct a given tm for dmso and formamide .