You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
==============================
*** Open Babel Error in ParseSimple
SMILES string contains a character 'l' which is invalid
==============================
The problem is shown in handling isomer contains chlorine.
it seems the Cl will be replaced as [C]l. I changed the priority in regular matching, make two character elements get match first and it works. Hope it helps.
smi="[H]c(Cl)C([H])Cl"
print(R.atomname)
elements = "|".join([((an.upper() + "|" + an.lower()) if len(an)==1 else an) for an in R.atomname if an != 'H'])
print(elements)
resmi=re.sub(r'(?<!\[)(' + elements + r')(?!H)', r'[\1]', smi)
print(resmi)
Satom=sorted(R.atomname,key = lambda i:len(i),reverse=True)
elements = "|".join([((an.upper() + "|" + an.lower()) if len(an)==1 else an) for an in Satom if an != 'H'])
print(elements)
resmi=re.sub(r'(?<!\[)(' + elements + r')(?!H)', r'[\1]', smi)
print(resmi)
The problem is shown in handling isomer contains chlorine.
it seems the Cl will be replaced as [C]l. I changed the priority in regular matching, make two character elements get match first and it works. Hope it helps.
The text was updated successfully, but these errors were encountered: