As part of the work for Ox Uni (Ruben Sanchez Garcia) we need to allow to fetch "synthons" for a molecule. That is fragments of a molecule, similar to Python code like this:
labels = set()
for record in tx.run('MATCH (fa:F2 {smiles: $smiles})-[e:FRAG*]->(f:F2) RETURN e',
smiles=smiles):
edges = record['e']
for edge in edges:
s = edge['label']
tokens = s.split('|')
add_required_synthons(labels, tokens[1])
add_required_synthons(labels, tokens[4])
return list(labels)
Possibly the neighbourhood search could be adapted for this, but as only child fragments and only available molecules are needed a new endpoint might be better.
Implemented as the rest/v2/search/fragments endpoint.
The results are a simple JSON list of child fragments. Not sure if anything more sophisticated is needed.
As part of the work for Ox Uni (Ruben Sanchez Garcia) we need to allow to fetch "synthons" for a molecule. That is fragments of a molecule, similar to Python code like this:
Possibly the neighbourhood search could be adapted for this, but as only child fragments and only available molecules are needed a new endpoint might be better.