How to use SmallWorld API: Difference between revisions

From DISI
Jump to navigation Jump to search
No edit summary
Line 182: Line 182:
== /search/view  ==
== /search/view  ==
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source>
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source>
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source>
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source>
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&smi=Clc1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30&top=20" </source>
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&smi=Clc1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30&top=20" </source>
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Tagging which molecule the similarity is closest to. Display in TSV.  Display 30 results
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Tagging which molecule the similarity is closest to. Display in TSV.  Display 30 results
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1%20benzene&smi=Clc1ccccc1%20chlorobenzene&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30" </source>
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1%20benzene&smi=Clc1ccccc1%20chlorobenzene&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30" </source>





Revision as of 23:59, 22 January 2024

Introduction

The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual.

Here are some simple examples.

API Routes

/search/maps

List all available databases (map files).

 curl "https://sw.docking.org/search/maps"

/search/view

View the results of a search.

Access the results of a search either using the a hit-list id or by using the query parameters to start a new search automatically.

Parameter Type Description
id integer Hit List id
smi array Query SMILES/SMARTS strings
db string Database name
fmt string Format of results: tsv,csv
scores string Scoring function(s) to use
top integer Only collect this many (top) results, this option allows more resource efficient searches
async boolean Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)
dist string Maximum Anonymous Distance
sdist string Maximum Scored Distance
tdn string Terminal Down Bounds
tup string Terminal Up Bounds
rdn string Ring Down Bounds
rup string Ring Up Bounds
ldn string Linker Down Bounds
lup string Linker Up Bounds
maj string Major Transmutation Bounds (Aligned Atom Scores only)
min string Minor Transmutation Bounds (Aligned Atom Scores only)
sub string Substitution Bounds (Aligned Atom Scores only)
hyb string Hybridisation Bounds (Aligned Atom Scores only)
ms string Interpret a single SMILES query with multiple components as a multi-source (ms) search.

/search/submit

Start a new SmallWorld search with topological distance bounded by the provided upper bounds.

Parameter Type Description
smi array Query SMILES/SMARTS strings (Required)
db string Database name (Required)
top integer Only collect this many (top) results, this option allows more resource efficient searches
dist string Maxmium Anonymous Distance
sdist string Maxmium Scored Distance
tdn int Topological terminal down distance upper bound (default: 10)
tup int Topological terminal up distance upper bound (default: 10)
rdn int Topological ring down distance upper bound (default: 10)
rup int Topological ring up distance upper bound (default: 10)
ldn int Topological linker down distance upper bound (default: 10)
lup int Topological linker up distance upper bound (default: 10)
maj string Major Transmutation Bounds (Aligned Atom Scores only)
min string Minor Transmutation Bounds (Aligned Atom Scores only)
sub string Substitution Bounds (Aligned Atom Scores only)
hyb string Hybridisation Bounds (Aligned Atom Scores only)

Examples

/search/view

  1. Search of similar entries to benzene in ZINC-All-22Q2-1.6B
     curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B"
  2. Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50
     curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50"
  3. Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.
     curl "https://sw.docking.org/search/view?smi=c1ccccc1&smi=Clc1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30&top=20"
  4. Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Tagging which molecule the similarity is closest to. Display in TSV. Display 30 results
     curl "https://sw.docking.org/search/view?smi=c1ccccc1%20benzene&smi=Clc1ccccc1%20chlorobenzene&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30"