def cn(listAtomConnectNitrogen, l_atom_lig): """search primary stAtom in: list atom connected of nitrogen, list atom ligand out: 1 or 0""" stAtom = toolSubstructure.matrixElement(listAtomConnectNitrogen) if stAtom == ["N", "C"] or stAtom == ["N", "C"]: if toolSubstructure.checkSingleBond(listAtomConnectNitrogen[0], listAtomConnectNitrogen[1]) == 1: if toolSubstructure.checkConectOnlyC(listAtomConnectNitrogen[1], l_atom_lig) == 1 : return 1 return 0
def cnc(l_atom_connectN, l_atom_lig, more_flex = 0): """search secondary connect_element in: list atom connected of nitrogen, list atom ligand out: 1 or 0""" connect_element = toolSubstructure.matrixElement(l_atom_connectN) if connect_element == ["N", "C", "C"]: # print "IN - NH2" if more_flex == 1 : # more flexible control just connectivity #if toolSubstructure.checkConectOnlyC(l_atom_connectN[1], l_atom_lig) == 1 and toolSubstructure.checkConectOnlyC(l_atom_connectN[2], l_atom_lig) == 1: #if toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[1]) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[2]) == 1: return 1 else : if toolSubstructure.checkConectOnlyC(l_atom_connectN[1], l_atom_lig) == 1 and toolSubstructure.checkConectOnlyC(l_atom_connectN[2], l_atom_lig) == 1: if toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[1]) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[2]) == 1: return 1 return 0
def cncc(l_atom_connectN, l_atom_lig, more_flex = 0): """ Search tertiary amine in list of atom lig - Append option """ connect_element = toolSubstructure.matrixElement(l_atom_connectN) if connect_element == ["N", "C", "C", "C"]: if more_flex == 1 : #if toolSubstructure.checkCoplanar(l_atom_connectN[0], l_atom_lig) == 1: # if toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[1], d_min = 1.34) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[2], d_min = 1.34) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[3], d_min = 1.34) == 1: return 1 else : if toolSubstructure.checkConectOnlyC(l_atom_connectN[1], l_atom_lig) == 1 and toolSubstructure.checkConectOnlyC(l_atom_connectN[2], l_atom_lig) == 1 and toolSubstructure.checkConectOnlyC(l_atom_connectN[3], l_atom_lig) == 1: if toolSubstructure.checkCoplanar(l_atom_connectN[0], l_atom_lig) == 1: if toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[1]) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[2]) == 1 and toolSubstructure.checkSingleBond(l_atom_connectN[0], l_atom_connectN[3]) == 1: return 1 return 0
def acidCarboxylic(l_C2, l_atom_lig) : l_serial = [] connectO1 = toolSubstructure.matrixElement(l_C2) if connectO1 != ["O", "C"] : return [0, []] else : l_serial.append (l_C2[0]["serial"]) l_connect3, connectC2 = retrieveAtom.atomConnect(l_atom_lig, l_C2[1]["serial"]) connectC2.sort() if connectC2 == ["C", "C", "O", "O"] : l_serial.append (l_connect3[0]["serial"]) for atom3 in l_connect3[1:] : if atom3["element"] == "O" and not atom3["serial"] in l_serial: l_O2, connectO2 = retrieveAtom.atomConnect(l_atom_lig, atom3["serial"]) if connectO2 == ["O", "C"] : l_serial.append (atom3["serial"]) else : return [0, []] elif atom3["element"] == "C" and not atom3["serial"] in l_serial : l_atomC4, connectC4 = retrieveAtom.atomConnect(l_atom_lig, atom3["serial"]) # print connectC4, "Check" connectC4_unique = sorted(set(connectC4),key=connectC4.index) # print connectC4_unique if connectC4_unique != ["C"] : return [0, []] else : for atom_conex in l_atomC4[1:] : if toolSubstructure.checkSingleBond(l_atomC4[0], atom_conex) == 0 : return [0, []] # check 3 atom and not a hydroxyl group if len (l_serial) == 3 : return [1, l_serial] return [0, []]