def id_oBioLi(): if Element("Bz") in formula.consist: return "" if len(formula.consist) != 3: return "" if chain(skel.value) == "CH2-CH-CH2": return "oBioLi"
def oHCa_parse(skel: 'Skeleton') -> (int): val = skel.skeleton obr = val.find("{-") cbr = val.find("-}") cycle = val[obr+2 : cbr] ch = chain(cycle) res = ch.count("C") return res
def oHal_parse(skel: 'Skeleton') -> (int, 'list(tuple(int, str))'): c = chain(skel.skeleton).count("C") subst = flatten(skel.subst) hals = [] for i in range(len(subst)): if subst[i] in db_Hal: hals += [(int(i / 4) + 1, subst[i])] return (c, hals)
def oNNi_parse(skel: 'Skeleton') -> (int, 'list(int)'): c = chain(skel.skeleton).count("C") subst = flatten(skel.subst) ohs = [] for i in range(len(subst)): if subst[i] == "NOO": ohs += [int(i / 4) + 1] return (c, ohs)
def oHAe_parse(skel: 'Skeleton') -> (int, int): ch = chain(skel.skeleton) res = ch.count("C") pos = int((ch.find("=")+1) / 2) return (res, pos)
def oHAa_parse(skel: 'Skeleton') -> (int): res = chain(skel.skeleton).count("C") return res
def oHDi_parse(skel: 'Skeleton') -> (int, int): ch = chain(skel.skeleton) res = ch.count("C") pos1 = int((ch.find("=")+1) / 2) pos2 = int((ch[pos1*2 : ].find("=") + pos1*2 + 1) / 2) return (res, (pos1, pos2))
def oNNi_create(alk: 'Skeleton', no2_p=[]) -> (str): if no2_p == []: no2_p = [chain(alk.skeleton).count("C")] subst = [(x, "NO2") for x in no2_p] res = do_subst(alk, subst) return res