/restraintlib/api/v1/restraints/
Method:
POST
Header:
Content-Type: application/json
Query:
{
"data_type": "pdb", # data file extension: "pdb" or "cif"
"refinement_program": "shelx", # format of restraints: "refmac", "phenix", "shelx", "buster" or "csv"
"restraint_libs": "all", # "all" for all available libs or combination of
# "po4", "po4_terminal", "nucleicacidbases", "nucleicacidisobases", "ribose_deoxyribose", "ribose_deoxyribose_terminal"
# separated by comma, for example "po4,nucleicacidbases,ribose_deoxyribose"
"override_sigma": "true", # optional, default:"true"; Override sigma values with program specific values.
# "false" will keep the std's as calculated from the CSD .
"data": "< input file content >" # pdb or mmCIF file content or 4-letters PDB code
}
Response:
{
"version": "2019.9.1", # version of the application
"requestid": "749129f4-f165-48d7-b7f2-c98917c8721", # uuid4, request id
"status": "OK", # status of the response; "OK" if no errors or "ERROR"
"errors": [], # list of strings describing errors or empty list
"restraints": "< generated restraints >", # restraints in the "refmac" or "phenix" or "shelx" or "buster" or "csv" format
}
Python2 example:
import json
import socket
from urllib import urlencode
from urllib2 import Request, urlopen
timeout = 120
socket.setdefaulttimeout(timeout)
restraintlib_url = 'http://achesym.ibch.poznan.pl/restraintlib/api/v1/restraints/'
query_data = {
# input format ('cif' or 'pdb')
'data_type': 'cif',
# use all restraints
'restraint_libs': 'all',
# restraints format ('shelx', 'phenix', 'buster', 'refmac' or 'csv')
'refinement_program': 'phenix',
# Override sigma with program specific values ('true' or 'false')
'override_sigma': 'true',
# 4-letter pdb code or atom coordinates file content
'data': '3p4j'
}
# prepare request
request = Request(restraintlib_url)
request.add_header('Content-Type', 'application/json')
# make query
response = urlopen(request, json.dumps(query_data), timeout=timeout).read().decode()
# parse json
response = json.loads(response)
# print to console
print(response['restraints'])
# save to file
with open('restraints.txt', 'w') as restraints_file:
restraints_file.write(response['restraints'].encode('utf8'))
Example with curl:
curl -X POST "http://achesym.ibch.poznan.pl/restraintlib/api/v1/restraints/" -H "Content-Type: application/json" --data-binary '
{
"data_type": "pdb",
"refinement_program": "refmac",
"override_sigma": "true",
"restraint_libs": "all",
"data": "3p4j"
}'
Example with curl for custom file:
curl -X POST "http://achesym.ibch.poznan.pl/restraintlib/api/v1/restraints/" -H "Content-Type: application/json" --data-binary @- << EOF
{
"data_type": "pdb",
"refinement_program": "refmac",
"override_sigma": "true",
"restraint_libs": "all",
"data": "
CRYST1 17.880 31.420 43.900 90.00 90.00 90.00 P 21 21 21 8
ORIGX1 1.000000 0.000000 0.000000 0.00000
ORIGX2 0.000000 1.000000 0.000000 0.00000
ORIGX3 0.000000 0.000000 1.000000 0.00000
SCALE1 0.055928 0.000000 0.000000 0.00000
SCALE2 0.000000 0.031827 0.000000 0.00000
SCALE3 0.000000 0.000000 0.022779 0.00000
ATOM 1 O5' DC A 1 19.545 18.136 17.917 1.00 3.07 O
ATOM 2 C5' DC A 1 19.769 17.119 18.884 1.00 2.46 C
ATOM 3 C4' DC A 1 18.610 16.148 19.001 1.00 2.19 C
ATOM 4 O4' DC A 1 17.462 16.852 19.514 1.00 2.62 O
ATOM 5 C3' DC A 1 18.161 15.506 17.674 1.00 2.26 C
ATOM 6 O3' DC A 1 17.782 14.139 17.875 1.00 2.47 O
ATOM 7 C2' DC A 1 16.906 16.282 17.315 1.00 2.41 C
ATOM 8 C1' DC A 1 16.340 16.624 18.692 1.00 2.34 C
ATOM 9 N1 DC A 1 15.516 17.837 18.704 1.00 2.30 N
ATOM 10 C2 DC A 1 14.145 17.720 18.492 1.00 2.34 C
ATOM 11 O2 DC A 1 13.658 16.581 18.329 1.00 3.07 O
ATOM 12 N3 DC A 1 13.385 18.831 18.454 1.00 2.35 N
ATOM 13 C4 DC A 1 13.943 20.039 18.611 1.00 2.37 C
ATOM 14 N4 DC A 1 13.161 21.108 18.580 1.00 2.79 N
ATOM 15 C5 DC A 1 15.357 20.189 18.812 1.00 2.71 C
ATOM 16 C6 DC A 1 16.103 19.061 18.841 1.00 2.68 C
END
"
}
EOF
Example response:
{
"status": "OK",
"errors": [],
"version": "2019.9.1",
"requestid": "dc50e763-23c9-4bbb-9b9b-f1f505f3df8a"
"restraints": "
###########################################################################
# RestraintLib version 2019.9.1 #
###########################################################################
# #
# M.Kowiel, D.Brzezinski, M.Jaskolski (2016) #
# Conformation-dependent restraints for polynucleotides: #
# I. Clustering of the geometry of the phosphodiester group. #
# Nucleic Acids Res. doi: 10.1093/nar/gkw717. #
# #
# M.Gilski, J.Zhao, M.Kowiel, D.Brzezinski, D.H.Turner, M.Jaskolski #
# (2019) Accurate geometrical restraints for Watson-Crick base pairs. #
# Acta Cryst. B75 doi: 10.1107/S2052520619002002 #
# #
# M.Kowiel, D.Brzezinski, M.Jaskolski (2020) #
# Conformation-dependent restraints for polynucleotides: The sugar moiety.#
# Nucleic Acids Res. 48, 962–973. #
# https://doi.org/10.1093/nar/gkz1122 #
# #
###########################################################################
# #
# Restraints for: #
# PO4, PO4_terminal_C5, PO4_terminal_C3, ADENINE, GUANINE, URACIL, #
# THYMINE, CYTOSINE, ISOCYTOSINE, ISOGUANINE, #
# DEOXYRIBOSE_PURINE_CHI_CONFORMATION, DEOXYRIBOSE_PURINE_GAMMA, #
# DEOXYRIBOSE_PURINE_CONFORMATION, #
# DEOXYRIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PURINE_CHI, DEOXYRIBOSE_PURINE_CHI_GAMMA, #
# DEOXYRIBOSE_PURINE_ALL, DEOXYRIBOSE_PURINE_SUGAR, #
# DEOXYRIBOSE_PYRIMIDINE_CHI_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_GAMMA, DEOXYRIBOSE_PYRIMIDINE_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PYRIMIDINE_CHI, DEOXYRIBOSE_PYRIMIDINE_CHI_GAMMA, #
# DEOXYRIBOSE_PYRIMIDINE_ALL, DEOXYRIBOSE_PYRIMIDINE_SUGAR, #
# RIBOSE_PURINE_CHI_CONFORMATION, RIBOSE_PURINE_GAMMA, #
# RIBOSE_PURINE_CONFORMATION, RIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, RIBOSE_PURINE_CHI, #
# RIBOSE_PURINE_CHI_GAMMA, RIBOSE_PURINE_ALL, RIBOSE_PURINE_SUGAR, #
# RIBOSE_PYRIMIDINE_CHI_CONFORMATION, RIBOSE_PYRIMIDINE_GAMMA, #
# RIBOSE_PYRIMIDINE_CONFORMATION, #
# RIBOSE_PYRIMIDINE_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# RIBOSE_PYRIMIDINE_CHI, RIBOSE_PYRIMIDINE_CHI_GAMMA, #
# RIBOSE_PYRIMIDINE_ALL, RIBOSE_PYRIMIDINE_SUGAR, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_GAMMA, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_CONFORMATION, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_ALL, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_SUGAR, #
# DEOXYRIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_CHI_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_GAMMA, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_CHI_GAMMA, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_ALL, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR_CONFORMATION, #
# RIBOSE_PURINE_TERMINAL_C3_CHI_CONFORMATION, #
# RIBOSE_PURINE_TERMINAL_C3_GAMMA, #
# RIBOSE_PURINE_TERMINAL_C3_CONFORMATION, #
# RIBOSE_PURINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# RIBOSE_PURINE_TERMINAL_C3_CHI, RIBOSE_PURINE_TERMINAL_C3_CHI_GAMMA, #
# RIBOSE_PURINE_TERMINAL_C3_ALL, RIBOSE_PURINE_TERMINAL_C3_SUGAR, #
# RIBOSE_PURINE_TERMINAL_C3_SUGAR_CONFORMATION, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_CHI_CONFORMATION, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_GAMMA, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_CONFORMATION, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_CHI_GAMMA, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_ALL, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR, #
# RIBOSE_PYRIMIDINE_TERMINAL_C3_SUGAR_CONFORMATION, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_CHI_CONFORMATION, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_GAMMA, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_CONFORMATION, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_CHI, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_CHI_GAMMA, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_ALL, #
# DEOXYRIBOSE_PURINE_TERMINAL_C5_SUGAR, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_CHI_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_GAMMA, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_CONFORMATION, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_BASE_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_ALL_FUNC_OF_TORSION_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_CHI, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_CHI_GAMMA, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_ALL, #
# DEOXYRIBOSE_PYRIMIDINE_TERMINAL_C5_SUGAR, #
# RIBOSE_PURINE_TERMINAL_C5_CHI_CONFORMATION, #
# RIBOSE_PURINE_TERMINAL_C5_GAMMA, #
# RIBOSE_PURINE_TERMINAL_C5_CONFORMATION, #
# RIBOSE_PURINE_TERMINAL_C5_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_TERMINAL_C5_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PURINE_TERMINAL_C5_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# RIBOSE_PURINE_TERMINAL_C5_CHI, RIBOSE_PURINE_TERMINAL_C5_CHI_GAMMA, #
# RIBOSE_PURINE_TERMINAL_C5_ALL, RIBOSE_PURINE_TERMINAL_C5_SUGAR, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_CHI_CONFORMATION, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_GAMMA, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_CONFORMATION, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_BASE_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_ALL_FUNC_OF_TORSION_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_SUGAR_CONFORMATION_FUNC_OF_TAU_MAX, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_CHI, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_CHI_GAMMA, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_ALL, #
# RIBOSE_PYRIMIDINE_TERMINAL_C5_SUGAR, #
# #
###########################################################################
# Restraint Base==DC dist dN1C2 1.395 0.009
exte dist first chain A resi 1 atom N1 second chain A resi 1 atom C2 value 1.395 sigma 0.009 type 0
# Restraint Base==DC dist dC2N3 1.353 0.007
exte dist first chain A resi 1 atom C2 second chain A resi 1 atom N3 value 1.353 sigma 0.007 type 0
# Restraint Base==DC dist dN3C4 1.337 0.008
exte dist first chain A resi 1 atom N3 second chain A resi 1 atom C4 value 1.337 sigma 0.008 type 0
# Restraint Base==DC dist dC4C5 1.424 0.010
exte dist first chain A resi 1 atom C4 second chain A resi 1 atom C5 value 1.424 sigma 0.010 type 0
# Restraint Base==DC dist dC5C6 1.338 0.008
exte dist first chain A resi 1 atom C5 second chain A resi 1 atom C6 value 1.338 sigma 0.008 type 0
# Restraint Base==DC dist dC6N1 1.365 0.007
exte dist first chain A resi 1 atom C6 second chain A resi 1 atom N1 value 1.365 sigma 0.007 type 0
# Restraint Base==DC dist dC2O2 1.240 0.008
exte dist first chain A resi 1 atom C2 second chain A resi 1 atom O2 value 1.240 sigma 0.008 type 0
# Restraint Base==DC dist dC4N4 1.330 0.008
exte dist first chain A resi 1 atom C4 second chain A resi 1 atom N4 value 1.330 sigma 0.008 type 0
# Restraint Base==DC angle aC6N1C2 120.3 0.5
exte angle first chain A resi 1 atom C6 next chain A resi 1 atom N1 next chain A resi 1 atom C2 value 120.3 sigma 0.5 type 0
# Restraint Base==DC angle aN1C2N3 119.1 0.6
exte angle first chain A resi 1 atom N1 next chain A resi 1 atom C2 next chain A resi 1 atom N3 value 119.1 sigma 0.6 type 0
# Restraint Base==DC angle aC2N3C4 120.1 0.5
exte angle first chain A resi 1 atom C2 next chain A resi 1 atom N3 next chain A resi 1 atom C4 value 120.1 sigma 0.5 type 0
# Restraint Base==DC angle aN3C4C5 121.6 0.6
exte angle first chain A resi 1 atom N3 next chain A resi 1 atom C4 next chain A resi 1 atom C5 value 121.6 sigma 0.6 type 0
# Restraint Base==DC angle aC4C5C6 117.5 0.5
exte angle first chain A resi 1 atom C4 next chain A resi 1 atom C5 next chain A resi 1 atom C6 value 117.5 sigma 0.5 type 0
# Restraint Base==DC angle aC5C6N1 121.2 0.6
exte angle first chain A resi 1 atom C5 next chain A resi 1 atom C6 next chain A resi 1 atom N1 value 121.2 sigma 0.6 type 0
# Restraint Base==DC angle aO2C2N1 118.8 0.8
exte angle first chain A resi 1 atom O2 next chain A resi 1 atom C2 next chain A resi 1 atom N1 value 118.8 sigma 0.8 type 0
# Restraint Base==DC angle aO2C2N3 122.0 0.6
exte angle first chain A resi 1 atom O2 next chain A resi 1 atom C2 next chain A resi 1 atom N3 value 122.0 sigma 0.6 type 0
# Restraint Base==DC angle aN4C4C5 120.3 0.7
exte angle first chain A resi 1 atom N4 next chain A resi 1 atom C4 next chain A resi 1 atom C5 value 120.3 sigma 0.7 type 0
# Restraint Base==DC angle aN4C4N3 118.1 0.6
exte angle first chain A resi 1 atom N4 next chain A resi 1 atom C4 next chain A resi 1 atom N3 value 118.1 sigma 0.6 type 0
"
}