if pat1 != pat2:
        print " Chirality Assignment Error!"
        print pat1
        print pat2
        break
    else:
        pat = pat1

#   print pat1

    clean_pat = re.sub("<[^>]*>", "", pat)
    source = ch.insert_pattern_string(clean_pat)
    #   print ch.pattern_get_string(source)
    #   print ch.pattern_get_string(m1)
    if ch.match_1v1_b(source, m1) == 0:
        print " Error: Pattern doesn't match with self!"

    pat_isomer = string.replace(pat, "@@", "X")
    pat_isomer = string.replace(pat_isomer, "@", "@@")
    pat_isomer = string.replace(pat_isomer, "X", "@")
    isomer = ch.insert_pattern_string(pat_isomer)
    #   if ch.match_1v1_b(isomer,m1)==1:
    #      if(res!='gly'):
    #         print " Error: Pattern matches the enatiomer"

    pat_racemic = string.replace(pat, "@", "")
    racemic = ch.insert_pattern_string(pat_racemic)

    #   print ch.pattern_get_string(source)
    #   print ch.pattern_get_string(isomer)
Ejemplo n.º 2
0
   "OC(C)(H)N",
   "CC(N)(H)O",

   ]

# S match tests

PIS = map(lambda x:ch.insert_pattern_string(x),IS)
TIS = map(lambda x:ch.insert_pattern_string(x),IS)

PXS = map(lambda x:ch.insert_pattern_string(x),XS)
TXS = map(lambda x:ch.insert_pattern_string(x),XS)

for a in range(0,len(PIS)):
   for b in range(0,len(TIS)):
      if not (ch.match_1v1_b(PIS[a],TIS[b]) == 1):
         print "Error: PIS[%d],TIS[%d]"%(a,b)

for a in range(0,len(TIS)):
   for b in range(0,len(TIS)):
      if not (ch.match_1v1_b(TIS[a],TIS[b]) == 1):
         print "Error: TIS[%d],TIS[%d]"%(a,b)

for a in range(0,len(PXS)):
   for b in range(0,len(TXS)):
      if not (ch.match_1v1_b(PXS[a],TXS[b]) == 1):
         print "Error: PXS[%d],TXS[%d]"%(a,b)

for a in range(0,len(TXS)):
   for b in range(0,len(TXS)):
      if not (ch.match_1v1_b(TXS[a],TXS[b]) == 1):
Ejemplo n.º 3
0
   if pat1!=pat2:
      print " Chirality Assignment Error!"
      print pat1
      print pat2
      break
   else:
      pat = pat1

#   print pat1
   clean_pat = re.sub("<[^>]*>","",pat)
   source = ch.insert_pattern_string(clean_pat)

#   print ch.pattern_get_string(source)
#   print ch.pattern_get_string(m1)
   if ch.match_1v1_b(source,m1)==0:
      print " Error: Pattern doesn't match with self!"

   pat_isomer = string.replace(pat,"@@","X")
   pat_isomer = string.replace(pat_isomer,"@","@@")
   pat_isomer = string.replace(pat_isomer,"X","@")
   isomer = ch.insert_pattern_string(pat_isomer)
   if ch.match_1v1_b(isomer,m1)==1:
      if(res!='gly'):
         print " Error: Pattern matches the enatiomer"

   pat_racemic = string.replace(pat,"@","")
   racemic = ch.insert_pattern_string(pat_racemic)
   
#   print ch.pattern_get_string(source)
#   print ch.pattern_get_string(isomer)
Ejemplo n.º 4
0
    "NC(O)(H)C",
    "OC(C)(H)N",
    "CC(N)(H)O",
]

# S match tests

PIS = map(lambda x: ch.insert_pattern_string(x), IS)
TIS = map(lambda x: ch.insert_pattern_string(x), IS)

PXS = map(lambda x: ch.insert_pattern_string(x), XS)
TXS = map(lambda x: ch.insert_pattern_string(x), XS)

for a in range(0, len(PIS)):
    for b in range(0, len(TIS)):
        if not (ch.match_1v1_b(PIS[a], TIS[b]) == 1):
            print "Error: PIS[%d],TIS[%d]" % (a, b)

for a in range(0, len(TIS)):
    for b in range(0, len(TIS)):
        if not (ch.match_1v1_b(TIS[a], TIS[b]) == 1):
            print "Error: TIS[%d],TIS[%d]" % (a, b)

for a in range(0, len(PXS)):
    for b in range(0, len(TXS)):
        if not (ch.match_1v1_b(PXS[a], TXS[b]) == 1):
            print "Error: PXS[%d],TXS[%d]" % (a, b)

for a in range(0, len(TXS)):
    for b in range(0, len(TXS)):
        if not (ch.match_1v1_b(TXS[a], TXS[b]) == 1):