December 2017: ALATIS naming system adopted by BMRB.
ALATIS API
It is easy to submit your structure file and get an ALATIS InChI string returned. Simply send a POST
request to 'http://alatis.nmrfam.wisc.edu/upload' with a JSON body with the following parameters:
'format_': The format of the uploaded structure file. Allowed values: 'sdf', 'mol', 'pdb', 'cdx'
'project_2_to_3': 'on' to project the 2D structure into a 3D one. Omit or set to any other value to not project.
'add_hydrogens': 'on' to add hydrogens. Omit or set to any other value to not project.
'response_type': 'json' - This tells the server to return the InChI in JSON format rather than returning a HTML web page.
'file': A file included in the body according to the standard HTTP POST file upload format.
Below is sample python code that you can use to query the API:
URL = 'http://alatis.nmrfam.wisc.edu/upload'
input_file_path = 'PATH_TO_YOUR_SDF_FILE'
format_ = 'sdf'
project_2_to_3 = 'off'
add_hydrogens = 'off'
files = {'infile': open(input_file_path, 'r')}
data = {'format': format_,
'response_type': 'json',
'project_2_to_3': project_2_to_3, # This can be omitted if the value is not 'on'
'add_hydrogens': add_hydrogens # This can be omitted if the value is not 'on'
}
r = requests.post(URL, data=data, files=files)
json_result = r.json()
print(json_result.keys(), json_result['inchi'])