ZINC15:Syntax: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The general form of a ZINC 15 api request is | |||
'''http[s]://host:port/reference-table/format:column1,column2,...columnN/query-specification''' | |||
We take up each element in turn. | |||
- We support both http and https protocols. | |||
- host name on request | |||
- port number on request | |||
= reference-table = | |||
There is one reference table per ZINC api request. Each row in the output corresponds to one row in the reference-table. Reference tables are always plurals, indicating that the result is always a selection from among the rows in the reference-table. The supported reference-tables are: | |||
{| class="wikitable" | |||
|- | |||
! table name !! Description !! Notes/Links | |||
|- | |||
| substances || substance table || notes about substance table | |||
|- | |||
| ecfp4s || lala || lala | |||
|- | |||
| catalogitems || lala || asdf | |||
|- | |||
| catalogs || asdfasdf || sdfsdfdaf | |||
|- | |||
| protomers || qwer34 || seradsf | |||
|- | |||
| genes || sdfasfd || sadfasdf | |||
|- | |||
| targets || asdfasdf || asdfasdf sa | |||
|- | |||
| activities || sadfasfsd || asdfasfd | |||
|- | |||
| organisms ||asdf asdf || asdfasfd sadf | |||
|} | |||
Historical note: In ZINC 12, the reference-table was always substances, and thus the result of any query was always a set of molecules. A few reports such as vendor and target listings were available via the webpages, but were not supported by the API. This is a substantial change that appeared first in ZINC 15. | |||
= Format = | |||
We support the following formats | |||
{| class="wikitable" | |||
|- | |||
! format !! Description !! options/links | |||
|- | |||
| json || substance table || notes about substance table | |||
|- | |||
| txt || lala || lala | |||
|- | |||
| csv || lala || asdf | |||
|- | |||
| xls || asdfasdf || sdfsdfdaf | |||
|- | |||
| tsv || qwer34 || seradsf | |||
|- | |||
| xml || sdfasfd || sadfasdf | |||
|} | |||
= Columns = | |||
The result contains the specified columns in the output. If the column is in the reference-table, it is specified without a table specfification, otherwise, the column specification must be of the form table.item. | |||
The following items are supported in each of the tables. | |||
{| class="wikitable" | |||
|- | |||
! table name !! Description !! Notes/Links | |||
|- | |||
| substances || substance table || notes about substance table | |||
|- | |||
| ecfp4s || lala || lala | |||
|- | |||
| catalogitems || lala || asdf | |||
|- | |||
| catalogs || asdfasdf || sdfsdfdaf | |||
|- | |||
| protomers || qwer34 || seradsf | |||
|- | |||
| genes || sdfasfd || sadfasdf | |||
|- | |||
| targets || asdfasdf || asdfasdf sa | |||
|- | |||
| activities || sadfasfsd || asdfasfd | |||
|- | |||
| organisms ||asdf asdf || asdfasfd sadf | |||
|} | |||
Objects from among these may be specified as part of a query_specification. | Objects from among these may be specified as part of a query_specification. | ||
{| class="wikitable" | |||
|- | |||
! table name !! Description !! Notes/Links | |||
|- | |||
| substances || sub_id, structure, inchikey, up_date, logp, tpsa, hbd, hba || notes about substance table | |||
|- | |||
| structure || mwt, logp, tpsa, hba, hbd, num_atoms, num_heavy_atoms, rotatable_bonds, num_hetero_atoms, num_rings, inchi || lala | |||
|- | |||
| protomers || prot_id, sub_id_fk, desolv_apol, desolv_pol, net_charge || asdf | |||
|- | |||
| catalogs || cat_id, name, short_name, purchasable, free, version, updated, bb, np, drug || sdfsdfdaf | |||
|- | |||
| catalogitems || sub_id_fk, cat_id_fk, supplier_code, depleted || seradsf | |||
|- | |||
| genes || short_name || sadfasdf | |||
|- | |||
| targets || swissprot, uniprot, target, gene, affinity || asdfasdf sa | |||
|- | |||
| activities || affinitynM, target, gene, organism || asdfasfd | |||
|- | |||
| organisms ||asdf asdf || asdfasfd sadf | |||
|} | |||
= Query operators = | = Query operators = | ||
{| class="wikitable" | |||
|- | |||
! operator !! Description !! synonyms | |||
|- | |||
| @> || lala || contains | |||
|- | |||
| <@ || lala || contained in | |||
|- | |||
| = || equals || eq | |||
|- | |||
| < || less than || lt | |||
|- | |||
| > || greater than || gt | |||
|- | |||
| <= || less than or equal || le | |||
|- | |||
| >= || greater than or equal || ge | |||
|- | |||
| between || sadfasfsd || asdfasfd | |||
|- | |||
| like, is, not , startswith, endswith, similar to ||asdf asdf || asdfasfd sadf | |||
|} | |||
= NP, Drug and BB = | = NP, Drug and BB = | ||
{| class="wikitable" | |||
|- | |||
! quality !! values !! Notes/Links | |||
|- | |||
| NP || 0=unknown, 1=biogenic, 2=metabolite, 3=endogenous human metabolite || lala | |||
|- | |||
| Drug || 0=unknown, 1=annotated catalog, 2=bioactive, 4=bioactive in vitro < 1uM, 5=bioactive in cells <1uM, 6=in man, 8=world drug, 10=fda approved || lala | |||
|- | |||
| BB || f=not bb, t=bb || asdf | |||
|} | |||
= Similarity and Substructure | = Similarity and Substructure |
Revision as of 20:00, 4 November 2014
The general form of a ZINC 15 api request is
http[s]://host:port/reference-table/format:column1,column2,...columnN/query-specification
We take up each element in turn.
- We support both http and https protocols. - host name on request - port number on request
reference-table
There is one reference table per ZINC api request. Each row in the output corresponds to one row in the reference-table. Reference tables are always plurals, indicating that the result is always a selection from among the rows in the reference-table. The supported reference-tables are:
table name | Description | Notes/Links |
---|---|---|
substances | substance table | notes about substance table |
ecfp4s | lala | lala |
catalogitems | lala | asdf |
catalogs | asdfasdf | sdfsdfdaf |
protomers | qwer34 | seradsf |
genes | sdfasfd | sadfasdf |
targets | asdfasdf | asdfasdf sa |
activities | sadfasfsd | asdfasfd |
organisms | asdf asdf | asdfasfd sadf |
Historical note: In ZINC 12, the reference-table was always substances, and thus the result of any query was always a set of molecules. A few reports such as vendor and target listings were available via the webpages, but were not supported by the API. This is a substantial change that appeared first in ZINC 15.
Format
We support the following formats
format | Description | options/links |
---|---|---|
json | substance table | notes about substance table |
txt | lala | lala |
csv | lala | asdf |
xls | asdfasdf | sdfsdfdaf |
tsv | qwer34 | seradsf |
xml | sdfasfd | sadfasdf |
Columns
The result contains the specified columns in the output. If the column is in the reference-table, it is specified without a table specfification, otherwise, the column specification must be of the form table.item.
The following items are supported in each of the tables.
table name | Description | Notes/Links |
---|---|---|
substances | substance table | notes about substance table |
ecfp4s | lala | lala |
catalogitems | lala | asdf |
catalogs | asdfasdf | sdfsdfdaf |
protomers | qwer34 | seradsf |
genes | sdfasfd | sadfasdf |
targets | asdfasdf | asdfasdf sa |
activities | sadfasfsd | asdfasfd |
organisms | asdf asdf | asdfasfd sadf |
Objects from among these may be specified as part of a query_specification.
table name | Description | Notes/Links |
---|---|---|
substances | sub_id, structure, inchikey, up_date, logp, tpsa, hbd, hba | notes about substance table |
structure | mwt, logp, tpsa, hba, hbd, num_atoms, num_heavy_atoms, rotatable_bonds, num_hetero_atoms, num_rings, inchi | lala |
protomers | prot_id, sub_id_fk, desolv_apol, desolv_pol, net_charge | asdf |
catalogs | cat_id, name, short_name, purchasable, free, version, updated, bb, np, drug | sdfsdfdaf |
catalogitems | sub_id_fk, cat_id_fk, supplier_code, depleted | seradsf |
genes | short_name | sadfasdf |
targets | swissprot, uniprot, target, gene, affinity | asdfasdf sa |
activities | affinitynM, target, gene, organism | asdfasfd |
organisms | asdf asdf | asdfasfd sadf |
Query operators
operator | Description | synonyms |
---|---|---|
@> | lala | contains |
<@ | lala | contained in |
= | equals | eq |
< | less than | lt |
> | greater than | gt |
<= | less than or equal | le |
>= | greater than or equal | ge |
between | sadfasfsd | asdfasfd |
like, is, not , startswith, endswith, similar to | asdf asdf | asdfasfd sadf |
NP, Drug and BB
quality | values | Notes/Links |
---|---|---|
NP | 0=unknown, 1=biogenic, 2=metabolite, 3=endogenous human metabolite | lala |
Drug | 0=unknown, 1=annotated catalog, 2=bioactive, 4=bioactive in vitro < 1uM, 5=bioactive in cells <1uM, 6=in man, 8=world drug, 10=fda approved | lala |
BB | f=not bb, t=bb | asdf |
= Similarity and Substructure
.../substance.structure similarto c1ccccc1CCCOC within .7 using tanimoto
/substance/txt:zinc_id/substance isa metabolite
/substances/txt:zinc_id?sort=substance.structure+near+c1ccccc1CCNC+using+dice
Closest purchasable metabolite
select s.sub_id, s.smiles, tanimoto_sml(f.data, bfp_from_binary_text('\x804300004000200080400000800000008220800040000120008002002011000010040081010000002840400009d040048000020200001a404100000002000040')), short_name from fingerprints.ecfp4_data as f join fingerprints.ecfp4_id on ecfp4_id=f.ecfp4_fk join substance as s on s.ecfp4_fk=ecfp4_id join catalog_item on sub_id_fk=s.sub_id join catalog on cat_id_fk=cat_id where f.ecfp4_fk < 1000000 and purchasable > 30 order by bfp_from_binary_text('\x804300004000200080400000800000008220800040000120008002002011000010040081010000002840400009d040048000020200001a404100000002000040') <%> f.data limit 5;