http://wiki.docking.org/api.php?action=feedcontributions&user=Jgutierrez6&feedformat=atomDISI - User contributions [en]2024-03-28T11:23:23ZUser contributionsMediaWiki 1.39.1http://wiki.docking.org/index.php?title=Globus_Curator%27s_Guide&diff=15667Globus Curator's Guide2024-03-20T21:06:49Z<p>Jgutierrez6: </p>
<hr />
<div>== Introduction ==<br />
Here will be the instructions on how to maintain globus.<br />
<br />
=== Notes ===<br />
*For any restrict path's to work in the Guest Collections, the main collection needs to have either the same or broader path to be allowed.<br />
*The main collection is currently private. Only the admins can have access to it.<br />
<br />
== Updating Path Permissions for the Guest Collection ==<br />
#Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
#:<source>readlink -f <symlink> </source><br />
# Become root in epyc<br />
##Go to /root/globus<br />
#:<source>cd /root/globus</source><br />
#Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
#:<source>vim storage_gateway_path_restriction.json</source><br />
##Here is an example of what it should look like<br />
##:<source><br />
{<br />
"DATA_TYPE": "path_restrictions#1.0.0",<br />
"none": ["/"],<br />
"read": [<br />
"/nfs/ex3/published",<br />
"/nfs/exe/work/jji/2dexport",<br />
"/nfs/exe/work/jji/3d-zinc20",<br />
"/nfs/exl/zinc-22a",<br />
"/nfs/exl/zinc-22b",<br />
"/nfs/exl/zinc-22c",<br />
"/nfs/exc/zinc-22n"<br />
],<br />
"read_write":[<br />
"/nfs/mammoth/idg-images/newAmisData"<br />
]<br />
}<br />
</source><br />
#Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
#:<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
#Follow instructions given by globus and it should tell you that it was successful<br />
#In the same directory, run this command to update<br />
#:<source>bash globus-storage-gateway.sh update</source><br />
#This is the successful message<br />
#:<source>Message: Updated Storage Gateway aa731fb1-b27a-49e6-aaeb-2d2cc252f779</source><br />
<br />
== Updating Path Permissions for the Main Collection ==<br />
#Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
#:<source>readlink -f <symlink> </source><br />
# Become root in epyc<br />
##Go to /root/globus<br />
#:<source>cd /root/globus</source><br />
#Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
#:<source>vim path_restrictions.json</source><br />
##Here is an example of what it should look like<br />
##:<source><br />
{<br />
"DATA_TYPE": "path_restrictions#1.0.0",<br />
"read": [<br />
"/"<br />
],<br />
"read_write": [<br />
"/nfs/mammoth/idg-images/newAmisData/"<br />
]<br />
}<br />
</source><br />
#Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
#:<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
#Follow instructions given by globus and it should tell you that it was successful<br />
#In the same directory, run this command to update<br />
#:<source>globus-connect-server collection update --sharing-restrict-paths file:path_restrictions.json 2e1e1781-6d8a-440a-8604-7100d9c65c90</source><br />
#This is the successful message<br />
#:<source>code: success</source><br />
#Lastly, in the globus web GUI, you need to allow a specific user or group to access the new path in the permissions tab located in the collection overview.</div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15666Arthor Documentation for Future Developer2024-03-19T22:22:58Z<p>Jgutierrez6: /* Restarting Arthor Instance(s) Instructions */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#: <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#: <source><br />
<br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
=== Public and Private Arthor ===<br />
# ssh to "arthor" server and run<br />
#: <source><br />
systemctl <start|stop|restart> <arthor|arthorp><br />
</source><br />
<br />
=== ArthorBB, ArthorCC, and ArthorCovalent ===<br />
# ssh to "epyc-a40" server and run<br />
#: <source><br />
systemctl <start|stop|restart> <arthorbb|arthorcc|arthorcovalent><br />
</source><br />
<br />
=== Super Private Arthor ===<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15665Arthor Documentation for Future Developer2024-03-19T00:36:50Z<p>Jgutierrez6: /* Restarting Arthor Instance(s) Instructions */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#: <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#: <source><br />
<br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
=== Public and Private Arthor ===<br />
# ssh to "arthor" server and run<br />
#: <source><br />
systemctl <start|stop|restart> <arthor|arthorp><br />
</source><br />
<br />
=== Super Private Arthor ===<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15664Arthor Documentation for Future Developer2024-03-19T00:31:15Z<p>Jgutierrez6: /* Adding Arthor to Systemd (example) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#: <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#: <source><br />
<br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15663Arthor Documentation for Future Developer2024-03-19T00:30:51Z<p>Jgutierrez6: /* Adding Arthor to Systemd (example) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#* <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#* <source><br />
<br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15662Arthor Documentation for Future Developer2024-03-19T00:30:32Z<p>Jgutierrez6: /* Adding Arthor to Systemd (example) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#* <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#* <source><br />
vim /etc/systemd/system/arthor.service<br />
<br />
###############################<br />
Then copy and paste this inside<br />
###############################<br />
<br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15661Arthor Documentation for Future Developer2024-03-19T00:29:31Z<p>Jgutierrez6: </p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Adding Arthor to Systemd (example) ==<br />
# Create service files<br />
#* <source><br />
touch /etc/systemd/system/arthor.service<br />
</source><br />
# Add this code block in the service file<br />
#* <source><br />
[Unit]<br />
Description=Arthor Public Instance<br />
After=network.target<br />
<br />
[Service]<br />
Type=exec<br />
Restart=always<br />
RestartSec=3<br />
User=root<br />
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public<br />
ExecStop=/bin/kill -15 $MAINPID<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</source><br />
# Change "ExecStart" to other Arthor Instances<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15660Arthor Documentation for Future Developer2024-03-19T00:26:17Z<p>Jgutierrez6: /* Active Arthor Instances */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local3/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local3/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Globus_Curator%27s_Guide&diff=15636Globus Curator's Guide2024-02-17T01:35:37Z<p>Jgutierrez6: </p>
<hr />
<div>== Introduction ==<br />
Here will be the instructions on how to maintain globus.<br />
<br />
=== Notes ===<br />
*For any restrict path's to work in the Guest Collections, the main collection needs to have either the same or broader path to be allowed.<br />
*The main collection is currently private. Only the admins can have access to it.<br />
<br />
== Updating Path Permissions for the Guest Collection ==<br />
#Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
#:<source>readlink -f <symlink> </source><br />
# Become root in epyc<br />
##Go to /root/globus<br />
#:<source>cd /root/globus</source><br />
#Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
#:<source>vim storage_gateway_path_restriction.json</source><br />
##Here is an example of what it should look like<br />
##:<source><br />
{<br />
"DATA_TYPE": "path_restrictions#1.0.0",<br />
"none": ["/"],<br />
"read": [<br />
"/nfs/ex3/published",<br />
"/nfs/exe/work/jji/2dexport",<br />
"/nfs/exe/work/jji/3d-zinc20",<br />
"/nfs/exl/zinc-22a",<br />
"/nfs/exl/zinc-22b",<br />
"/nfs/exl/zinc-22c",<br />
"/nfs/exc/zinc-22n"<br />
],<br />
"read_write":[<br />
"/nfs/mammoth/idg-images/newAmisData"<br />
]<br />
}<br />
</source><br />
#Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
#:<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
#Follow instructions given by globus and it should tell you that it was successful<br />
#In the same directory, run this command to update<br />
#:<source>bash globus-storage-gateway.sh update</source><br />
#This is the successful message<br />
#:<source>Message: Updated Storage Gateway aa731fb1-b27a-49e6-aaeb-2d2cc252f779</source><br />
<br />
== Updating Path Permissions for the Main Collection ==<br />
#Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
#:<source>readlink -f <symlink> </source><br />
# Become root in epyc<br />
##Go to /root/globus<br />
#:<source>cd /root/globus</source><br />
#Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
#:<source>vim path_restrictions.json</source><br />
##Here is an example of what it should look like<br />
##:<source><br />
{<br />
"DATA_TYPE": "path_restrictions#1.0.0",<br />
"read": [<br />
"/"<br />
],<br />
"read_write": [<br />
"/nfs/mammoth/idg-images/newAmisData/"<br />
]<br />
}<br />
</source><br />
#Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
#:<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
#Follow instructions given by globus and it should tell you that it was successful<br />
#In the same directory, run this command to update<br />
#:<source>globus-connect-server collection update --sharing-restrict-paths file:path_restrictions.json 2e1e1781-6d8a-440a-8604-7100d9c65c90</source><br />
#This is the successful message<br />
#:<source>code: success</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Globus_Curator%27s_Guide&diff=15635Globus Curator's Guide2024-02-17T01:25:37Z<p>Jgutierrez6: </p>
<hr />
<div>== Introduction ==<br />
Here will be the instructions on how to maintain globus.<br />
<br />
=== Notes ===<br />
*For any restrict path's to work in the Guest Collections, the main collection needs to have either the same or broader path to be allowed.<br />
*The main collection is currently private. Only the admins can have access to it.<br />
<br />
== Updating Path Permissions ==<br />
1. Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
<source>readlink -f <symlink> </source><br />
2. Become root in epyc<br />
<br />
3. Go to /root/globus<br />
<source>cd /root/globus</source><br />
4. Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
<source>vim storage_gateway_path_restriction.json</source><br />
5. Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
6. Follow instructions given by globus and it should tell you that it was successful<br />
<br />
7. In the same directory, run this command to update<br />
<source>bash globus-storage-gateway.sh update</source><br />
8. This is the successful message<br />
<source>Message: Updated Storage Gateway aa731fb1-b27a-49e6-aaeb-2d2cc252f779</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15603How to use SmallWorld API2024-01-23T02:14:01Z<p>Jgutierrez6: /* Advanced Usage */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| start<br />
| integer<br />
| Number of hits returned starting from this index<br />
|- <br />
| length<br />
| integer<br />
| Number of total hits returned<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
# Search of similar entries of 12 different molecules in ZINC-All-22Q2-1.6B.<br />
#: <source> curl 'https://sw.docking.org/search/view?smi=c1ccccc1%20ONE&smi=Clc1ccccc1%20TWO&smi=C1=CC=C2C(=C1)C(=C(N2)O)C3=NC4=CC=CC=C4C3=O%20Three&smi=Oc3c(N=Nc1ccc(Br)cc1S(O)(=O)=O)c(S(O)(=O)=O)cc4cc(S(O)(=O)=O)c(N=Nc2ccc(Br)cc2S(O)(=O)=O)c(O)c34%20FOUR&smi=Nc5c(N=Nc4ccc(c3ccc(N=Nc2cc(S(O)(=O)=O)c1ccccc1c2N)cc3)cc4)cc(S(O)(=O)=O)c6ccccc56%20FIVE&smi=OC(=O)c1ccccc1C(c2cc(I)c(O)c(I)c2)=c3cc(I)c(=O)c(I)c3%20SIX&smi=Oc2cc(S(O)(=O)=O)c1ccccc1c2N=Nc4ccc3ccccc3c4O%20SEVEN&smi=Oc2ccc1ccccc1c2N=Nc3c(O)cc(S(O)(=O)=O)c4ccccc34%20Eight&smi=Cn1cnc2c1c(=O)n(c(=O)n2C)C%20NINE&smi=CCCCCCC(Oc3ccc(S(=O)(=O)c2ccc(OCc1ccccc1)cc2)cc3)C(O)=O%20TEN&smi=OC(=O)COc3ccc(N=Nc2ccc1cc(Br)ccc1c2O)cc3%20Eleven&smi=C1=CC(=C(C=C1C2=C(C(=O)C3=C(C=C(C=C3O2)O)O)O)O)O%20Twelve&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30' </source><br />
<br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 3 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=2&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15602How to use SmallWorld API2024-01-23T02:12:14Z<p>Jgutierrez6: /* Multi-Start Search */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| start<br />
| integer<br />
| Number of hits returned starting from this index<br />
|- <br />
| length<br />
| integer<br />
| Number of total hits returned<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
# Search of similar entries of 11 different molecules in ZINC-All-22Q2-1.6B.<br />
#: <source> curl 'https://sw.docking.org/search/view?smi=c1ccccc1%20ONE&smi=Clc1ccccc1%20TWO&smi=C1=CC=C2C(=C1)C(=C(N2)O)C3=NC4=CC=CC=C4C3=O%20Three&smi=Oc3c(N=Nc1ccc(Br)cc1S(O)(=O)=O)c(S(O)(=O)=O)cc4cc(S(O)(=O)=O)c(N=Nc2ccc(Br)cc2S(O)(=O)=O)c(O)c34%20FOUR&smi=Nc5c(N=Nc4ccc(c3ccc(N=Nc2cc(S(O)(=O)=O)c1ccccc1c2N)cc3)cc4)cc(S(O)(=O)=O)c6ccccc56%20FIVE&smi=OC(=O)c1ccccc1C(c2cc(I)c(O)c(I)c2)=c3cc(I)c(=O)c(I)c3%20SIX&smi=Oc2cc(S(O)(=O)=O)c1ccccc1c2N=Nc4ccc3ccccc3c4O%20SEVEN&smi=Oc2ccc1ccccc1c2N=Nc3c(O)cc(S(O)(=O)=O)c4ccccc34%20Eight&smi=Cn1cnc2c1c(=O)n(c(=O)n2C)C%20NINE&smi=CCCCCCC(Oc3ccc(S(=O)(=O)c2ccc(OCc1ccccc1)cc2)cc3)C(O)=O%20TEN&smi=OC(=O)COc3ccc(N=Nc2ccc1cc(Br)ccc1c2O)cc3%20Eleven&db=ZINC-All-22Q2-1.6B&fmt=tsv&length=30' </source><br />
<br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 3 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=2&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15601How to use SmallWorld API2024-01-23T00:59:39Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| start<br />
| integer<br />
| Number of hits returned starting from this index<br />
|- <br />
| length<br />
| integer<br />
| Number of total hits returned<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 3 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=2&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15600How to use SmallWorld API2024-01-23T00:56:08Z<p>Jgutierrez6: /* /search/view */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| start<br />
| integer<br />
| Number of hits returned starting from this index<br />
|- <br />
| length<br />
| integer<br />
| Number of total hits returned<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 3 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=2&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15599How to use SmallWorld API2024-01-23T00:44:40Z<p>Jgutierrez6: /* Asynchronous Searching */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 3 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=2&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15598How to use SmallWorld API2024-01-23T00:43:05Z<p>Jgutierrez6: /* Examples */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
=== Basic Usage ===<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
=== Advanced Usage ===<br />
==== Multi-Start Search ====<br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
==== Asynchronous Searching ====<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B. Show 5 results that are within distance 1~2. Use an asynchronous query.<br />
#:<source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&start=0&length=5&dist=1-2&async=true" | jq </source><br />
#* When running asynchronous searches it is useful to use the JSON output as this reports what the search is doing in the background<br />
#* After calling once the server will return right away and you will see something like:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 0,<br />
"recordsFiltered": 0,<br />
"status": {<br />
"dist": 0,<br />
"state": "RUNNING",<br />
"restarts": 0,<br />
"nodeHits": 0,<br />
"nodeVisit": 0,<br />
"edgeVisit": 0,<br />
"elapTime": 0,<br />
"runTime": 0,<br />
"wavefront": 0<br />
},<br />
"data": []<br />
}<br />
</source><br />
#* The search will tell you when it has finished and be marked as DONE:<br />
#*: <source><br />
{<br />
"draw": 0,<br />
"recordsTotal": 19195,<br />
"recordsFiltered": 19046,<br />
"status": {<br />
"dist": 2,<br />
"state": "DONE",<br />
"restarts": 6,<br />
"nodeHits": 35,<br />
"nodeVisit": 41,<br />
"edgeVisit": 46,<br />
"elapTime": 47685,<br />
"runTime": 2529,<br />
"wavefront": 0<br />
},<br />
"data": [<br />
[<br />
{<br />
"id": "ZINC000078108232",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]\\[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C/C=C ZINC000078108232",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000001592588",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "[CH2:1]=[CH:2]/[CH:3]=[CH:4]/[CH:5]=[CH2:6]",<br />
"anonIdx": "B5R0.2",<br />
"mf": "C<sub>6</sub>H<sub>8</sub>",<br />
"mw": "80.128",<br />
"atomMap": [<br />
0,<br />
1,<br />
2,<br />
3,<br />
4,<br />
5<br />
],<br />
"atomScore": [<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
2<br />
],<br />
"hitSmiles": "C=C\\C=C\\C=C ZINC000001592588",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.0,<br />
0.07692307692307693,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000307159050",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "B[C:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"anonIdx": "B7R1.3",<br />
"mf": "C<sub>6</sub>H<sub>7</sub>B",<br />
"mw": "89.931",<br />
"atomMap": [<br />
1,<br />
2,<br />
3,<br />
4,<br />
5,<br />
6<br />
],<br />
"atomScore": [<br />
6,<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
1<br />
],<br />
"hitSmiles": "Bc1ccccc1 ZINC000307159050",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.25,<br />
0.5,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000000900729",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "Br[C:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"anonIdx": "B7R1.3",<br />
"mf": "C<sub>6</sub>H<sub>5</sub>Br",<br />
"mw": "157.008",<br />
"atomMap": [<br />
1,<br />
2,<br />
3,<br />
4,<br />
5,<br />
6<br />
],<br />
"atomScore": [<br />
6,<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
1<br />
],<br />
"hitSmiles": "Brc1ccccc1 ZINC000000900729",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.25,<br />
0.46153846153846156,<br />
1,<br />
1<br />
],<br />
[<br />
{<br />
"id": "ZINC000000967534",<br />
"qryMappedSmiles": "[CH:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"hitMappedSmiles": "C[C:1]1=[CH:2][CH:3]=[CH:4][CH:5]=[CH:6]1",<br />
"anonIdx": "B7R1.3",<br />
"mf": "C<sub>7</sub>H<sub>8</sub>",<br />
"mw": "92.139",<br />
"atomMap": [<br />
1,<br />
2,<br />
3,<br />
4,<br />
5,<br />
6<br />
],<br />
"atomScore": [<br />
6,<br />
2,<br />
1,<br />
1,<br />
1,<br />
1,<br />
1<br />
],<br />
"hitSmiles": "Cc1ccccc1 ZINC000000967534",<br />
"qrySmiles": "c1ccccc1"<br />
},<br />
0.25,<br />
0.5,<br />
1,<br />
1<br />
]<br />
]<br />
}<br />
</source><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15597How to use SmallWorld API2024-01-22T23:59:17Z<p>Jgutierrez6: /* Examples */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#: <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#: <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><br />
# 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<br />
#: <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><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15596How to use SmallWorld API2024-01-22T23:57:02Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#* <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><br />
# 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<br />
#* <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><br />
<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15595How to use SmallWorld API2024-01-22T23:54:27Z<p>Jgutierrez6: /* Examples */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#* <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><br />
# 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<br />
#* <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><br />
<br />
=Example Request=<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15594How to use SmallWorld API2024-01-20T01:24:49Z<p>Jgutierrez6: /* /search/view */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#* <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><br />
# 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<br />
#* <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><br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15593How to use SmallWorld API2024-01-20T01:23:56Z<p>Jgutierrez6: /* Examples */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Only show top 20 results.<br />
#* <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><br />
# Search of similar entries to either benzene or the chlorobenzene in ZINC-All-22Q2-1.6B. Display in TSV. Tagging which molecule the similarity is closest to. Display 30 results<br />
#* <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><br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15592How to use SmallWorld API2024-01-20T01:07:52Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
= Examples =<br />
<source> </source><br />
== /search/view ==<br />
# Search of similar entries to benzene in ZINC-All-22Q2-1.6B<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B" </source><br />
# Search of similar entries to pyridine in ZINC-All-22Q2-1.6B. Display in TSV. Show results from 0 to 50<br />
#* <source> curl "https://sw.docking.org/search/view?smi=c1ccccc1&db=ZINC-All-22Q2-1.6B&fmt=tsv&start=0&length=50" </source><br />
<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15591How to use SmallWorld API2024-01-20T00:49:51Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
<source> curl "https://sw.docking.org/search/maps" </source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
== Examples ==<br />
=== ===<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15590How to use SmallWorld API2024-01-20T00:31:38Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
'''List all available databases (map files).'''<br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings (Required)<br />
|-<br />
| db<br />
| string<br />
| Database name (Required)<br />
|-<br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| dist<br />
| string<br />
| Maxmium Anonymous Distance<br />
|-<br />
| sdist<br />
| string<br />
| Maxmium Scored Distance<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
|}<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15589How to use SmallWorld API2024-01-19T23:57:37Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
List all available databases (map files).<br />
<br />
<source>curl "https://sw.docking.org/search/maps"</source><br />
<br />
==/search/view==<br />
'''View the results of a search.'''<br />
<br />
Access the results of a search either using the a hit-list id or by using the query parameters to start<br />
a new search automatically.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| id<br />
| integer<br />
| Hit List id<br />
|-<br />
| smi<br />
| array<br />
| Query SMILES/SMARTS strings<br />
|-<br />
| db<br />
| string<br />
| Database name<br />
|-<br />
| fmt<br />
| string<br />
| Format of results: tsv,csv<br />
|- <br />
| scores<br />
| string<br />
| Scoring function(s) to use<br />
|- <br />
| top<br />
| integer<br />
| Only collect this many (top) results, this option allows more resource efficient searches<br />
|-<br />
| async<br />
| boolean<br />
| Start new searches asynchronously or not (returns right away) or wait until timeout for search to run (default)<br />
|- <br />
| dist<br />
| string<br />
| Maximum Anonymous Distance<br />
|- <br />
| sdist<br />
| string<br />
| Maximum Scored Distance<br />
|- <br />
| tdn<br />
| string<br />
| Terminal Down Bounds<br />
|-<br />
| tup<br />
| string<br />
| Terminal Up Bounds<br />
|-<br />
| rdn<br />
| string<br />
| Ring Down Bounds<br />
|- <br />
| rup<br />
| string<br />
| Ring Up Bounds<br />
|-<br />
| ldn<br />
| string<br />
| Linker Down Bounds<br />
|-<br />
| lup<br />
| string<br />
| Linker Up Bounds<br />
|-<br />
| maj<br />
| string<br />
| Major Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| min<br />
| string<br />
| Minor Transmutation Bounds (Aligned Atom Scores only)<br />
|-<br />
| sub<br />
| string<br />
| Substitution Bounds (Aligned Atom Scores only)<br />
|-<br />
| hyb<br />
| string<br />
| Hybridisation Bounds (Aligned Atom Scores only)<br />
|-<br />
| ms<br />
| string<br />
| Interpret a single SMILES query with multiple components as a multi-source (ms) search.<br />
|-<br />
|}<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| text<br />
| Query SMILES<br />
|-<br />
| db<br />
| text<br />
| Reference database (see List of available maps)<br />
|-<br />
| dist<br />
| int<br />
| Topological distance upper bound (default: 10)<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| scores<br />
| text<br />
| List of scoring functions (default : none) - see /search/config<br />
|}<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15588SmallWorld Documentation for Future Developer2024-01-19T23:44:44Z<p>Jgutierrez6: </p>
<hr />
<div>= Introduction =<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
= How to Download Smallworld =<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
= How to Launch Smallworld For The First Time =<br />
== Prepare Files and Directories ==<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
== Start Smallworld Instance ==<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
= How to Build Smallworld Maps/Databases =<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
== Command Details ==<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
== Splitting Databases ==<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
= Active Smallworld Instances =<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
= Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) =<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* Pre-toggle Advanced Option<br />
<br />
Summary of changes in smallworld-swagger.yaml:<br />
* Change API route to be just "/"<br />
<br />
== Install Prerequisite Packages ==<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
== Customizing swsearch.js ==<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
=== Conditional Hyperlinks ===<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
== Customizing search.html ==<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
=== Add 'Ask Questions' and 'Database Information' ===<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
=== Pre-toggle Advanced Option ===<br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
# Then search for "update_visible_columns" and scroll till you find the input checkbox element<br />
#:<source>?update_visible_columns</source><br />
# In the input box element, add the checked option. Should look like this<br />
#:<source><br />
<input name="optAdv" type="checkbox"<br />
onchange="$('#advPanel').css('display', $(this).prop('checked') ? 'block' : 'none'); update_visible_columns();" checked><br />
</source><br />
<br />
=== Change API Route to "/" ===<br />
# path smallworld-java-src/web/target/sw-ws-5.6.1/WEB-INF/static/swagger/smallworld-swagger.yaml<br />
<br />
== Compile Code To Make WAR File ==<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
= Restarting Smallworld Instance(s) =<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15587SmallWorld Documentation for Future Developer2024-01-19T23:41:23Z<p>Jgutierrez6: /* Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* Pre-toggle Advanced Option<br />
<br />
Summary of changes in smallworld-swagger.yaml:<br />
* Change API route to be just "/"<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
==== Pre-toggle Advanced Option ====<br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
# Then search for "update_visible_columns" and scroll till you find the input checkbox element<br />
#:<source>?update_visible_columns</source><br />
# In the input box element, add the checked option. Should look like this<br />
#:<source><br />
<input name="optAdv" type="checkbox"<br />
onchange="$('#advPanel').css('display', $(this).prop('checked') ? 'block' : 'none'); update_visible_columns();" checked><br />
</source><br />
<br />
==== Change API Route to "/" ====<br />
# path smallworld-java-src/web/target/sw-ws-5.6.1/WEB-INF/static/swagger/smallworld-swagger.yaml<br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15586How to use SmallWorld API2024-01-19T23:30:00Z<p>Jgutierrez6: /* /search/maps */</p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
List all available databases (map files).<br />
<br />
<source>curl "https://sw.docking.org/search/maps"</source><br />
<br />
==/search/view==<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| text<br />
| Query SMILES<br />
|-<br />
| db<br />
| text<br />
| Reference database (see List of available maps)<br />
|-<br />
| dist<br />
| int<br />
| Topological distance upper bound (default: 10)<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| scores<br />
| text<br />
| List of scoring functions (default : none) - see /search/config<br />
|}<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15585How to use SmallWorld API2024-01-19T23:29:46Z<p>Jgutierrez6: </p>
<hr />
<div>=Introduction=<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
=API Routes=<br />
<br />
==/search/maps==<br />
List all available databases (map files).<br />
<br />
<source>curl -X GET "https://sw.docking.org/search/maps"</source><br />
<br />
==/search/view==<br />
<br />
==/search/submit==<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| text<br />
| Query SMILES<br />
|-<br />
| db<br />
| text<br />
| Reference database (see List of available maps)<br />
|-<br />
| dist<br />
| int<br />
| Topological distance upper bound (default: 10)<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| scores<br />
| text<br />
| List of scoring functions (default : none) - see /search/config<br />
|}<br />
<br />
==Example Request==<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=How_to_use_SmallWorld_API&diff=15582How to use SmallWorld API2024-01-17T22:46:21Z<p>Jgutierrez6: </p>
<hr />
<div>==Introduction==<br />
<br />
The Web Services API for SmallWorld Documentation is found in Section 6.3 of the SmallWorld version 5.6.2 manual. <br />
<br />
Here are some simple examples.<br />
<br />
==API Routes==<br />
<br />
===/search/maps===<br />
List all available databases (map files).<br />
<br />
<source>curl -X GET "https://sw.docking.org/search/maps"</source><br />
<br />
===/search/view===<br />
<br />
===/search/submit===<br />
<br />
Start a new SmallWorld search with topological distance bounded by the provided upper bounds.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter<br />
! Type<br />
! Description<br />
|-<br />
| smi<br />
| text<br />
| Query SMILES<br />
|-<br />
| db<br />
| text<br />
| Reference database (see List of available maps)<br />
|-<br />
| dist<br />
| int<br />
| Topological distance upper bound (default: 10)<br />
|-<br />
| tdn<br />
| int<br />
| Topological terminal down distance upper bound (default: 10)<br />
|- <br />
| tup<br />
| int<br />
| Topological terminal up distance upper bound (default: 10)<br />
|-<br />
| rdn<br />
| int<br />
| Topological ring down distance upper bound (default: 10)<br />
|- <br />
| rup<br />
| int<br />
| Topological ring up distance upper bound (default: 10)<br />
|-<br />
| ldn<br />
| int<br />
| Topological linker down distance upper bound (default: 10)<br />
|-<br />
| lup<br />
| int<br />
| Topological linker up distance upper bound (default: 10)<br />
|-<br />
| scores<br />
| text<br />
| List of scoring functions (default : none) - see /search/config<br />
|}<br />
<br />
===Example Request===<br />
Suppose you want to search for c1ccccc1 in the ZINC-Interesting-297K Database: There are two steps. The first step which involves /search/submit returns a stream of events that report the hit list id or hlid. This hlid is required to fetch results using the other options such as /search/view <br />
<br />
*Change the smi to the SMILES for the molecule you want to query<br />
*Change the db name to the database name from the List of Publicly Available Maps below<br />
Everything else can stay the same<br />
<br />
curl 'https://sw.docking.org/search/submit?smi=c1ccccc1&db=ZINC20-ForSale-22Q1-1.6B&dist=4&tdn=4&tup=4&rdn=4&rup=4&ldn=4&lup=4&maj=4&min=4&sub=4&scores=Atom%20Alignment,ECFP4,Daylight'<br />
<br />
The API streams back JSON chunks. Possible status messages are FIRST, MORE, END, and ‘Ground Control to Major Tom’ (hangup ping). Each status contains the hit list id (hlid) which can be used with the export and view API entry points.<br />
<br />
From this example:<br />
<source><br />
data:{"status":"FIRST","hlid":4,"elap":"0.0 s","numEdges":0,"numNodes":0,"numWaveFront":0,"numEdgesPerSec":"NaN"}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":1,"numNodes":2,"numWaveFront":6,"numEdgesPerSec":235.13693552145494}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":7,"numNodes":8,"numWaveFront":20,"numEdgesPerSec":627.698881010172}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.0 s","numEdges":47,"numNodes":42,"numWaveFront":57,"numEdgesPerSec":1398.0183120172226}<br />
<br />
data:{"status":"MORE","hlid":4,"elap":"0.1 s","numEdges":361,"numNodes":215,"numWaveFront":218,"numEdgesPerSec":3172.39634840835}<br />
<br />
data:{"status":"Ground Control to Major Tom","hlid":4,"elap":"0.3 s","numEdges":1358,"numNodes":661,"numWaveFront":104,"numEdgesPerSec":4439.029279091838}<br />
<br />
data:{"status":"END","hlid":4,"elap":"0.5 s","numEdges":2417,"numNodes":981,"numWaveFront":0,"numEdgesPerSec":4984.08672048595} </source><br />
<br />
Here the hlid for my request was 4. <br />
<br />
===/search/export===<br />
Export a hit list (given by the id) to a tab-separated value table. The other parameters describe what columns, order, and filters are applied to the hit list. Like /search/view it uses the JQuery DataTables server-side processing parameters - https://www.datatables.net/manual/server-side.<br />
<br />
Useful information about column names and values:<br />
'hlid': hlid,<br />
<br />
'columns[0][data]': 0,<br />
'columns[0][name]': 'alignment',<br />
'columns[0][searchable]': 'true',<br />
'columns[0][orderable]': 'false',<br />
'columns[0][search][value]': '',<br />
'columns[0][search][regex]': 'false',<br />
<br />
'columns[1][data]': 1,<br />
'columns[1][name]': 'dist',<br />
'columns[1][searchable]': 'true',<br />
'columns[1][orderable]': 'true',<br />
'columns[1][search][value]': '0 - 10',<br />
'columns[1][search][regex]': 'false',<br />
<br />
'columns[2][data]': 2,<br />
'columns[2][name]': 'ecfp4',<br />
'columns[2][searchable]': 'true',<br />
'columns[2][orderable]': 'true',<br />
'columns[2][search][value]': '',<br />
'columns[2][search][regex]': 'false',<br />
<br />
'columns[3][data]': 3,<br />
'columns[3][name]': 'daylight',<br />
'columns[3][searchable]': 'true',<br />
'columns[3][orderable]': 'true',<br />
'columns[3][search][value]': '',<br />
'columns[3][search][regex]': 'false',<br />
<br />
'columns[4][data]': 4,<br />
'columns[4][name]': 'topodist',<br />
'columns[4][searchable]': 'true',<br />
'columns[4][orderable]': 'true',<br />
'columns[4][search][value]': '0 - 10',<br />
'columns[4][search][regex]': 'false',<br />
<br />
'columns[5][data]': 5,<br />
'columns[5][name]': 'mces',<br />
'columns[5][searchable]': 'true',<br />
'columns[5][orderable]': 'true',<br />
'columns[5][search][value]': '',<br />
'columns[5][search][regex]': 'false',<br />
<br />
'columns[6][data]': 6,<br />
'columns[6][name]': 'tdn',<br />
'columns[6][searchable]': 'true',<br />
'columns[6][orderable]': 'true',<br />
'columns[6][search][value]': '0 - 0',<br />
'columns[6][search][regex]': 'false',<br />
<br />
'columns[7][data]': 7,<br />
'columns[7][name]': 'tup',<br />
'columns[7][searchable]': 'true',<br />
'columns[7][orderable]': 'true',<br />
'columns[7][search][value]': '0 - 10',<br />
'columns[7][search][regex]': 'false',<br />
<br />
'columns[8][data]': 8,<br />
'columns[8][name]': 'rdn',<br />
'columns[8][searchable]': 'true',<br />
'columns[8][orderable]': 'true',<br />
'columns[8][search][value]': '0 - 0',<br />
'columns[8][search][regex]': 'false',<br />
<br />
'columns[9][data]': 9,<br />
'columns[9][name]': 'rup',<br />
'columns[9][searchable]': 'true',<br />
'columns[9][orderable]': 'true',<br />
'columns[9][search][value]': '0 - 10',<br />
'columns[9][search][regex]': 'false',<br />
<br />
'columns[10][data]': 10,<br />
'columns[10][name]': 'ldn',<br />
'columns[10][searchable]': 'true',<br />
'columns[10][orderable]':<br />
<br />
=Important! Once you run the /search/submit the most important value is the hlid=<br />
<br />
The columns in the resulting tab separated file are alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
The results are sorted in starting with the highest ECFP4<br />
===Example Request===<br />
*Here you only need to change the hlid!<br />
<br />
curl 'https://sw.docking.org//search/export/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
The result should be a tab-separated file. An example of the first 5 rows of data is shown below:<br />
alignment dist ecfp4 daylight topodist mces tdn tup rdn rup ldn lup mut maj min hyb sub<br />
c1ccccc1 ZINC000000967532 0 1.0 1.0 0 6 0 0 0 0 0 0 0 0 0 0 0<br />
Cc1ccccc1 ZINC000000967534 1 0.25 0.5 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Clc1ccccc1 ZINC000000896527 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Nc1ccccc1 ZINC000017886255 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
Oc1ccccc1 ZINC000005133329 1 0.25 0.46153846153846156 1 6 0 1 0 0 0 0 0 0 0 0 1<br />
<br />
==List of Publicly Available Maps==<br />
<br />
Find updated list of maps<br />
https://sw.docking.org/search/maps<br />
<br />
==The SmallWorld API provides the following additional entry points:==<br />
<br />
===/search/view===<br />
Provides data in JSON format.<br />
<br />
*Here again you only need to change the hlid<br />
<br />
curl 'https://sw.docking.org//search/view/?hlid=4&draw=8&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=alignment&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=dist&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=0-10&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=ecfp4&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=daylight&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=topodist&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=mces&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=tdn&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=tup&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=8&columns%5B8%5D%5Bname%5D=rdn&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=9&columns%5B9%5D%5Bname%5D=rup&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=true&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B10%5D%5Bdata%5D=10&columns%5B10%5D%5Bname%5D=ldn&columns%5B10%5D%5Bsearchable%5D=true&columns%5B10%5D%5Borderable%5D=true&columns%5B10%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B10%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B11%5D%5Bdata%5D=11&columns%5B11%5D%5Bname%5D=lup&columns%5B11%5D%5Bsearchable%5D=true&columns%5B11%5D%5Borderable%5D=true&columns%5B11%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B11%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B12%5D%5Bdata%5D=12&columns%5B12%5D%5Bname%5D=mut&columns%5B12%5D%5Bsearchable%5D=true&columns%5B12%5D%5Borderable%5D=true&columns%5B12%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B12%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B13%5D%5Bdata%5D=13&columns%5B13%5D%5Bname%5D=maj&columns%5B13%5D%5Bsearchable%5D=true&columns%5B13%5D%5Borderable%5D=true&columns%5B13%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B13%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B14%5D%5Bdata%5D=14&columns%5B14%5D%5Bname%5D=min&columns%5B14%5D%5Bsearchable%5D=true&columns%5B14%5D%5Borderable%5D=true&columns%5B14%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B14%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B15%5D%5Bdata%5D=15&columns%5B15%5D%5Bname%5D=hyb&columns%5B15%5D%5Bsearchable%5D=true&columns%5B15%5D%5Borderable%5D=true&columns%5B15%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B15%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B16%5D%5Bdata%5D=16&columns%5B16%5D%5Bname%5D=sub&columns%5B16%5D%5Bsearchable%5D=true&columns%5B16%5D%5Borderable%5D=true&columns%5B16%5D%5Bsearch%5D%5Bvalue%5D=0-4&columns%5B16%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=18&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1561063193443'<br />
<br />
===/search/maps===<br />
Lists all available dataset mapfiles. The response is a JSON detailing the map name, id prefix, resolve url<br />
<br />
Example Request:<br />
curl https://sw.docking.org/search/maps<br />
<br />
===/search/config===<br />
Retrieves the public server configuration as JSON including the list of available score functions. The names of the scoring functions can be provided as a parameter to the /search/submit endpoint.<br />
Example Request:<br />
curl https://sw.docking.org/search/config<br />
<br />
[[Category: API]]<br />
[[Category: SmallWorld]]<br />
[[Category: NextMove]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15571Arthor Documentation for Future Developer2023-12-04T22:13:18Z<p>Jgutierrez6: /* Change URL Base Path for API Call */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "servers"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15569Arthor Documentation for Future Developer2023-12-01T23:55:17Z<p>Jgutierrez6: /* Customize Index.js */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15568SmallWorld Documentation for Future Developer2023-12-01T23:54:40Z<p>Jgutierrez6: /* Conditional Hyperlinks */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* Pre-toggle Advanced Option<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
==== Pre-toggle Advanced Option ====<br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
# Then search for "update_visible_columns" and scroll till you find the input checkbox element<br />
#:<source>?update_visible_columns</source><br />
# In the input box element, add the checked option. Should look like this<br />
#:<source><br />
<input name="optAdv" type="checkbox"<br />
onchange="$('#advPanel').css('display', $(this).prop('checked') ? 'block' : 'none'); update_visible_columns();" checked><br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15567SmallWorld Documentation for Future Developer2023-12-01T23:47:12Z<p>Jgutierrez6: /* Pre-toggle Advanced Option */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* Pre-toggle Advanced Option<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
==== Pre-toggle Advanced Option ====<br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
# Then search for "update_visible_columns" and scroll till you find the input checkbox element<br />
#:<source>?update_visible_columns</source><br />
# In the input box element, add the checked option. Should look like this<br />
#:<source><br />
<input name="optAdv" type="checkbox"<br />
onchange="$('#advPanel').css('display', $(this).prop('checked') ? 'block' : 'none'); update_visible_columns();" checked><br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Globus_Curator%27s_Guide&diff=15566Globus Curator's Guide2023-11-29T18:50:03Z<p>Jgutierrez6: Created page with "== Introduction == Here will be instructions on how to maintain globus == Updating Path Permissions == 1. Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links <source>readlink -f <symlink> </source> 2. Become root in epyc 3. Go to /root/globus <source>cd /root/globus</source> 4. Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error): <source>vim storage_gateway_path_restriction.js..."</p>
<hr />
<div>== Introduction ==<br />
Here will be instructions on how to maintain globus<br />
<br />
== Updating Path Permissions ==<br />
1. Identify the real paths of the permission denied paths. Globus doesn't follow symbolic links<br />
<source>readlink -f <symlink> </source><br />
2. Become root in epyc<br />
<br />
3. Go to /root/globus<br />
<source>cd /root/globus</source><br />
4. Insert and save the real paths at the end of this file (check commas for syntax or you'll get an error):<br />
<source>vim storage_gateway_path_restriction.json</source><br />
5. Create a session token with globus. (Cluster 2 Password, ucsfbks)<br />
<source>globus-connect-server session update ucsfbks@globusid.org</source><br />
6. Follow instructions given by globus and it should tell you that it was successful<br />
<br />
7. In the same directory, run this command to update<br />
<source>bash globus-storage-gateway.sh update</source><br />
8. This is the successful message<br />
<source>Message: Updated Storage Gateway aa731fb1-b27a-49e6-aaeb-2d2cc252f779</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Group_Meeting&diff=15553Group Meeting2023-10-18T22:13:42Z<p>Jgutierrez6: </p>
<hr />
<div>= Shoichet Lab Group Meeting Schedule = <br />
'''Google Calendarise the Shoichet Group Meeting schedule''' <br />
You can access the SGM schedule through your own Google calendar account by [http://www.google.com/calendar/render?cid=90hc5i060oggekk2s3c8sluf4g%40group.calendar.google.com clicking here].<br />
For the unfortunate souls that do not have a Google account and those rebellious ones that do not care, an HTML version is available [http://www.google.com/calendar/embed?src=90hc5i060oggekk2s3c8sluf4g%40group.calendar.google.com&pvttk=b015223b9cc576dce92e6cc7698935cd here].<br />
<br />
'''GROUP MEETINGS ARE [[FRIDAYS AT 9:30-11:00 A.M. Room #s as indicated below]].<br />
{{TOCright}}<br />
<br />
<br />
<br />
'''*LAB MTG: <br />
<br />
*10/20/23 - No lab meeting<br />
*10/27/23 - Seth Vigneron '''(MH-1402)'''<br />
*11/03/23 - Moira Rachman '''(BH-212)'''<br />
*11/10/23 - No lab meeting<br />
*11/17/23 - Isabella Glenn '''(BH-212)'''<br />
*11/24/23 - No lab meeting<br />
*12/01/23 - No lab meeting<br />
*12/08/23 - Sijie Huang '''(BH-212)'''<br />
<br />
<br />
* '''Please mark your calendars when you will present.'''<br />
<br />
<br />
=Rotation Order =<br />
<br />
<br />
<br />
<br />
* Ian Knight<br />
*Olivier Mailhot<br />
*Matthew Smith<br />
*Mar Castanon<br />
*Yujin Wu<br />
*Ben Tingle<br />
*Maksim Tsukanov<br />
*Tia Tummino<br />
*Alina Arzamassky<br />
*Fangyu Liu<br />
*Joseph Pepe (presented July 28, 2023)<br />
*Catherine Shin (Start Date: September 2023)<br />
*Xinyu Xu<br />
*Brian Shoichet<br />
*Shiming Peng<br />
*Andrii Kyrylchuk<br />
* Khanh Tang (will present Sept 22 or later to finish work in progress per John = '''present in OCT 2023''')<br />
*NIR LONDON ('''October 6, 2023''' - '''October 5, 2024''')<br />
*Seth Vigneron<br />
*Moira Rachman<br />
*Chase Webb<br />
*Izzy Glenn<br />
*Sijie Huang<br />
*John Irwin<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
*Manglik lab members will present only when there's collaboration<br />
<br />
<br />
<br />
<br />
<br />
<br />
*Copy:<br />
*yall-bkslab@googlegroups.com<br />
*Aashish Manglik<br />
*Joseph Pepe (GS - will be in yall email list)<br />
*Emily Burch (Non-Shoichet lab member - interested in Shoichet lab rsrch; Aug 18 - indefinitely)<br />
*Alessandro Nicoli (Visiting Scholar: August 18 - October 18, 2023)<br />
*Nir London (Visiting Faculty: October 6, 2023 - October 5, 2024)<br />
*RS/guests if presenting<br />
<br />
<br />
*DISI, Cal, Zoom, Email<br />
<br />
*Check cal & holidays<br />
<br />
<br />
<br />
Holidays (NO lab meeting):<br />
*Cesar Chavez<br />
*Veteran's Day<br />
<br />
There's lab mtg:<br />
*SOP Commencement (unless BKS needs to attend)<br />
<br />
= Food Pick-up Rotation = <br />
<br />
*06/28/2019: Xiaobo<br />
<br />
<br />
*07/12/2019: JK<br />
<br />
= Room Bookings = <br />
* GH S536A is booked by Yvonne until ... no end date - booked w/ Alma Agorilla.<br />
[[Category:Internal]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=Rack_Power_(PDUs)&diff=15527Rack Power (PDUs)2023-09-12T21:15:35Z<p>Jgutierrez6: /* Power Table */</p>
<hr />
<div>== Introduction ==<br />
This page will detail what PDUs are in which rack and how much Amperage they can hold.<br />
<br />
It will also detail how much max Amperage each machine can draw from the PDUs.<br />
<br />
== Power Table ==<br />
=== BKS Rack1 / E7 ===<br />
PDU #1 (left side): 10.20.200.115<br />
PDU #2 (left side): 10.20.200.116</div>Jgutierrez6http://wiki.docking.org/index.php?title=Rack_Power_(PDUs)&diff=15526Rack Power (PDUs)2023-09-12T21:08:38Z<p>Jgutierrez6: Created page with "== Introduction == This page will detail what PDUs are in which rack and how much Amperage they can hold. It will also detail how much max Amperage each machine can draw from the PDUs. == Power Table =="</p>
<hr />
<div>== Introduction ==<br />
This page will detail what PDUs are in which rack and how much Amperage they can hold.<br />
<br />
It will also detail how much max Amperage each machine can draw from the PDUs.<br />
<br />
== Power Table ==</div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15347Arthor Documentation for Future Developer2023-04-21T20:52:40Z<p>Jgutierrez6: /* Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
*Database Information Link<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15346Arthor Documentation for Future Developer2023-04-21T20:52:18Z<p>Jgutierrez6: /* Customizing Index.html */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info, a plug to tldr.docking.org, and database link after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
<div class="opt-box-border"><br />
<label> Database Information</label><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</div><br />
</source><br />
<br />
==== Add Database Information Link ====<br />
<br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15339SmallWorld Documentation for Future Developer2023-04-21T20:18:59Z<p>Jgutierrez6: /* Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* Pre-toggle Advanced Option<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
==== Pre-toggle Advanced Option ====<br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15337SmallWorld Documentation for Future Developer2023-04-21T20:15:52Z<p>Jgutierrez6: /* Customizing search.html */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* On page load, display the advanced options instead of checking the box<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15330SmallWorld Documentation for Future Developer2023-04-21T19:22:55Z<p>Jgutierrez6: /* Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
* Add 'Database Information' hyperlink<br />
* On page load, display the advanced options instead of checking the box<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# Inside the script element, add this function<br />
#: <source><br />
window.onload = function() {<br />
$('#advPanel').css('display', $(this).prop('checked', true) && 'block'); update_visible_columns();<br />
}<br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=SmallWorld_Documentation_for_Future_Developer&diff=15323SmallWorld Documentation for Future Developer2023-04-20T19:36:11Z<p>Jgutierrez6: /* Customizing search.html */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/smallworld/documentation/SmallWorld.pdf Here is the link to Smallworld's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
All smallworld databases live in abacus' db3.<br />
<br />
Smallworld frontend files are consolidated and located at '''/export/db3/smallworld_extract/.extract'''.<br />
<br />
Execute command '''start_smallworld''' to see options on which smallworld instance to start/restart.<br />
<br />
== How to Download Smallworld ==<br />
# Ssh to abacus and become root. Prepare directory<br />
#: <source> mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/smallworld/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How to Launch Smallworld For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to abacus and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to smallworld databases directory<br />
#: <source>cd /export/db3/</source><br />
# Create a Smallworld directory and go to it<br />
#: <source>mkdir <smallworld_dir> && cd <smallworld_dir></source><br />
# Inside that directory, create these<br />
#* a symbolic link to the smallworld anon map<br />
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source><br />
#* a sub-directory called maps to store databases<br />
#: <source>mkdir maps</source><br />
#* a smallworld config file<br />
#: <source>vim smallworld.cfg</source><br />
#* Add this block of code inside the config file<br />
#: <source><br />
[WebApp]<br />
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m<br />
ResolverUrl=./util/smi2mol?smi=%s<br />
SearchTimeOut=5000<br />
SearchAsYouDraw=true<br />
[Score]<br />
Name=Atom Alignment<br />
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB <br />
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment <br />
EnabledByDefault=false<br />
MappingMode=EditMap<br />
[Score]<br />
Name=SMARTS Alignment<br />
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input <br />
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment <br />
EnabledByDefault=false<br />
[Score]<br />
Name=ECFP4<br />
Description=Extended Connectivity Circular Fingerprint<br />
Class=com.nmsoftware.smallworld.score.EcfpTanimoto<br />
Radius=2<br />
EnabledByDefault=true<br />
[Score]<br />
Name=Daylight<br />
Description=Path based fingerprint<br />
Class=com.nmsoftware.smallworld.score.DaylightTanimoto<br />
EnabledByDefault=true<br />
</source><br />
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine.<br />
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory.<br />
=== Start Smallworld Instance ===<br />
# Go to smallworld extract directory<br />
#: <source>cd /export/db3/smallworld_extract</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Export the smallworld directory you've made<br />
#: <source>export SWDIR=/export/db3/<smallworld_dir></source><br />
# Launch java<br />
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source><br />
<br />
== How to Build Smallworld Maps/Databases ==<br />
Consolidate smiles into '''/export/db3/temp_mapping'''.<br />
<br />
Use the script located in that directory called '''smallworld_map_script'''.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/csh -f<br />
setenv SWDIR /export/db3/public_smallworld_4th_gen/<br />
<br />
alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'<br />
<br />
set target = '*.smi'<br />
<br />
foreach i ($target)<br />
echo '(sw map' $i '-T tmp/ -o '${i}'.anon.map -u '${i}'.anon.unmapped) |& tee '${i}'_log'<br />
(sw map $i -T tmp/ -o ${i}.anon.map -u ${i}.anon.unmapped) |& tee ${i}_log<br />
echo 'sw blm -p 0.01 '${i}'.anon.map'<br />
sw blm -p 0.01 ${i}.anon.map<br />
end<br />
</source><br />
=== Command Details ===<br />
'''setenv''' sets the environment where the anon master map is<br />
<br />
'''java -jar /opt/nextmove/smallworld-5.1/sw.jar''' shortened to '''sw''' via alias<br />
<br />
'''map''' will map the smiles based on the current anon master map.<br />
*'''-T''' stores temp files so /tmp does not get overloaded<br />
*'''-o''' output with custom name you like<br />
*'''-u''' will collect the unmapped molecules to send to Nextmove or to use swextend<br />
'''tee''' will log the progress of the process<br />
<br />
=== Splitting Databases ===<br />
[[http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld| Follow this page if John has asked you to split the database into smaller slices.]]<br />
<br />
== Active Smallworld Instances ==<br />
{| class="wikitable"<br />
|+ Caption text<br />
|-<br />
! Type !! URL !! Machine:Port !! Directory<br />
|-<br />
| Public || http://sw.docking.org/ || 10.20.0.5:5020 || /nfs/db3/public_smallworld_4th_gen<br />
|-<br />
| Private || http://swp.docking.org/ || 10.20.0.5:8080 || /nfs/db3/private_smallworld_4th_gen<br />
|-<br />
| Super Private || http://swc.docking.org/ || 10.20.0.5:5099 || /nfs/db3/super_private_smallworld_4th_gen<br />
|-<br />
| SWBB || http://swbb.docking.org/ || 10.20.0.5:8081 || /nfs/db3/swbb_5th_gen<br />
|-<br />
| SWCC || http://swcc.docking.org/ || 10.20.0.5:8082 || /nfs/db3/swcc_5th_gen<br />
|-<br />
|}<br />
<br />
== Customize Smallworld FrontEnd To Our Needs (Smallworld 5.5) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in swsearch.js:<br />
* Conditional hyperlinks attached to smallworld hits. Leads to zinc20, cartblanche22, or nothing.<br />
<br />
Summary of changes in search.html:<br />
* Add 'Ask Questions' and contact info<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/smallworld_build_from_source</source><br />
# Download these latest Smallworlds and store them in 'smallworld_build_from_source/'. [[SmallWorld_Documentation_for_Future_Developer#How_to_Download_Smallworld|Here's how to download Smallworld.]]<br />
#* smallworld-java-5.5.tar.gz<br />
#* smallworld-java-src-5.5.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf smallworld-java-5.5.tar.gz<br />
tar -xvf smallworld-java-src-5.5.tar.gz</source><br />
# Install Apache Maven Smallworld Dependencies<br />
#* <source><br />
cd /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java/lib/<br />
bash mvn-install.sh<br />
</source><br />
<br />
=== Customizing swsearch.js ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
<br />
==== Conditional Hyperlinks ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/js/swsearch.js<br />
# Search for this<br />
#* <source>?div.append("<b>" + id + "</b>");</source> <br />
# Replace the inside of the else statement with these lines of code<br />
#* <source><br />
if (id.substring(0,6) == "ZINC00") {<br />
div.append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>");<br />
} else if(id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
div.append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>");<br />
} else {<br />
div.append("<b>" + id + "</b>");<br />
}<br />
</source><br />
<br />
=== Customizing search.html ===<br />
Location: /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
<br />
==== Add 'Ask Questions' and 'Database Information' ====<br />
# vim /mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/src/main/webapp/WEB-INF/static/search.html<br />
# Search 'Scoring Methods'<br />
#: <source>?Scoring Methods</source><br />
# At the end of that big block of 'div', add these:<br />
#: <source><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
# It should look like this<br />
#: <source><br />
<div class="section-head"><br />
Scoring Methods<br />
</div><br />
<table id="swscore"><br />
<br />
</table><br />
</div><br />
<div class="section-head"><br />
Ask Questions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left">Email us: jjiteam@googlegroups.com</th><br />
</table><br />
</div><br />
<div class="section-head"><br />
Database Descriptions<br />
<table class="swopt searchasyoudraw" style="width: 100%"><br />
<th style="text-align: left"><br />
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases">Database Information Link</a><br />
</th><br />
</table><br />
</div><br />
</source><br />
<br />
=== Compile Code To Make WAR File ===<br />
#Build WAR File<br />
#: <source><br />
cd /nfs/home/jjg/smallworld_build_from_source/smallworld-java-src<br />
mvn install -Pbootable<br />
</source><br />
#If it works, then the new WAR File is located at '''/mnt/nfs/home/jjg/smallworld_build_from_source/smallworld-java-src/web/target/sw-ws-5.5.war'''<br />
<br />
== Restarting Smallworld Instance(s) ==<br />
# Ssh to abacus and become root<br />
# execute '''run_sw_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_smallworld''' to restart specific Smallworld instance. It will show you options to choose from.<br />
#: <source><br />
start_smallworld<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Gpus&diff=15293Gpus2023-03-30T22:30:10Z<p>Jgutierrez6: /* Update CUDA 11 and Nvidia-driver */</p>
<hr />
<div>We have 7 GPUs on the cluster. (June 2016). <br />
There is a separate queue gpu.q to manage jobs<br />
<br />
To log in interactively to the gpu queue:<br />
<pre><br />
qlogin -q gpu.q<br />
</pre><br />
<br />
Each gpu is a GeForce GTX 980<br />
<pre><br />
/sbin/lspci | grep -i nvidia<br />
</pre><br />
<br />
Instructions for getting setup for GPU computation: http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/<br />
<br />
NVidia drivers are installed in /usr/loca/cuda*. To use the 7.5 drivers, make sure these environment variables are set:<br />
<br />
<pre><br />
export PATH=/usr/local/cuda-7.5/bin:$PATH<br />
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH<br />
</pre><br />
<br />
Check that the drivers are installed:<br />
<br />
<pre><br />
cat /proc/driver/nvidia/version<br />
</pre><br />
which should return<br />
<pre><br />
NVRM version: NVIDIA UNIX x86_64 Kernel Module 352.79 Wed Jan 13 16:17:53 PST 2016<br />
GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)<br />
</pre><br />
<br />
Try compiling and running the sample programs:<br />
<pre><br />
mkdir -p /scratch/$USER/cuda-7.5_samples<br />
cp -r /usr/local/cuda-7.5/samples /scratch/$USER/cuda-7.5_samples<br />
cd /scratch/$USER/cuda-7.5_samples/<br />
make<br />
</pre><br />
<br />
Run the sample program<br />
<pre><br />
/nfs/ge/bin/on-one-gpu - /scratch/$USER/cuda-7.5_samples/bin/x86_64/linux/release/deviceQuery<br />
</pre><br />
<br />
<br />
<br />
Here is a sample script to run amber:<br />
/nfs/work/tbalius/MOR/run_amber/run.pmemd_cuda_wraper.csh<br />
<br />
Here is an excerpt from script<br />
<pre><br />
##########<br />
cat << EOF > qsub.amber.csh<br />
#\$ -S /bin/csh<br />
#\$ -cwd<br />
#\$ -q gpu.q<br />
#\$ -o stdout<br />
#\$ -e stderr<br />
<br />
# export CUDA_VISIBLE_DEVICES="0,1,2,3" <br />
# setenv CUDA_VISIBLE_DEVICES "0,1,2,3"<br />
setenv AMBERHOME /nfs/soft/amber/amber14/ <br />
set amberexe = "/nfs/ge/bin/on-one-gpu - \$AMBERHOME/bin/pmemd.cuda"<br />
##########<br />
</pre><br />
Note that we run the executable with on-one-gpu. <br />
This manages which gpus are used. <br />
<br />
<br />
<br />
<br />
If you generate significant output, which is generally but not always true,<br />
it is important to write locally to scratch and then copy things over the network onto the disk. <br />
If you write large amounts of data directly to the NFS disk it can cause problems for others.<br />
<br />
<br />
===When encountering kernel errors for Nvidia===<br />
The specific error will be an API error such as this which can be viewed with dmesg: <br />
dmesg | grep "NVRM":<br />
API mismatch: the client has the version 352.93, but<br />
NVRM: this kernel module has the version 352.79. Please<br />
NVRM: make sure that this kernel module and all NVIDIA driver<br />
NVRM: components have the same version.<br />
<br />
Address this problem with the following commands:<br />
# this will remove the nvidia modules and reload the updated versions of the modules<br />
<br />
rmmod nvidia_uvm<br />
rmmod nvidia_drm<br />
rmmod nvidia_modeset<br />
rmmod nvidia<br />
modprobe nvidia<br />
modprobe nvidia_modeset<br />
modprobe nvidia_uvm<br />
<br />
== monitor throttling ==<br />
<br />
nvidia-smi<br />
<br />
commands appear to be in /opt/set-gpu-fans/<br />
<br />
== Update CUDA 11 and Nvidia-driver ==<br />
<source><br />
yum -y install yum-utils<br />
yum-config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo<br />
yum-config-manager --disable repository cuda # disable existing cuda 10 repo<br />
yum remove xorg-x11-drv-nvidia* -y<br />
yum install nvidia-driver-latest-dkms cuda -y <br />
</source><br />
Troubleshooting<br />
I ran into this error while trying to 'yum install nvidia-driver-latest-dkms cuda -y'<br />
Error: Package: 3:nvidia-driver-latest-dkms-cuda-libs-515.43.04-1.el7.x86_64 (cuda-rhel7-x86_64)<br />
Requires: libnvidia-egl-wayland.so.1()(64bit)<br />
So I google the url link for this package and install it and proceed as usual<br />
$ rpm -Uvh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/e/egl-wayland-1.1.6-1.el7.x86_64.rpm<br />
<br />
For <b>Failed to initialize NVML: Driver/library version mismatch</b> error, follow the instruction above to reload the nvidia modules to match the kernel version <br />
<br />
[[Category:GPU]]<br />
[[Category:Internal]]</div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15266Arthor Documentation for Future Developer2023-03-14T21:52:00Z<p>Jgutierrez6: /* Active Arthor Instances */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
| samekh<br />
| 10.20.0.41:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info and a plug to tldr.docking.org after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
</source><br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15263Arthor Documentation for Future Developer2023-03-10T01:40:29Z<p>Jgutierrez6: /* Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.6.1-source.tar.gz<br />
#* arthor-3.6.1-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.6.1-source.tar.gz<br />
tar -xvf arthor-3.6.1-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java<br />
export OS=linux<br />
export VERSION=3.6.1<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info and a plug to tldr.docking.org after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
</source><br />
<br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<li value="Similarity" onclick="setSearchType(this)" class="first"><br />
Similarity<br />
</li><li value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
<!--<li value="Formula" onclick="setSearchType(this)" class="last"><br />
Formula<br />
</li>--><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js<br />
<br />
# Add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15262Arthor Documentation for Future Developer2023-03-10T01:33:34Z<p>Jgutierrez6: /* How to Build Arthor Databases */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
<br />
for i in $target*atdb<br />
do<br />
echo 'atdb2fp -j '$threads' '$i<br />
time atdb2fp -j $threads $i<br />
chmod 744 $i.fp<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor.js:<br />
*Change default search type to be 'Substructure'<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.4.7-source.tar.gz<br />
#* arthor-3.4.7-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.4.7-source.tar.gz<br />
tar -xvf arthor-3.4.7-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-centos7/java<br />
export OS=linux<br />
export VERSION=3.4.7<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Change download options ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_tsv_link'<br />
#* <source>?arthor_tsv_link</source><br />
# Delete original download links<br />
#*<source><br />
<a id="arthor_tsv_link" href="#"> TSV</a><br />
<a id="arthor_csv_link" href="#"> CSV</a><br />
<a id="arthor_sdf_link" href="#"> SDF</a><br />
</source><br />
# Add new download link options<br />
#* <source><br />
<a id="arthor_tsv_link_100" href="#"> TSV-100</a><br />
<a id="arthor_tsv_link_1k" href="#"> TSV-1,000</a><br />
<a id="arthor_tsv_link_10k" href="#"> TSV-10,000</a><br />
<a id="arthor_tsv_link_100k" href="#"> TSV-100,000</a><br />
<a id="arthor_tsv_link_200k" href="#"> TSV-200,000</a><br />
<a id="arthor_tsv_link_300k" href="#"> TSV-300,000</a><br />
<a id="arthor_csv_link_100" href="#"> CSV-100</a><br />
<a id="arthor_csv_link_1k" href="#"> CSV-1,000</a><br />
<a id="arthor_csv_link_10k" href="#"> CSV-10,000</a><br />
<a id="arthor_csv_link_100k" href="#"> CSV-100,000</a><br />
<a id="arthor_csv_link_200k" href="#"> CSV-200,000</a><br />
<a id="arthor_csv_link_300k" href="#"> CSV-300,000</a><br />
<a id="arthor_sdf_link_100" href="#"> SDF-100</a><br />
<a id="arthor_sdf_link_1k" href="#"> SDF-1,000</a><br />
<a id="arthor_sdf_link_10k" href="#"> SDF-10,000</a><br />
<a id="arthor_sdf_link_100k" href="#"> SDF-100,000</a><br />
<a id="arthor_sdf_link_200k" href="#"> SDF-200,000</a><br />
<a id="arthor_sdf_link_300k" href="#"> SDF-300,000</a><br />
</source><br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info and a plug to tldr.docking.org after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
</source><br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<ul id="arthor_search_list"><br />
<li class="first" value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
</ul><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
<br />
==== Add download option logic ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
# Comment out these lines of code<br />
#* <source><br />
if (setDownloadLinks)<br />
setDownloadLinks(hist_limit);<br />
</source><br />
#* <source><br />
let limit = arthor.config.WebApp.DefaultDownloadLimit;<br />
if (!limit)<br />
limit = 500;<br />
</source><br />
# Search for 'setDownloadLinks(limit)', both the function call and the function call argument, and remove the argument 'limit'.<br />
#* <source>?setDownloadLinks(limit)</source><br />
# As for the function, add all the logic for the download sizes<br />
#* <source><br />
function setDownloadLinks() {<br />
//100 Download Size<br />
var limit = 100;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//1k Download Size<br />
var limit = 1000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_1k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_1k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_1k').attr('href', base_url + '?fmt=csv&' + params);<br />
//10k Download Size<br />
var limit = 10000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_10k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_10k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_10k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//100k Download Size<br />
var limit = 100000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//200k Download Size<br />
var limit = 200000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_200k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_200k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_200k').attr('href', base_url + '?fmt=csv&' + params);<br />
//300k Download Size<br />
var limit = 300000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_300k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_300k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_300k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
/* var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link').attr('href', base_url + '?fmt=csv&' + params);<br />
*/<br />
}<br />
</source><br />
# Lastly, add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize Arthor.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
<br />
==== Make Substructure Default Search Type ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
#Search for "let DEFAULT_SEARCH_TYPE"<br />
#* <source>?let DEFAULT_SEARCH_TYPE</source><br />
#Change parameter to "Substructure"<br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15261Arthor Documentation for Future Developer2023-03-10T00:38:35Z<p>Jgutierrez6: /* Customizing Arthor Frontend To Our Needs (Arthor 3.4.7) */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*/*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'atdb2fp -j '$threads' '$j'.atdb'<br />
time atdb2fp -j $threads ${j}.atdb<br />
chmod 744 ${j}.atdb.fp<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove button for Formula<br />
<br />
Summary of changes in index.js:<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor.js:<br />
*Change default search type to be 'Substructure'<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.4.7-source.tar.gz<br />
#* arthor-3.4.7-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.4.7-source.tar.gz<br />
tar -xvf arthor-3.4.7-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-centos7/java<br />
export OS=linux<br />
export VERSION=3.4.7<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Change download options ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_tsv_link'<br />
#* <source>?arthor_tsv_link</source><br />
# Delete original download links<br />
#*<source><br />
<a id="arthor_tsv_link" href="#"> TSV</a><br />
<a id="arthor_csv_link" href="#"> CSV</a><br />
<a id="arthor_sdf_link" href="#"> SDF</a><br />
</source><br />
# Add new download link options<br />
#* <source><br />
<a id="arthor_tsv_link_100" href="#"> TSV-100</a><br />
<a id="arthor_tsv_link_1k" href="#"> TSV-1,000</a><br />
<a id="arthor_tsv_link_10k" href="#"> TSV-10,000</a><br />
<a id="arthor_tsv_link_100k" href="#"> TSV-100,000</a><br />
<a id="arthor_tsv_link_200k" href="#"> TSV-200,000</a><br />
<a id="arthor_tsv_link_300k" href="#"> TSV-300,000</a><br />
<a id="arthor_csv_link_100" href="#"> CSV-100</a><br />
<a id="arthor_csv_link_1k" href="#"> CSV-1,000</a><br />
<a id="arthor_csv_link_10k" href="#"> CSV-10,000</a><br />
<a id="arthor_csv_link_100k" href="#"> CSV-100,000</a><br />
<a id="arthor_csv_link_200k" href="#"> CSV-200,000</a><br />
<a id="arthor_csv_link_300k" href="#"> CSV-300,000</a><br />
<a id="arthor_sdf_link_100" href="#"> SDF-100</a><br />
<a id="arthor_sdf_link_1k" href="#"> SDF-1,000</a><br />
<a id="arthor_sdf_link_10k" href="#"> SDF-10,000</a><br />
<a id="arthor_sdf_link_100k" href="#"> SDF-100,000</a><br />
<a id="arthor_sdf_link_200k" href="#"> SDF-200,000</a><br />
<a id="arthor_sdf_link_300k" href="#"> SDF-300,000</a><br />
</source><br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info and a plug to tldr.docking.org after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
</source><br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<ul id="arthor_search_list"><br />
<li class="first" value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
</ul><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
<br />
==== Add download option logic ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
# Comment out these lines of code<br />
#* <source><br />
if (setDownloadLinks)<br />
setDownloadLinks(hist_limit);<br />
</source><br />
#* <source><br />
let limit = arthor.config.WebApp.DefaultDownloadLimit;<br />
if (!limit)<br />
limit = 500;<br />
</source><br />
# Search for 'setDownloadLinks(limit)', both the function call and the function call argument, and remove the argument 'limit'.<br />
#* <source>?setDownloadLinks(limit)</source><br />
# As for the function, add all the logic for the download sizes<br />
#* <source><br />
function setDownloadLinks() {<br />
//100 Download Size<br />
var limit = 100;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//1k Download Size<br />
var limit = 1000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_1k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_1k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_1k').attr('href', base_url + '?fmt=csv&' + params);<br />
//10k Download Size<br />
var limit = 10000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_10k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_10k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_10k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//100k Download Size<br />
var limit = 100000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//200k Download Size<br />
var limit = 200000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_200k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_200k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_200k').attr('href', base_url + '?fmt=csv&' + params);<br />
//300k Download Size<br />
var limit = 300000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_300k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_300k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_300k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
/* var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link').attr('href', base_url + '?fmt=csv&' + params);<br />
*/<br />
}<br />
</source><br />
# Lastly, add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize Arthor.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
<br />
==== Make Substructure Default Search Type ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
#Search for "let DEFAULT_SEARCH_TYPE"<br />
#* <source>?let DEFAULT_SEARCH_TYPE</source><br />
#Change parameter to "Substructure"<br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6http://wiki.docking.org/index.php?title=Arthor_Documentation_for_Future_Developer&diff=15260Arthor Documentation for Future Developer2023-03-10T00:35:24Z<p>Jgutierrez6: /* Command Details */</p>
<hr />
<div>== Introduction ==<br />
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual]<br />
* Username: ucsf@nextmovesoftware.com<br />
* Password: <Ask jjiteam@googlegroups.com><br />
<br />
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''.<br />
<br />
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines.<br />
<br />
Launch the script to see the options available.<br />
<br />
== How To Download Arthor ==<br />
# Ssh to nfs-soft2 and become root. Prepare directory<br />
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source><br />
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]<br />
#* Username: ucsf@nextmovesoftware.com<br />
#* Password: <Ask jjiteam@googlegroups.com><br />
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.<br />
# Download using wget<br />
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source><br />
# Decompress the file<br />
#* <source> tar -xvf <file_name> </source><br />
<br />
== How To Launch Arthor For The First Time ==<br />
=== Prepare Files and Directories ===<br />
# Ssh to nfs-exc and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source><br />
# Create an Arthor config file <br />
#: <source>vim <name_of_file>.cfg</source><br />
#* Add these lines in the file. Check the manual for more options.<br />
#: <source><br />
DataDir=/local2/public_arthor<br />
MaxConcurrentSearches=6<br />
MaxThreadsPerSearch=8<br />
AutomaticIndex=false<br />
AsyncHitCountMax=20000<br />
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
=== Start Arthor Instance ===<br />
# Now ssh into a machine you wish to run an Arthor instance on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source><br />
<br />
=== Configuration Details ===<br />
<br />
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.<br />
<br />
*'''MaxConcurrentSearches''': Controls the maximum number of searches that can be run concurrently by setting the database pool size. When switching between a large number of databases it can be useful to have a larger pool size, the only trade off is keeping file pointers open.<br />
<br />
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches<br />
<br />
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically<br />
<br />
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches.<br />
<br />
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.<br />
<br />
'''Check Arthor manual for more configuration options'''<br />
<br />
== How to Build Arthor Databases==<br />
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.<br />
<br />
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles.<br />
<br />
Here is the content of the script:<br />
<source><br />
#!/bin/bash<br />
<br />
target="*/*.smi"<br />
threads='48'<br />
version="3.6.1"<br />
<br />
<br />
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/<br />
export PATH=$ARTHOR_DIR/bin/:$PATH<br />
<br />
for j in $target<br />
do<br />
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'<br />
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log<br />
echo 'atdb2fp -j '$threads' '$j'.atdb'<br />
time atdb2fp -j $threads ${j}.atdb<br />
chmod 744 ${j}.atdb.fp<br />
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'<br />
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log<br />
done<br />
</source><br />
<br />
=== Command Details ===<br />
'''smi2atdb''' creates the atdb files needed for Substructure searching.<br />
*'''-v''' verbose<br />
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])<br />
*'''-j''' is the amount of threads to use to index the smiles file<br />
*'''-p''' stores the position of the original file <br />
'''atdb2fp''' makes substructure searching faster<br />
<br />
'''smi2atfp''' creates atfp files for similarity searching<br />
<br />
==Setting up Round Table==<br />
"Round Table allows you to serve and split chemical searches across multiple host machines. The implementation provides a lightweight proxy that forwards requests to other Arthor host servers that do the actual search. Communication is done using the existing Web APIs.<br />
===Setting up Host Server===<br />
# Ssh to nfs-soft2 and become root<br />
# Open a port in the firewall<br />
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp <br />
firewall-cmd --reload<br />
</source><br />
# Go to Arthor Config Directory<br />
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source><br />
# Create Round Table Head configuration file. Here is an example:<br />
# <source><br />
[RoundTable]<br />
RemoteClient=http://10.20.0.41:8008<br />
RemoteClient=http://10.20.5.19:8008<br />
Resolver=https://sw.docking.org/util/smi2mol?smi=%s<br />
</source><br />
# Now ssh into a machine you wish to run the round table head on and become root<br />
# Change your shell to bash if you havn't already<br />
#: <source>bash</source><br />
# Create a screen<br />
#: <source>screen -S <screen_name></source><br />
# Prepare Arthor Config Path<br />
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source><br />
# Launch java<br />
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source><br />
<br />
== Active Arthor Instances ==<br />
===Public Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8080<br />
| /local2/public_arthor/<br />
| Public Arthor<br />
|-<br />
|}<br />
<br />
===Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! Rocky Linux Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| arthor<br />
| 10.20.200.100:8081<br />
| /local2/private_arthor/<br />
| Private Arthor<br />
|-<br />
|}<br />
<br />
===Super Private Arthor===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Round Table Data Directory<br />
! Which Arthor<br />
|-<br />
| nun<br />
| 10.20.0.40:8080<br />
| Round table head has no directory<br />
| Super Private Arthor Round Table Head Node<br />
|-<br />
| nun<br />
| 10.20.0.40:8008<br />
| /local2/public_arthor/<br />
| Super Private Arthor Database Node<br />
|-<br />
|}<br />
<br />
===Arthor BB and CC===<br />
{| class="wikitable"<br />
|-<br />
! CentOS 7 Machine<br />
! Port<br />
! Data Directory<br />
! Which Arthor<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8081<br />
| /local2/arthorbb<br />
| ArthorBB<br />
|-<br />
| epyc-A40<br />
| 10.20.200.92:8082<br />
| /local2/arthorcc<br />
| ArthorCC<br />
|-<br />
|}<br />
<br />
== Customizing Arthor Frontend To Our Needs (Arthor 3.4.7) ==<br />
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''<br />
<br />
Summary of changes in index.html:<br />
*Add download options<br />
*Add contact info<br />
*Advertise TLDR<br />
*Remove buttons for Similarity and Formula<br />
<br />
Summary of changes in index.js:<br />
*Add download options<br />
*Hyperlink the results to zinc20<br />
<br />
Summary of changes in sketcher.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
Summary of changes in arthor.js:<br />
*Change default search type to be 'Substructure'<br />
<br />
Summary of changes in arthor-swagger.yaml.js:<br />
*Input box should be updated as user draws molecule<br />
<br />
<br />
=== Install Prerequisite Packages ===<br />
# Install Apache Maven<br />
#* <source>dnf install maven -y</source><br />
# Install Node Package Manager (NPM)<br />
#* <source>dnf install npm -y</source><br />
# In your home directory, create a new directory to hold the files for the upcoming procedures<br />
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source><br />
# Download these latest Arthors and store them in 'arthor_build_from_source/'. [[Arthor Documentation for Future Developer#How To Download Arthor|Here's how to download Arthor.]]<br />
#* arthor-3.4.7-source.tar.gz<br />
#* arthor-3.4.7-centos7.tar.gz<br />
# Extract contents from the tar.gz files<br />
#* <source>tar -xvf arthor-3.4.7-source.tar.gz<br />
tar -xvf arthor-3.4.7-centos7.tar.gz</source><br />
# Install Apache Maven Arthor dependencies through this script<br />
#* <source><br />
#!/bin/bash<br />
<br />
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-centos7/java<br />
export OS=linux<br />
export VERSION=3.4.7<br />
<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni-${OS} \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \<br />
-Dpackaging=jar \<br />
-DgeneratePom=true \<br />
-DartifactId=arthor-jni \<br />
-DgroupId=com.nextmovesoftware.arthor \<br />
-Dversion=$VERSION<br />
</source><br />
=== Customizing Index.html ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
<br />
==== Change download options ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_tsv_link'<br />
#* <source>?arthor_tsv_link</source><br />
# Delete original download links<br />
#*<source><br />
<a id="arthor_tsv_link" href="#"> TSV</a><br />
<a id="arthor_csv_link" href="#"> CSV</a><br />
<a id="arthor_sdf_link" href="#"> SDF</a><br />
</source><br />
# Add new download link options<br />
#* <source><br />
<a id="arthor_tsv_link_100" href="#"> TSV-100</a><br />
<a id="arthor_tsv_link_1k" href="#"> TSV-1,000</a><br />
<a id="arthor_tsv_link_10k" href="#"> TSV-10,000</a><br />
<a id="arthor_tsv_link_100k" href="#"> TSV-100,000</a><br />
<a id="arthor_tsv_link_200k" href="#"> TSV-200,000</a><br />
<a id="arthor_tsv_link_300k" href="#"> TSV-300,000</a><br />
<a id="arthor_csv_link_100" href="#"> CSV-100</a><br />
<a id="arthor_csv_link_1k" href="#"> CSV-1,000</a><br />
<a id="arthor_csv_link_10k" href="#"> CSV-10,000</a><br />
<a id="arthor_csv_link_100k" href="#"> CSV-100,000</a><br />
<a id="arthor_csv_link_200k" href="#"> CSV-200,000</a><br />
<a id="arthor_csv_link_300k" href="#"> CSV-300,000</a><br />
<a id="arthor_sdf_link_100" href="#"> SDF-100</a><br />
<a id="arthor_sdf_link_1k" href="#"> SDF-1,000</a><br />
<a id="arthor_sdf_link_10k" href="#"> SDF-10,000</a><br />
<a id="arthor_sdf_link_100k" href="#"> SDF-100,000</a><br />
<a id="arthor_sdf_link_200k" href="#"> SDF-200,000</a><br />
<a id="arthor_sdf_link_300k" href="#"> SDF-300,000</a><br />
</source><br />
<br />
==== Add contact info and tldr ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_table_list'<br />
#* <source>?arthor_table_list</source><br />
# Add contact info and a plug to tldr.docking.org after the div block where arthor_table_list is inside of. It should look like this<br />
#* <source><br />
<div class="opt-box-border"><br />
<label>Databases</label><br />
<!-- This will be populated by available databases --><br />
<ul id="arthor_table_list"><br />
<li class="placeholder">Please select a search type</li><br />
</ul><br />
</div><br />
<div class="opt-box-border"><br />
<label>Ask Questions</label><br />
Email us: jjiteam@googlegroups.com<br />
</div><br />
<div class="opt-box-border"><br />
<label> To Download 100K+ Results</label><br />
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch<br />
</div><br />
</source><br />
==== Remove Similarity and Formula Buttons ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html<br />
# Search for 'arthor_search_list'<br />
#* <source> ?arthor_search_list </source><br />
# Delete and Replace the whole 'ul' element block with this<br />
#* <source><br />
<ul id="arthor_search_list"><br />
<li class="first" value="Substructure" onclick="setSearchType(this)"><br />
Substructure<br />
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"><br />
SMARTS<br />
</li><br />
</ul><br />
</source><br />
<br />
=== Customize Index.js ===<br />
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
<br />
==== Add download option logic ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js<br />
# Comment out these lines of code<br />
#* <source><br />
if (setDownloadLinks)<br />
setDownloadLinks(hist_limit);<br />
</source><br />
#* <source><br />
let limit = arthor.config.WebApp.DefaultDownloadLimit;<br />
if (!limit)<br />
limit = 500;<br />
</source><br />
# Search for 'setDownloadLinks(limit)', both the function call and the function call argument, and remove the argument 'limit'.<br />
#* <source>?setDownloadLinks(limit)</source><br />
# As for the function, add all the logic for the download sizes<br />
#* <source><br />
function setDownloadLinks() {<br />
//100 Download Size<br />
var limit = 100;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//1k Download Size<br />
var limit = 1000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_1k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_1k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_1k').attr('href', base_url + '?fmt=csv&' + params);<br />
//10k Download Size<br />
var limit = 10000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_10k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_10k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_10k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//100k Download Size<br />
var limit = 100000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_100k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_100k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_100k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
//200k Download Size<br />
var limit = 200000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_200k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_200k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_200k').attr('href', base_url + '?fmt=csv&' + params);<br />
//300k Download Size<br />
var limit = 300000;<br />
var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link_300k').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link_300k').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link_300k').attr('href', base_url + '?fmt=csv&' + params);<br />
<br />
/* var params = $.param({<br />
query: arthor.query,<br />
type: arthor.type,<br />
draw: 0,<br />
start: 0,<br />
length: limit,<br />
flags: arthor.flags<br />
});<br />
var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';<br />
$('#arthor_sdf_link').attr('href', base_url + '?fmt=sdf&' + params);<br />
$('#arthor_tsv_link').attr('href', base_url + '?fmt=tsv&' + params);<br />
$('#arthor_csv_link').attr('href', base_url + '?fmt=csv&' + params);<br />
*/<br />
}<br />
</source><br />
# Lastly, add the zinc20 hyperlink to the Arthor results. Search for this<br />
#* <source><br />
"<b>" + id + "</b>"<br />
</source><br />
# Delete the contents of the whole else block and replace it with this<br />
#* <source><br />
if (id.substring(0, 6) == "ZINC00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/searchZinc/"+id+"'>" + id + "</a></b>",<br />
"<span class='table_name'>" + table_name + "</span>")));<br />
} else {<br />
$info.append(<br />
$('<tr>').append(<br />
$('<td>').append("<b>" + id + "</b>")));<br />
}<br />
</source><br />
<br />
=== Customize Sketcher.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
<br />
==== Input Box Updates as User Draws ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js<br />
#Search for this line "var smiles = event.src.smiles();"<br />
#* <source>?var smiles = event.src.smiles();</source><br />
#Add this new line below it<br />
#* <source>$('#ar_text_input').val(smiles);</source><br />
<br />
=== Customize Arthor.js ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
<br />
==== Make Substructure Default Search Type ====<br />
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js<br />
#Search for "let DEFAULT_SEARCH_TYPE"<br />
#* <source>?let DEFAULT_SEARCH_TYPE</source><br />
#Change parameter to "Substructure"<br />
<br />
=== Customize arthor-swagger.yaml ===<br />
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
<br />
==== Change URL Base Path for API Call ====<br />
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/swagger/arthor-swagger.yaml<br />
# Search for "basePath"<br />
#* <source>?basePath</source><br />
# Remove "/arthor" and keep argument empty<br />
<br />
=== Compile/Minify Code through NPM ===<br />
# Install NPM packages and Minify Code<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui<br />
npm install<br />
npx webpack-dev-server<br />
npx webpack --mode=production<br />
</source><br />
# If the npx commands don't work, try updating node and npm version to the latest one.<br />
# Build the war file<br />
#* <source><br />
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server<br />
mvn install -Pbootable<br />
</source><br />
# If it works, then the path to new war file is at /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server/target/arthor-server-3.4.7.war<br />
<br />
== Restarting Arthor Instance(s) Instructions ==<br />
# Ssh to machine with respective Arthor instance and become root<br />
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine<br />
#: <source><br />
bash /root/run_arthors_on_reboot.sh<br />
</source><br />
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.<br />
#: <source><br />
bash /nfs/soft2/arthor_configs/start_arthor_script.sh<br />
</source></div>Jgutierrez6