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"
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
def oHAe_parse(skel: 'Skeleton') -> (int, int):
    ch = chain(skel.skeleton)
    res = ch.count("C")
    pos = int((ch.find("=")+1) / 2)
    return (res, pos)
Ejemplo n.º 6
0
def oHAa_parse(skel: 'Skeleton') -> (int):
    res = chain(skel.skeleton).count("C")
    return res
Ejemplo n.º 7
0
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))
Ejemplo n.º 8
0
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