def main(): SmilesString1 = sys.argv[1] SmilesString2 = sys.argv[2] print SmilesString1, SmilesString2 mw1 = float(tca.molecularMass(SmilesString1)) mw2 = float(tca.molecularMass(SmilesString2)) print mw1, mw2, math.fabs(mw1-mw2) formula1 = tca.MolecularFormula(SmilesString1) formula2 = tca.MolecularFormula(SmilesString2) val = tca.compareFormula(formula1,formula2)
# for ligand1 # cheek if smiles is in dictionary has already be gotten if (lig1 in lig_smiles): smiles1 = lig_smiles[lig1] else: # if not know then get it. smiles1 = spfl.scrape_pdb_for_lig_smiles(lig1) if (smiles1 == ''): continue lig_smiles[lig1] = smiles1 fileout2.write(smiles1 + ' ' + lig1 + '\n') if (lig1 in lig_formula): formula1 = lig_formula[lig1] else: formula1 = tancal.MolecularFormula(smiles1) lig_formula[lig1] = formula1 fileout3.write(formula1 + ' ' + lig1 + '\n') if (lig1 in lig_mw): mw1 = lig_mw[lig1] else: mw1 = float(tancal.molecularMass(smiles1)) lig_mw[lig1] = mw1 # for ligand2 if (lig2 in lig_smiles): smiles2 = lig_smiles[lig2] else: smiles2 = spfl.scrape_pdb_for_lig_smiles(lig2) if (smiles2 == ''):