Arthor Documentation for Future Developer: Difference between revisions
(Created page with "Written by Jennifer Young on December 16, 2019 ==Install and Set Up on TomCat== Arthor currently runs on n-1-136, which runs CentOS Linux release 7.7.1908 (Core). You can ch...") |
Jgutierrez6 (talk | contribs) |
||
(152 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | |||
[https://www.nextmovesoftware.com/downloads/arthor/documentation/Arthor.pdf Here is the link to Arthor's manual] | |||
* Username: ucsf@nextmovesoftware.com | |||
* Password: <Ask jjiteam@googlegroups.com> | |||
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/'''. | |||
'''/nfs/soft2/arthor_configs/start_arthor_script.sh''' can start/restart Arthor instances on respective machines. | |||
Launch the script to see the options available. | |||
== How To Download Arthor == | |||
# Ssh to nfs-soft2 and become root. Prepare directory | |||
#: <source> mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version> </source> | |||
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link] | |||
#* Username: ucsf@nextmovesoftware.com | |||
#* Password: <Ask jjiteam@googlegroups.com> | |||
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address. | |||
# Download using wget | |||
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source> | |||
# Decompress the file | |||
#* <source> tar -xvf <file_name> </source> | |||
== How To Launch Arthor For The First Time == | |||
=== Prepare Files and Directories === | |||
# Ssh to nfs-exc and become root | |||
# Open a port in the firewall | |||
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp | |||
firewall-cmd --reload | |||
</source> | |||
# Go to Arthor Config directory | |||
#: <source>cd /export/soft2/arthor_configs/arthor-<latest_version></source> | |||
# Create an Arthor config file | |||
#: <source>vim <name_of_file>.cfg</source> | |||
#* Add these lines in the file. Check the manual for more options. | |||
#: <source> | |||
DataDir=/local2/public_arthor | |||
MaxConcurrentSearches=6 | |||
MaxThreadsPerSearch=8 | |||
AutomaticIndex=false | |||
AsyncHitCountMax=20000 | |||
Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1 | |||
Resolver=https://sw.docking.org/util/smi2mol?smi=%s | |||
</source> | |||
=== Start Arthor Instance === | |||
# Now ssh into a machine you wish to run an Arthor instance on and become root | |||
# Change your shell to bash if you havn't already | |||
#: <source>bash</source> | |||
# Create a screen | |||
#: <source>screen -S <screen_name></source> | |||
# Prepare Arthor Config Path | |||
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"</source> | |||
# Launch java | |||
#: <source>java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war</source> | |||
=== Configuration Details === | |||
*'''DataDir''': This is the directory where the Arthor data files live. Location where the index files will be created and loaded from. | |||
*'''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. | |||
*'''MaxThreadsPerSearch''': The number of threads to use for both ATDB and ATFP searches | |||
*Set '''AutomaticIndex''' to false if you don't want new smiles files added to the data directory to be indexed automatically | |||
*'''AsyncHitCountMax''': The upper-bound for the number of hits to retrieve in background searches. | |||
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board. | |||
'''Check Arthor manual for more configuration options''' | |||
== How to Build Arthor Databases== | |||
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one. | |||
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you stored the smiles. | |||
Here is the content of the script: | |||
<source> | |||
#!/bin/bash | |||
target="*.smi" | |||
threads='48' | |||
version="3.6.1" | |||
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/ | |||
export PATH=$ARTHOR_DIR/bin/:$PATH | |||
for j in $target | |||
do | |||
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log' | |||
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log | |||
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log' | |||
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log | |||
done | |||
for i in $target*atdb | |||
do | |||
echo 'atdb2fp -j '$threads' '$i | |||
time atdb2fp -j $threads $i | |||
chmod 744 $i.fp | |||
done | |||
</source> | |||
=== Command Details === | |||
'''smi2atdb''' creates the atdb files needed for Substructure searching. | |||
*'''-v''' verbose | |||
*'''-r''' Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5]) | |||
*'''-j''' is the amount of threads to use to index the smiles file | |||
*'''-p''' stores the position of the original file | |||
'''atdb2fp''' makes substructure searching faster | |||
'''smi2atfp''' creates atfp files for similarity searching | |||
==Setting up Round Table== | |||
"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. | |||
===Setting up Host Server=== | |||
# Ssh to nfs-soft2 and become root | |||
# Open a port in the firewall | |||
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp | |||
firewall-cmd --reload | |||
</source> | |||
# Go to Arthor Config Directory | |||
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source> | |||
# Create Round Table Head configuration file. Here is an example: | |||
# <source> | |||
[RoundTable] | |||
RemoteClient=http://10.20.0.41:8008 | |||
RemoteClient=http://10.20.5.19:8008 | |||
Resolver=https://sw.docking.org/util/smi2mol?smi=%s | |||
</source> | |||
# Now ssh into a machine you wish to run the round table head on and become root | |||
# Change your shell to bash if you havn't already | |||
#: <source>bash</source> | |||
# Create a screen | |||
#: <source>screen -S <screen_name></source> | |||
# Prepare Arthor Config Path | |||
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source> | |||
# Launch java | |||
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source> | |||
== Active Arthor Instances == | |||
===Public Arthor=== | |||
{| class="wikitable" | |||
|- | |||
! Rocky Linux Machine | |||
! Port | |||
! Round Table Data Directory | |||
! Which Arthor | |||
|- | |||
| arthor | |||
| 10.20.200.100:8080 | |||
| /local3/public_arthor/ | |||
| Public Arthor | |||
|- | |||
|} | |||
===Private Arthor=== | |||
{| class="wikitable" | |||
|- | |||
! Rocky Linux Machine | |||
! Port | |||
! Round Table Data Directory | |||
! Which Arthor | |||
|- | |||
| arthor | |||
| 10.20.200.100:8081 | |||
| /local3/private_arthor/ | |||
| Private Arthor | |||
|- | |||
|} | |||
===Super Private Arthor=== | |||
{| class="wikitable" | |||
|- | |||
! CentOS 7 Machine | |||
! Port | |||
! Round Table Data Directory | |||
! Which Arthor | |||
|- | |||
| nun | |||
| 10.20.0.40:8080 | |||
| Round table head has no directory | |||
| Super Private Arthor Round Table Head Node | |||
|- | |||
| nun | |||
| 10.20.0.40:8008 | |||
| /local2/public_arthor/ | |||
| Super Private Arthor Database Node | |||
|- | |||
| samekh | |||
| 10.20.0.41:8008 | |||
| /local2/public_arthor/ | |||
| Super Private Arthor Database Node | |||
|- | |||
|} | |||
===Arthor BB and CC=== | |||
{| class="wikitable" | |||
|- | |||
! CentOS 7 Machine | |||
! Port | |||
! Data Directory | |||
! Which Arthor | |||
|- | |||
| epyc-A40 | |||
| 10.20.200.92:8081 | |||
| /local2/arthorbb | |||
| ArthorBB | |||
|- | |||
| epyc-A40 | |||
| 10.20.200.92:8082 | |||
| /local2/arthorcc | |||
| ArthorCC | |||
|- | |||
|} | |||
== Customizing Arthor Frontend To Our Needs (Arthor 3.6.1) == | |||
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.''' | |||
Summary of changes in index.html: | |||
*Add contact info | |||
*Advertise TLDR | |||
*Remove button for Formula | |||
*Database Information Link | |||
Summary of changes in index.js: | |||
*Hyperlink the results to zinc20 | |||
Summary of changes in sketcher.js: | |||
*Input box should be updated as user draws molecule | |||
Summary of changes in arthor-swagger.yaml.js: | |||
*Input box should be updated as user draws molecule | |||
=== Install Prerequisite Packages === | |||
# Install Apache Maven | |||
#* <source>dnf install maven -y</source> | |||
# Install Node Package Manager (NPM) | |||
#* <source>dnf install npm -y</source> | |||
# In your home directory, create a new directory to hold the files for the upcoming procedures | |||
#* <source>mkdir /mnt/nfs/home/jjg/arthor_build_from_source</source> | |||
# 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.]] | |||
#* arthor-3.6.1-source.tar.gz | |||
#* arthor-3.6.1-centos7.tar.gz | |||
# Extract contents from the tar.gz files | |||
#* <source>tar -xvf arthor-3.6.1-source.tar.gz | |||
tar -xvf arthor-3.6.1-centos7.tar.gz</source> | |||
# Install Apache Maven Arthor dependencies through this script | |||
#* <source> | |||
#!/bin/bash | |||
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java | |||
export OS=linux | |||
export VERSION=3.6.1 | |||
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \ | |||
-Dpackaging=jar \ | |||
-DgeneratePom=true \ | |||
-DartifactId=arthor-jni-${OS} \ | |||
-DgroupId=com.nextmovesoftware.arthor \ | |||
-Dversion=$VERSION | |||
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \ | |||
-Dpackaging=jar \ | |||
-DgeneratePom=true \ | |||
-DartifactId=arthor-jni \ | |||
-DgroupId=com.nextmovesoftware.arthor \ | |||
-Dversion=$VERSION | |||
</source> | |||
=== Customizing Index.html === | |||
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 | |||
==== Add contact info and tldr ==== | |||
# 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 | |||
# Search for 'arthor_table_list' | |||
#* <source>?arthor_table_list</source> | |||
# 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 | |||
#* <source> | |||
<div class="opt-box-border"> | |||
<label>Databases</label> | |||
<!-- This will be populated by available databases --> | |||
<ul id="arthor_table_list"> | |||
<li class="placeholder">Please select a search type</li> | |||
</ul> | |||
</div> | |||
<div class="opt-box-border"> | |||
<label>Ask Questions</label> | |||
Email us: jjiteam@googlegroups.com | |||
</div> | |||
<div class="opt-box-border"> | |||
<label> To Download 100K+ Results</label> | |||
Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch | |||
</div> | |||
<div class="opt-box-border"> | |||
<label> Database Information</label> | |||
<a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a> | |||
</div> | |||
</source> | |||
==== Add Database Information Link ==== | |||
==== Remove Similarity and Formula Buttons ==== | |||
# 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 | |||
# Search for 'arthor_search_list' | |||
#* <source> ?arthor_search_list </source> | |||
# Delete and Replace the whole 'ul' element block with this | |||
#* <source> | |||
<li value="Similarity" onclick="setSearchType(this)" class="first"> | |||
Similarity | |||
</li><li value="Substructure" onclick="setSearchType(this)"> | |||
Substructure | |||
</li><li value="SMARTS" onclick="setSearchType(this)" class="last"> | |||
SMARTS | |||
</li> | |||
<!--<li value="Formula" onclick="setSearchType(this)" class="last"> | |||
Formula | |||
</li>--> | |||
</source> | |||
=== Customize Index.js === | |||
==== Conditional Hyperlinks ==== | |||
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js | |||
# Add the zinc20 hyperlink to the Arthor results. Search for this | |||
#* <source> | |||
"<b>" + id + "</b>" | |||
</source> | |||
# Delete the contents of the whole else block and replace it with this | |||
#* <source> | |||
if (id.substring(0, 6) == "ZINC00") { | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>", | |||
"<span class='table_name'>" + table_name + "</span>"))); | |||
} else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") { | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>", | |||
"<span class='table_name'>" + table_name + "</span>"))); | |||
} else { | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append("<b>" + id + "</b>"))); | |||
} | |||
</source> | |||
==== Copy SMILES Clipboard ==== | |||
# Search this | |||
#: <source>?parser</source> | |||
# At the end of the the try block add this | |||
#: <source> | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append('Copy SMILES: <a href="#" onclick="navigator.clipboard.writeText(\'' + parser.smi.split(/\s{1,}/)[0] + '\');" ><i class="fa fa-clipboard" aria-hidden="true"></i></a>'))); | |||
</source> | |||
# The whole try and catch block should look like this | |||
#: <source> | |||
try { | |||
var parser = new SmiJs.Parser(data); | |||
if (parser.parse()) { | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append(parser.mf(true)))); | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append(parser.mw()))); | |||
$info.append( | |||
$('<tr>').append( | |||
$('<td>').append('Copy SMILES: <a href="#" onclick="navigator.clipboard.writeText(\'' + parser.smi.split(/\s{1,}/)[0] + '\');" ><i class="fa fa-clipboard" aria-hidden="true"></i></a>'))); | |||
} | |||
} catch(err) { | |||
console.log(err); | |||
} | |||
</source> | |||
=== Customize Sketcher.js === | |||
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js | |||
==== Input Box Updates as User Draws ==== | |||
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js | |||
#Search for this line "var smiles = event.src.smiles();" | |||
#* <source>?var smiles = event.src.smiles();</source> | |||
#Add this new line below it | |||
#* <source>$('#ar_text_input').val(smiles);</source> | |||
=== Customize arthor-swagger.yaml === | |||
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 | |||
==== Change URL Base Path for API Call ==== | |||
# 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 | |||
# Search for "servers" | |||
#* <source>?basePath</source> | |||
# Remove "/arthor" and keep argument empty | |||
=== Compile/Minify Code through NPM === | |||
# Install NPM packages and Minify Code | |||
#* <source> | |||
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui | |||
npm install | |||
npx webpack-dev-server | |||
npx webpack --mode=production | |||
</source> | |||
# If the npx commands don't work, try updating node and npm version to the latest one. | |||
# Build the war file | |||
#* <source> | |||
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server | |||
mvn install -Pbootable | |||
</source> | |||
# 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 | |||
== Adding Arthor to Systemd (example) == | |||
# Create service files | |||
#: <source> | |||
touch /etc/systemd/system/arthor.service | |||
</source> | |||
# Add this code block in the service file | |||
#: <source> | |||
[Unit] | |||
Description=Arthor Public Instance | |||
After=network.target | |||
[Service] | |||
Type=exec | |||
Restart=always | |||
RestartSec=3 | |||
User=root | |||
ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public | |||
ExecStop=/bin/kill -15 $MAINPID | |||
[Install] | |||
WantedBy=multi-user.target | |||
</source> | |||
# Change "ExecStart" to other Arthor Instances | |||
== Restarting Arthor Instance(s) Instructions == | |||
=== Public and Private Arthor === | |||
# ssh to "arthor" server and run | |||
#: <source> | |||
systemctl <start|stop|restart> <arthor|arthorp> | |||
</source> | |||
=== ArthorBB, ArthorCC, and ArthorCovalent === | |||
# ssh to "epyc-a40" server and run | |||
#: <source> | |||
systemctl <start|stop|restart> <arthorbb|arthorcc|arthorcovalent> | |||
</source> | |||
=== Super Private Arthor === | |||
# Ssh to machine with respective Arthor instance and become root | |||
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine | |||
#: <source> | |||
bash /root/run_arthors_on_reboot.sh | |||
</source> | |||
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from. | |||
#: <source> | |||
bash /nfs/soft2/arthor_configs/start_arthor_script.sh | |||
</source> |
Revision as of 18:01, 2 May 2024
Introduction
Here is the link to Arthor's manual
- Username: ucsf@nextmovesoftware.com
- Password: <Ask jjiteam@googlegroups.com>
Arthor configurations and the frontend files are consolidated in /nfs/soft2/arthor_configs/.
/nfs/soft2/arthor_configs/start_arthor_script.sh can start/restart Arthor instances on respective machines.
Launch the script to see the options available.
How To Download Arthor
- Ssh to nfs-soft2 and become root. Prepare directory
mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version>
- Download Software with this link
- Username: ucsf@nextmovesoftware.com
- Password: <Ask jjiteam@googlegroups.com>
- Go to releases. Look for smallworld-java-<version>.tar.gz and copy the link address.
- Download using wget
wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address>
- Decompress the file
tar -xvf <file_name>
How To Launch Arthor For The First Time
Prepare Files and Directories
- Ssh to nfs-exc and become root
- Open a port in the firewall
firewall-cmd --permanent --add-port=<port_number>/tcp firewall-cmd --reload
- Go to Arthor Config directory
cd /export/soft2/arthor_configs/arthor-<latest_version>
- Create an Arthor config file
vim <name_of_file>.cfg
- Add these lines in the file. Check the manual for more options.
DataDir=/local2/public_arthor MaxConcurrentSearches=6 MaxThreadsPerSearch=8 AutomaticIndex=false AsyncHitCountMax=20000 Depiction=./depict/bot/svg?w=%w&h=%h&svgunits=px&smi=%s&zoom=0.8&sma=%m&smalim=1 Resolver=https://sw.docking.org/util/smi2mol?smi=%s
Start Arthor Instance
- Now ssh into a machine you wish to run an Arthor instance on and become root
- Change your shell to bash if you havn't already
bash
- Create a screen
screen -S <screen_name>
- Prepare Arthor Config Path
export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"
- Launch java
java -jar -Dserver.port=<port_number> /nfs/soft2/arthor_configs/arthor-<version>/arthor-server-<version>.war
Configuration Details
- DataDir: This is the directory where the Arthor data files live. Location where the index files will be created and loaded from.
- 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.
- MaxThreadsPerSearch: The number of threads to use for both ATDB and ATFP searches
- Set AutomaticIndex to false if you don't want new smiles files added to the data directory to be indexed automatically
- AsyncHitCountMax: The upper-bound for the number of hits to retrieve in background searches.
- Resolver: Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.
Check Arthor manual for more configuration options
How to Build Arthor Databases
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.
Just use the script located at /nfs/home/jjg/scripts/arthor_index_script.sh at the directory where you stored the smiles.
Here is the content of the script:
#!/bin/bash
target="*.smi"
threads='48'
version="3.6.1"
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos8/
export PATH=$ARTHOR_DIR/bin/:$PATH
for j in $target
do
echo 'smi2atdb -v -r -j '$threads' -p '$j' '${j}'.atdb |& tee -a '${j}'_log'
time smi2atdb -v -r -j $threads -p $j ${j}.atdb |& tee -a ${j}_log
echo 'smi2atfp -j '$threads' -p '$j' '${j}.atfp' |& tee -a '${j}'_log'
time smi2atfp -j $threads -p $j ${j}.atfp |& tee -a ${j}_log
done
for i in $target*atdb
do
echo 'atdb2fp -j '$threads' '$i
time atdb2fp -j $threads $i
chmod 744 $i.fp
done
Command Details
smi2atdb creates the atdb files needed for Substructure searching.
- -v verbose
- -r Compute and store ring size information in the index allowing ring size (3-10) expressions ([r6] and [Z5])
- -j is the amount of threads to use to index the smiles file
- -p stores the position of the original file
atdb2fp makes substructure searching faster
smi2atfp creates atfp files for similarity searching
Setting up Round Table
"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.
Setting up Host Server
- Ssh to nfs-soft2 and become root
- Open a port in the firewall
firewall-cmd --permanent --add-port=<port_number>/tcp firewall-cmd --reload
- Go to Arthor Config Directory
cd /export/soft2/arthor_configs/arthor-<version>
- Create Round Table Head configuration file. Here is an example:
[RoundTable] RemoteClient=http://10.20.0.41:8008 RemoteClient=http://10.20.5.19:8008 Resolver=https://sw.docking.org/util/smi2mol?smi=%s
- Now ssh into a machine you wish to run the round table head on and become root
- Change your shell to bash if you havn't already
bash
- Create a screen
screen -S <screen_name>
- Prepare Arthor Config Path
export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"
- Launch java
java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number>
Active Arthor Instances
Public Arthor
Rocky Linux Machine | Port | Round Table Data Directory | Which Arthor |
---|---|---|---|
arthor | 10.20.200.100:8080 | /local3/public_arthor/ | Public Arthor |
Private Arthor
Rocky Linux Machine | Port | Round Table Data Directory | Which Arthor |
---|---|---|---|
arthor | 10.20.200.100:8081 | /local3/private_arthor/ | Private Arthor |
Super Private Arthor
CentOS 7 Machine | Port | Round Table Data Directory | Which Arthor |
---|---|---|---|
nun | 10.20.0.40:8080 | Round table head has no directory | Super Private Arthor Round Table Head Node |
nun | 10.20.0.40:8008 | /local2/public_arthor/ | Super Private Arthor Database Node |
samekh | 10.20.0.41:8008 | /local2/public_arthor/ | Super Private Arthor Database Node |
Arthor BB and CC
CentOS 7 Machine | Port | Data Directory | Which Arthor |
---|---|---|---|
epyc-A40 | 10.20.200.92:8081 | /local2/arthorbb | ArthorBB |
epyc-A40 | 10.20.200.92:8082 | /local2/arthorcc | ArthorCC |
Customizing Arthor Frontend To Our Needs (Arthor 3.6.1)
These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.
Summary of changes in index.html:
- Add contact info
- Advertise TLDR
- Remove button for Formula
- Database Information Link
Summary of changes in index.js:
- Hyperlink the results to zinc20
Summary of changes in sketcher.js:
- Input box should be updated as user draws molecule
Summary of changes in arthor-swagger.yaml.js:
- Input box should be updated as user draws molecule
Install Prerequisite Packages
- Install Apache Maven
dnf install maven -y
- Install Node Package Manager (NPM)
dnf install npm -y
- In your home directory, create a new directory to hold the files for the upcoming procedures
mkdir /mnt/nfs/home/jjg/arthor_build_from_source
- Download these latest Arthors and store them in 'arthor_build_from_source/'. Here's how to download Arthor.
- arthor-3.6.1-source.tar.gz
- arthor-3.6.1-centos7.tar.gz
- Extract contents from the tar.gz files
tar -xvf arthor-3.6.1-source.tar.gz tar -xvf arthor-3.6.1-centos7.tar.gz
- Install Apache Maven Arthor dependencies through this script
#!/bin/bash export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-centos8/java export OS=linux export VERSION=3.6.1 mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \ -Dpackaging=jar \ -DgeneratePom=true \ -DartifactId=arthor-jni-${OS} \ -DgroupId=com.nextmovesoftware.arthor \ -Dversion=$VERSION mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \ -Dpackaging=jar \ -DgeneratePom=true \ -DartifactId=arthor-jni \ -DgroupId=com.nextmovesoftware.arthor \ -Dversion=$VERSION
Customizing Index.html
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
Add contact info and tldr
- 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
- Search for 'arthor_table_list'
?arthor_table_list
- 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
<div class="opt-box-border"> <label>Databases</label> <!-- This will be populated by available databases --> <ul id="arthor_table_list"> <li class="placeholder">Please select a search type</li> </ul> </div> <div class="opt-box-border"> <label>Ask Questions</label> Email us: jjiteam@googlegroups.com </div> <div class="opt-box-border"> <label> To Download 100K+ Results</label> Sign up for <a href="http://tldr.docking.org/">tldr.docking.org</a> and use arthorbatch </div> <div class="opt-box-border"> <label> Database Information</label> <a href="https://wiki.docking.org/index.php/Smallworld_and_Arthor_Databases#Smallworld_Databases" target="_blank">Database Information Link</a> </div>
Add Database Information Link
Remove Similarity and Formula Buttons
- 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
- Search for 'arthor_search_list'
?arthor_search_list
- Delete and Replace the whole 'ul' element block with this
<li value="Similarity" onclick="setSearchType(this)" class="first"> Similarity </li><li value="Substructure" onclick="setSearchType(this)"> Substructure </li><li value="SMARTS" onclick="setSearchType(this)" class="last"> SMARTS </li> <!--<li value="Formula" onclick="setSearchType(this)" class="last"> Formula </li>-->
Customize Index.js
Conditional Hyperlinks
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/index.js
- Add the zinc20 hyperlink to the Arthor results. Search for this
"<b>" + id + "</b>"
- Delete the contents of the whole else block and replace it with this
if (id.substring(0, 6) == "ZINC00") { $info.append( $('<tr>').append( $('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>", "<span class='table_name'>" + table_name + "</span>"))); } else if (id.substring(0,4) == "ZINC" && id.substring(4,6) != "00") { $info.append( $('<tr>').append( $('<td>').append("<b><a target='_blank' href='https://cartblanche22.docking.org/substance/"+id+"'>" + id + "</a></b>", "<span class='table_name'>" + table_name + "</span>"))); } else { $info.append( $('<tr>').append( $('<td>').append("<b>" + id + "</b>"))); }
Copy SMILES Clipboard
- Search this
?parser
- At the end of the the try block add this
$info.append( $('<tr>').append( $('<td>').append('Copy SMILES: <a href="#" onclick="navigator.clipboard.writeText(\'' + parser.smi.split(/\s{1,}/)[0] + '\');" ><i class="fa fa-clipboard" aria-hidden="true"></i></a>')));
- The whole try and catch block should look like this
try { var parser = new SmiJs.Parser(data); if (parser.parse()) { $info.append( $('<tr>').append( $('<td>').append(parser.mf(true)))); $info.append( $('<tr>').append( $('<td>').append(parser.mw()))); $info.append( $('<tr>').append( $('<td>').append('Copy SMILES: <a href="#" onclick="navigator.clipboard.writeText(\'' + parser.smi.split(/\s{1,}/)[0] + '\');" ><i class="fa fa-clipboard" aria-hidden="true"></i></a>'))); } } catch(err) { console.log(err); }
Customize Sketcher.js
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js
Input Box Updates as User Draws
- vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.6.1-source/server-ui/src/sketcher.js
- Search for this line "var smiles = event.src.smiles();"
?var smiles = event.src.smiles();
- Add this new line below it
$('#ar_text_input').val(smiles);
Customize arthor-swagger.yaml
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
Change URL Base Path for API Call
- 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
- Search for "servers"
?basePath
- Remove "/arthor" and keep argument empty
Compile/Minify Code through NPM
- Install NPM packages and Minify Code
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server-ui npm install npx webpack-dev-server npx webpack --mode=production
- If the npx commands don't work, try updating node and npm version to the latest one.
- Build the war file
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.6.1/arthor-3.6.1-source/server mvn install -Pbootable
- 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
Adding Arthor to Systemd (example)
- Create service files
touch /etc/systemd/system/arthor.service
- Add this code block in the service file
[Unit] Description=Arthor Public Instance After=network.target [Service] Type=exec Restart=always RestartSec=3 User=root ExecStart=/usr/bin/bash /nfs/soft2/arthor_configs/start_arthor_service.sh -public ExecStop=/bin/kill -15 $MAINPID [Install] WantedBy=multi-user.target
- Change "ExecStart" to other Arthor Instances
Restarting Arthor Instance(s) Instructions
Public and Private Arthor
- ssh to "arthor" server and run
systemctl <start|stop|restart> <arthor|arthorp>
ArthorBB, ArthorCC, and ArthorCovalent
- ssh to "epyc-a40" server and run
systemctl <start|stop|restart> <arthorbb|arthorcc|arthorcovalent>
Super Private Arthor
- Ssh to machine with respective Arthor instance and become root
- execute run_arthors_on_reboot.sh to show restart all instances on the machine
bash /root/run_arthors_on_reboot.sh
- execute start_arthor_script.sh to restart specific Arthor instance. It will show you options to choose from.
bash /nfs/soft2/arthor_configs/start_arthor_script.sh