Skip to content

Commit c5f739b

Browse files
committed
expand uses post and molfile not get and smiles
1 parent 9238dd8 commit c5f739b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/python/pipelines/xchem/fragnet_expand.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ def process(inputs, hac_min=None, hac_max=None, rac_min=None, rac_max=None, hops
3535
for mol in inputs:
3636
count += 1
3737
name = mol.GetProp('_Name')
38-
smiles = Chem.MolToSmiles(mol)
39-
utils.log('Processing', name, smiles)
40-
url = server + '/fragnet-search/rest/v2/search/expand/' + smiles
38+
molfile = Chem.MolToMolBlock(mol)
39+
utils.log('Processing', name)
40+
url = server + '/fragnet-search/rest/v2/search/expand/'
4141
params = {'hops': hops, 'hac_min': hac_min, 'hac_max': hac_max, 'rac_min': rac_min, 'rac_max': rac_max}
4242

43-
headers = {}
43+
headers = {'Content-Type': 'chemical/x-mdl-molfile'}
4444
if token:
4545
headers['Authorization'] = 'bearer ' + token
4646

47-
r = requests.get(url, params=params, headers=headers)
47+
r = requests.post(url, params=params, headers=headers, data=molfile)
4848
if r.status_code == requests.codes.ok:
4949
j = r.json()
5050
num_mols = j['size']

0 commit comments

Comments
 (0)