Chemistry Reference
In-Depth Information
else:
return 0
else:
raise ValueError("Error in input smarts")
return None
else:
raise ValueError("Error in input smiles")
return None
$EOPY$ Language plpythonu Immutable;
Create Or Replace Function openbabel.list_matches(smi Text, sma
Text, imatch Integer, istart Integer) Returns Integer[] As $EOPY$
import openbabel
obc = openbabel.OBConversion()
mol = openbabel.OBMol()
obc.SetInFormat("smi")
if obc.ReadString(mol, smi):
pat = openbabel.OBSmartsPattern()
if pat.Init(sma):
if pat.Match(mol):
i = 0
all_matches = list()
for p in pat.GetUMapList():
i += 1
pgarray = '{' + ','.join([str(a-1+istart) for a in p]) + '}'
if i == imatch: return pgarray
all_matches.append(pgarray)
return '{' + ','.join(all_matches) + '}'
else:
return None
else:
raise ValueError("Error in input smarts")
return None
else:
raise ValueError("Error in input smiles")
return None
$EOPY$ Language plpythonu Immutable;
Create Or Replace Function openbabel.list_matches(Text, Text)
Returns Integer[] As $EOSQL$
Select openbabel.list_matches($1, $2, 1, 0);
$EOSQL$ Language SQL Immutable;
Create Or Replace Function openbabel.list_matches(Text, Text,
Integer) Returns Integer[] As $EOSQL$
Select openbabel.list_matches($1, $2, $3, 0);
$EOSQL$ Language SQL Immutable;
Search WWH ::




Custom Search