Difference between revisions of "Arthor Documentation for Future Developer"

From DISI
Jump to navigation Jump to search
 
(55 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
Arthor configurations and the frontend files are consolidated in '''/nfs/soft2/arthor_configs/arthor-3.4.2'''.
+
[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 ==
 
== How To Download Arthor ==
=== Download From Nextmove ===
+
# 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]
 
# [https://www.nextmovesoftware.com/downloads/arthor/ Download Software with this link]
 
#* Username: ucsf@nextmovesoftware.com
 
#* Username: ucsf@nextmovesoftware.com
#* Password: <Ask John or JJ>
+
#* Password: <Ask jjiteam@googlegroups.com>
# Go to releases and click the latest one
+
# Go to releases. Look for ''' smallworld-java-<version>.tar.gz ''' and copy the link address.
 
+
# Download using wget
== How To Install Arthor ==
+
#: <source> wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address> </source>
 
+
# Decompress the file
==Open port for Arthor==
+
#* <source> tar -xvf <file_name> </source>
In order for Arthor to be usable in the browser, the port you wish to run it on must be opened.
 
https://www.thegeekdiary.com/how-to-open-a-ports-in-centos-rhel-7/
 
 
 
===Step 1: Check Port Status===
 
Check that the port is not open and that Apache is not showing that port.
 
    netstat -na | grep <port number you are checking>
 
 
 
    lsof -i -P |grep http
 
 
 
===Step 2: Check Port Status in IP Tables===
 
    iptables-save | grep <port number you are checking>
 
 
 
I skipped Step 3 from the guide, because there was a lot of information in the /etc/services file and I didn't want to edit it and break something.
 
 
 
===Step 4: Open Firewall Ports===
 
I did not include the zone=public section because the stand-alone servers are usually used for private instances of Arthor and SmallWorld.
 
Run as root.
 
    firewall-cmd --add-port=<port number you are adding>/tcp --permanent
 
 
 
You need to reload the firewall after a change is made.
 
    firewall-cmd --reload
 
 
 
===Step 5: Check that port is working===
 
To check that the port is active, run.
 
    iptables -nL
 
 
 
You should see something along the lines of:
 
    ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:<port number you're adding> ctstate NEW,UNTRACKED
 
 
 
==How to run standalone Arthor instance==
 
 
 
===Step 1: Use or start a bash shell===
 
You can check your default shell using
 
    echo $SHELL
 
 
 
If your default shell is csh, use
 
    bash
 
to start a new bash shell in the current terminal window.  Note that echo $SHELL will show you your default shell regardless of the current shell.
 
 
 
===Step 2: Set your environment variables===
 
    export ARTHOR_DIR=/opt/nextmove/arthor/arthor-3.3-centos7
 
    export PATH=$ARTHOR_DIR/bin/:$PATH
 
 
 
Make sure the ARTHOR_DIR variable is set to the directory for the latest version of Arthor or whichever version you would like to test.
 
The PATH environment variable is needed if you wish to use the Arthor tools from the command line
 
 
 
===Step 3: Run the arthor-server.jar===
 
    java -jar /opt/nextmove/arthor/arthor-3.3-centos7/java/arthor.jar --httpPort <your httpPort>
 
 
 
==Setting environment variables for an Arthor Server==
 
Set the environment variables in the setenv.sh file.  Note: Be sure to edit the file in the directory corresponding to the latest version of TomCat.  As of December 2019, we are running 9.0.27 on n-1-136.
 
 
 
  vim  /opt/tomcat/apache-tomcat-9.0.27/bin/setenv.sh
 
 
 
Add the line below to the setenv.sh file above, or substitute the path to wherever you currently store the arthor.cfg file
 
  export ARTHOR_CONFIG=/usr/local/tomcat/arthor.cfg
 
  
Here is an example of the arthor.cfg file:
+
== How To Launch Arthor For The First Time ==
  BinDir=/opt/nextmove/arthor/arthor-3.3-centos7/bin
+
=== Prepare Files and Directories ===
  DataDir=/local2/arthor_local_8081/
+
# Ssh to nfs-exc and become root
  MaxConcurrentSearches=6
+
# Open a port in the firewall
  MaxThreadsPerSearch=8
+
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp
  AutomaticIndex=false
+
firewall-cmd --reload
  AsyncHitCountMax=1000000
+
</source>
  Resolver=https://sw.docking.org/util/smi2mol?smi=%s
+
# 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 ===
 
=== Configuration Details ===
 
*'''BinDir''': is the location of the Arthor command line binaries.  These are used to generate the Arthor index files and to perform searches directly on n-1-136.  An example of this would be using atdbgrep for substructure search.
 
  
 
*'''DataDir''': This is the directory where the Arthor data files live.  Location where the index files will be created and loaded from.
 
*'''DataDir''': This is the directory where the Arthor data files live.  Location where the index files will be created and loaded from.
Line 94: Line 68:
 
*'''Resolver''': Using Smallworld API, allows input box to take in a SMILE format and automatically draw on the board.
 
*'''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.
+
'''Check Arthor manual for more configuration options'''
 
 
==Background==
 
Before working with Arthor, it is recommended that you familiarize yourself with the Arthor documentation. Some useful pages to look at include 3-5, 22-25 and 33-39. Of course, reading everything would be the best!
 
  
==Checking Disk Space Usage==
+
== How to Build Arthor Databases==
Before building arthor indexes, it's always a good thing to check what percent of the memory is being used. Try to be cautious with how much memory you have left, and make sure to check while building indexes to make sure that you have enough space. To check, run the following command:
+
We can build Arthor Databases anywhere. Consolidate smiles into one directory so you can index them all one by one.
  
  df -h /<directory with disc>
+
Just use the script located at '''/nfs/home/jjg/scripts/arthor_index_script.sh''' at the directory where you c
  
==Building Large Databases==
+
Here is the content of the script:
At the moment, we are building databases of size 500M molecules by merging smile files. There are multiple methods of trying to create large databases, one being merging based off of the same H?? prefix and stopping once the database reaches > 500M molecules (or whatever upperbound you want to use). Here is some python code that simulates this merging process. Essentially the program takes all of the .smi files within an input directory, sorts them lexiographically, and begins merging these .smi files together in order until the size reaches > 500M molecules.
+
<source>
 
+
#!/bin/bash
Feel free to modify it if you think a better method exists.
 
 
 
  import subprocess
 
  import sys
 
  import os                                                                                                                                                                         
 
 
 
  from os import listdir
 
  from os.path import isfile, join
 
 
 
  mypath = "<Path to directory holding .smi files>"
 
  onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
 
  onlyfiles.sort()
 
 
 
  create_fp = True
 
  cur_mols = 0
 
  lower_bound = 500000000
 
  upper_bound = 600000000
 
  files_to_merge = []
 
 
 
  def merge_files(f_t_m):
 
      arr = f_t_m[0].split(".")
 
      arr2 = f_t_m[len(f_t_m) - 1].split(".")
 
      file_name_merge = (arr[0] + "_" + arr2[0] + ".smi")
 
      print ("File being created: " + file_name_merge)
 
 
 
      for file in f_t_m:
 
        tmp = file.split(".")
 
        process = subprocess.Popen("cat " + join(mypath, file) + " >> " + file_name_merge, shell=True)
 
        process.wait()
 
 
 
  for file in onlyfiles:
 
      arr = file.split(".")
 
 
 
      if (arr[len(arr) - 1] == "smi"):
 
        print("Working with " + file)
 
        mol = sum(1 for line in open(join(mypath, file)))
 
        print(file, mol, cur_mols)
 
 
 
        if (cur_mols + mol > lower_bound):
 
            if (cur_mols + mol < upper_bound):
 
              files_to_merge.append(file)
 
              merge_files(files_to_merge)
 
              cur_mols = 0
 
              files_to_merge.clear()
 
            else:
 
              merge_files(files_to_merge)
 
              files_to_merge.clear()
 
              files_to_merge.append(file)
 
              merge_files(files_to_merge)
 
              cur_mols = 0
 
              files_to_merge.clear()
 
        else:
 
            cur_mols += mol
 
            files_to_merge.append(file)
 
 
 
  if (len(files_to_merge) != 0):
 
      merge_files(files_to_merge)
 
  
==Building Arthor Indexes==
+
version="3.4.2"
Once you've merged the .smi files together, it's time to start building the databases themselves. To do this we use the command
 
  
  smi2atdb -j 0 -p <The .smi file> <The .atdb>
+
export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos7/
 +
export PATH=$ARTHOR_DIR/bin/:$PATH
  
The flag "-j 0" enables parallel generation and utilizes all available processors to generate the .atdb file. The "-p" flag stores the offset position in the ATDB file. Since we're building indexes for the Web Application, you must use the "-p" flag when building indexes. Please note that the name of the .smi file should also be the name of the .atdb file. That way, the Web Application knows to use these files together and correctly display the required images. Refer to pages 33-34 in the Arthor documentation for more information.
+
target="*.smi"
  
If there are too many large .smi files and you do not want to manually build each .atdb file, you can use this python script which takes all of the .smi files in the current directory and converts them to .atdb files. Make sure to modify mypath to the directory containing the .smi files. You can change the variable "create_fp" to false if you don't want to create .atdb.fp files (refer to page 9 in the Arthor documentation).
+
for j in $target
 +
do
 +
        echo 'smi2atdb -j 4 -p '$j' '${j}'.atdb'
 +
        smi2atdb -j 4 -p $j ${j}.atdb
 +
        echo 'atdb2fp -j 4 '$j'.atdb'
 +
atdb2fp -j 4 ${j}.atdb
 +
done
 +
</source>
  
  import subprocess
+
=== Command Details ===
  import sys
+
'''smi2atdb''' creates the atdb files needed for Substructure searching.
  import os
+
*'''-j''' is the amount of threads to use to index the smiles file
 
+
*'''-p''' stores the position of the original file  
  from os import listdir
+
'''atdb2fp''' makes substructure searching faster
  from os.path import isfile, join
 
 
 
  mypath = "<Path containing the .smi files"
 
  onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
 
 
 
  create_fp = True
 
 
 
  for file in onlyfiles:
 
      arr = file.split(".")
 
 
 
      if (arr[len(arr) - 1] == "smi"):
 
        process = subprocess.Popen("/nfs/ex9/work/xyz/psql/arthor-3.3-centos7/bin/smi2atdb -j 0 -p {0} {1}.atdb".format(join(mypath, file), arr[0]), shell=True)
 
        process.wait()
 
 
 
        print("SUCCESS! {0}.atdb file was created!".format(arr[0]))
 
 
 
        if (create_fp):
 
            process = subprocess.Popen("/nfs/ex9/work/xyz/psql/arthor-3.3-centos7/bin/atdb2fp -j 0 {0}.atdb".format(arr[0]), shell=True)
 
            process.wait()
 
     
 
            print("SUCCESS! {0}.atdb.fp file was created!".format(arr[0]))
 
 
 
==Uploading Indexes to the Web Application==
 
One can upload indexes to the Web Application by changing the "DATADIR" variable in the arthor.cfg file to the directory holding the .atdb files. This is already set up on n-1-136 and n-5-34.
 
 
 
==Virtual Memory==
 
In addition to modifying the arthor.cfg file, virtual memory can also be used to make queries faster. There can still be More information can be found in pages 10-16 in the Arthor Documentation.
 
  
 
==Setting up Round Table==
 
==Setting up Round Table==
This is a new feature in Arthor 3.0 and is currently beta (January 2020). See section 2.4 in the manual
+
"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.
As explained in the manual, "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.
 
 
 
Since Arthor requires CentOS 7, as of January 2020 we have 6 servers that are capable of running Arthor with Round Table.
 
 
 
 
===Setting up Host Server===
 
===Setting up Host Server===
If we want to add machines to the Round Table, for example 'nun' and 'samekh', we need to edit their arthor.cfg file so that when our Local Machine passes commands these secondary servers know to perform the search they are given.
+
# Ssh to nfs-soft2 and become root
 
+
# Open a port in the firewall
  $ cat arthor.cfg
+
#: <source>firewall-cmd --permanent --add-port=<port_number>/tcp
  MaxThreadsPerSearch=4
+
firewall-cmd --reload
  AutomaticIndex=false
+
</source>
  DATADIR=<Directory where smiles are located>
+
# Go to Arthor Config Directory
 
+
#: <source>cd /export/soft2/arthor_configs/arthor-<version></source>
We then run the jar server on each of these host machines containing data on any available port.
+
# Create Round Table Head configuration file. Here is an example:
 
+
# <source>
  java -jar /nfs/ex9/work/xyz/psql/arthor-3.3-centos7/java/arthor.jar --httpPort <port>
+
[RoundTable]
 
+
RemoteClient=http://10.20.0.41:8008
For our local machine, the arthor.cfg file will look different.
+
RemoteClient=http://10.20.5.19:8008
 
+
Resolver=https://sw.docking.org/util/smi2mol?smi=%s
  $ cat arthor.cfg
+
</source>
  [RoundTable]  
+
# Now ssh into a machine you wish to run the round table head on and become root
  RemoteClient=http://skynet:<port number where jar server is running>/
+
# Change your shell to bash if you havn't already
  RemoteClient=http://hal:<port number where jar server is running>/
+
#: <source>bash</source>
 
+
# Create a screen
Please refer to Section 2 in the RoundTable Documentation file (pages 6-8) for more useful information on configuration.
+
#: <source>screen -S <screen_name></source>
 
+
# Prepare Arthor Config Path
Then run the following command on n-1-136:
+
#: <source>export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"</source>
+
# Launch java
  java -jar /nfs/ex9/work/xyz/psql/arthor-3.3-centos7/java/arthor.jar --httpPort <port>
+
#: <source>java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number></source>
 
 
==='''***Arthor configs and frontend code are located in /nfs/exc/arthor_configs/***'''===
 
  
 +
== Active Arthor Instances ==
 
===Public Arthor===
 
===Public Arthor===
 
{| class="wikitable"
 
{| class="wikitable"
Line 246: Line 135:
 
! Port
 
! Port
 
! Round Table Data Directory
 
! Round Table Data Directory
! Active
+
! Which Arthor
 
|-
 
|-
 
| samekh
 
| samekh
 
| 10.20.0.41:8000
 
| 10.20.0.41:8000
 
| /local2/public_arthor/
 
| /local2/public_arthor/
| active
+
| Public Arthor
 
|-
 
|-
 
| nun
 
| nun
 
| 10.20.0.40:8000
 
| 10.20.0.40:8000
 
| /local2/public_arthor/
 
| /local2/public_arthor/
| active
+
| Public Arthor
|-
 
| n-9-22
 
| 10.20.9.22:8000
 
| /export/db4/public_arthor/
 
| active
 
 
|-
 
|-
 
|}
 
|}
Line 271: Line 155:
 
! Port
 
! Port
 
! Round Table Data Directory
 
! Round Table Data Directory
! Active
+
! Which Arthor
 
|-
 
|-
 
| samekh
 
| samekh
 
| 10.20.0.41:8080
 
| 10.20.0.41:8080
 
| /local2/arthor_database/
 
| /local2/arthor_database/
| active
+
| Private Arthor Round Table Head Node
 
|-
 
|-
 
| nun
 
| nun
 
| 10.20.0.40:8080
 
| 10.20.0.40:8080
 
| /local2/arthor_database/
 
| /local2/arthor_database/
| active
+
| Super Private Arthor Round Table Head Node
 
|-
 
|-
 
|}
 
|}
Line 291: Line 175:
 
! Port
 
! Port
 
! Round Table Data Directory
 
! Round Table Data Directory
!Active
+
! Which Arthor
 
|-
 
|-
 
| samekh
 
| samekh
 
| 10.20.0.41:8008
 
| 10.20.0.41:8008
 
| /local2/arthor_database/
 
| /local2/arthor_database/
| active
+
| Private Arthor Database Node
 
|-
 
|-
 
| nun
 
| nun
 
| 10.20.0.40:8008
 
| 10.20.0.40:8008
 
| /local2/arthor_database/
 
| /local2/arthor_database/
| active
+
| Super Private Arthor Database Node
 
|-
 
|-
| n-1-17
+
| nfs-exd
| 10.20.1.17:8008
+
| 10.20.1.113:8008
| /local2/arthor_database/
+
| /export/exd/arthor_database/
| not active
+
| Super Private Arthor Database Node
 
|-
 
|-
| n-5-32
+
| nfs-exh
| 10.20.5.32:8008
+
| 10.20.5.19:8008
| /local2/arthor_database/
+
| /export/exh/arthor_database/
| not active
+
| Private Arthor Database Node
|-
 
| n-5-33
 
| 10.20.5.33:8008
 
| /local2/arthor_database/
 
| not active
 
 
|-
 
|-
 
|}
 
|}
  
===Arthor Local 8081 (Datasets all local to samekh/nun)===
+
===Arthor BB and CC===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! CentOS 7 Machine
 
! CentOS 7 Machine
 
! Port
 
! Port
! Round Table Data Directory
+
! Data Directory
!Active
+
! Which Arthor
 
|-
 
|-
| samekh
+
| epyc-A40
| 10.20.0.41:8081
+
| 10.20.200.92:8081
| /local2/arthor_local_8081/
+
| /local2/arthorbb
| not active
+
| ArthorBB
 
|-
 
|-
| nun
+
| epyc-A40
| 10.20.0.40:8081
+
| 10.20.200.92:8082
| /local2/arthor_local_8081/
+
| /local2/arthorcc
| not active
+
| ArthorCC
 
|-
 
|-
 
|}
 
|}
  
== Customizing Arthor Frontend to our needs ==
+
== Customizing Arthor Frontend To Our Needs (Arthor 3.4.7) ==
The frontend Arthor code is located at '''/nfs/exc/arthor_configs/*''' and the '''*''' is based on current running version.
+
'''These instructions only worked and compiled for me in the machine called epyc which is running Rocky 8 Linux operating system.'''
=== Add Arthor Download Options ===
+
 
==== For Arthor 3.4: ====
+
Summary of changes in index.html:
1. vim .extract/webapps/ROOT/WEB-INF/static/index.html
+
*Add download options
 +
*Add contact info
 +
*Advertise TLDR
 +
*Remove buttons for Similarity and Formula
 +
 
 +
Summary of changes in index.js:
 +
*Add download options
 +
*Hyperlink the results to zinc20
  
2. search: '''arthor_tsv_link'''
+
Summary of changes in sketcher.js:
 +
*Input box should be updated as user draws molecule
  
3. in the div with the class=”dropdown-content”, add these link options and change the number accordingly:
+
Summary of changes in arthor.js:
 +
*Change default search type to be 'Substructure'
  
              <a id="arthor_tsv_link" href="#"> TSV-500</a>
+
Summary of changes in arthor-swagger.yaml.js:
              <a id="arthor_tsv_link_5000" href="#"> TSV-5,000</a>
+
*Input box should be updated as user draws molecule
              <a id="arthor_tsv_link_50000" href="#"> TSV-50,000</a>
 
              <a id="arthor_tsv_link_100000" href="#"> TSV-100,000</a>
 
              <a id="arthor_tsv_link_max" href="#"> TSV-max</a>
 
              <a id="arthor_csv_link" href="#"> CSV-500</a>
 
              <a id="arthor_csv_link_5000" href="#"> CSV-5,000</a>
 
              <a id="arthor_csv_link_50000" href="#"> CSV-50,000</a>
 
              <a id="arthor_csv_link_100000" href="#"> CSV-100,000</a>
 
              <a id="arthor_csv_link_max" href="#"> CSV-max</a>
 
              <a id="arthor_sdf_link" href="#"> SDF-500</a>
 
              <a id="arthor_sdf_link_5000" href="#"> SDF-5,000</a>
 
              <a id="arthor_sdf_link_50000" href="#"> SDF-50,000</a>
 
              <a id="arthor_sdf_link_100000" href="#"> SDF-100,000</a>
 
              <a id="arthor_sdf_link_max" href="#"> SDF-max</a>
 
  
4. then vim .extract/webapps/ROOT/WEB-INF/static/js/index.js
 
  
5. search: '''function $(t){'''
+
=== 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.4.7-source.tar.gz
 +
#* arthor-3.4.7-centos7.tar.gz
 +
# Extract contents from the tar.gz files
 +
#* <source>tar -xvf arthor-3.4.7-source.tar.gz
 +
tar -xvf arthor-3.4.7-centos7.tar.gz</source>
 +
# Install Apache Maven Arthor dependencies through this script
 +
#* <source>
 +
#!/bin/bash
  
6. in the function $(t), add these lines:
+
export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-centos7/java
 +
export OS=linux
 +
export VERSION=3.4.7
  
if(document.getElementById("arthor_tsv_link")) {
+
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni-${OS}.jar \
        var e=i.a.param({query:s.b.query,type:s.b.type,draw:0,start:0,length:t,flags:s.b.flags}),n=s.b.url+"/dt/"+E(s.b.table)+"/search";i()("#arthor_sdf_link").attr("href",n+".sdf?"+e),i() ("#arthor_tsv_link").attr("href",n+".tsv?"+e),i()("#arthor_csv_link").attr("href",n+".csv?"+e)
+
                        -Dpackaging=jar \
}
+
                        -DgeneratePom=true \
if (document.getElementById("arthor_tsv_link_5000")) {
+
                        -DartifactId=arthor-jni-${OS} \
        var e=i.a.param({query:s.b.query,type:s.b.type,draw:0,start:0,length:5000,flags:s.b.flags}),n=s.b.url+"/dt/"+E(s.b.table)+"/search";i()("#arthor_sdf_link_5000").attr("href",n+".sdf?"+e),i()("#arthor_tsv_link_5000").attr("href",n+".tsv?"+e),i()("#arthor_csv_link_5000").attr("href",n+".csv?"+e)
+
                        -DgroupId=com.nextmovesoftware.arthor \
}
+
                        -Dversion=$VERSION
if (document.getElementById("arthor_tsv_link_50000")) {
+
mvn install:install-file -Dfile=$ARTHOR_DIR/arthor-jni.jar \
        var e=i.a.param({query:s.b.query,type:s.b.type,draw:0,start:0,length:50000,flags:s.b.flags}),n=s.b.url+"/dt/"+E(s.b.table)+"/search";i()("#arthor_sdf_link_50000").attr("href",n+".sdf?"+e),i()("#arthor_tsv_link_50000").attr("href",n+".tsv?"+e),i()("#arthor_csv_link_50000").attr("href",n+".csv?"+e)
+
                        -Dpackaging=jar \
}
+
                        -DgeneratePom=true \
if (document.getElementById("arthor_tsv_link_100000")) {
+
                        -DartifactId=arthor-jni \
        var e=i.a.param({query:s.b.query,type:s.b.type,draw:0,start:0,length:100000,flags:s.b.flags}),n=s.b.url+"/dt/"+E(s.b.table)+"/search";i()("#arthor_sdf_link_100000").attr("href",n+".sdf?"+e),i()("#arthor_tsv_link_100000").attr("href",n+".tsv?"+e),i()("#arthor_csv_link_100000").attr("href",n+".csv?"+e)
+
                        -DgroupId=com.nextmovesoftware.arthor \
}
+
                        -Dversion=$VERSION
if (document.getElementById("arthor_tsv_link_max")) {
+
</source>
        var e=i.a.param({query:s.b.query,type:s.b.type,draw:0,start:0,length:1000000000,flags:s.b.flags}),n=s.b.url+"/dt/"+E(s.b.table)+"/search";i()("#arthor_sdf_link_max").attr("href",n+".sdf?"+e),i()("#arthor_tsv_link_max").attr("href",n+".tsv?"+e),i()("#arthor_csv_link_max").attr("href",n+".csv?"+e)
+
=== Customizing Index.html ===
}
+
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
  
=== Take out Similarity Button ===
+
==== Change download options ====
vim .extract/webapps/ROOT/WEB-INF/static/index.html
+
# 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
search: '''Similarity'''
+
# Search for 'arthor_tsv_link'
Comment out this line '''< li value="Similarity" onclick="setSearchType(this)" class="first"> Similarity </li >''' //added spaces at the beginning and end so prevent wiki from converting it
+
#* <source>?arthor_tsv_link</source>
Then add "first" in Substructure's class
+
# Delete original download links
=== Hyperlink to zinc20 ===
+
#*<source>
vim .extract/webapps/ROOT/WEB-INF/static/js/index.js
+
              <a id="arthor_tsv_link" href="#"> TSV</a>
search: '''table_name'''
+
              <a id="arthor_csv_link" href="#"> CSV</a>
*find this line "< b>" + d + "< /b>"
+
              <a id="arthor_sdf_link" href="#"> SDF</a>
*replace with '''"< b><a target='_blank' href='https://zinc20.docking.org/substances/"+d+"'>" + d + "</a></b >"''' //added spaces at the beginning and end so prevent wiki from converting it
+
</source>
 +
# Add new download link options
 +
#* <source>
 +
              <a id="arthor_tsv_link_100" href="#"> TSV-100</a>
 +
              <a id="arthor_tsv_link_1k" href="#"> TSV-1,000</a>
 +
              <a id="arthor_tsv_link_10k" href="#"> TSV-10,000</a>
 +
              <a id="arthor_tsv_link_100k" href="#"> TSV-100,000</a>
 +
              <a id="arthor_tsv_link_200k" href="#"> TSV-200,000</a>
 +
              <a id="arthor_tsv_link_300k" href="#"> TSV-300,000</a>
 +
              <a id="arthor_csv_link_100" href="#"> CSV-100</a>
 +
              <a id="arthor_csv_link_1k" href="#"> CSV-1,000</a>
 +
              <a id="arthor_csv_link_10k" href="#"> CSV-10,000</a>
 +
              <a id="arthor_csv_link_100k" href="#"> CSV-100,000</a>
 +
              <a id="arthor_csv_link_200k" href="#"> CSV-200,000</a>
 +
              <a id="arthor_csv_link_300k" href="#"> CSV-300,000</a>
 +
              <a id="arthor_sdf_link_100" href="#"> SDF-100</a>
 +
              <a id="arthor_sdf_link_1k" href="#"> SDF-1,000</a>
 +
              <a id="arthor_sdf_link_10k" href="#"> SDF-10,000</a>
 +
              <a id="arthor_sdf_link_100k" href="#"> SDF-100,000</a>
 +
              <a id="arthor_sdf_link_200k" href="#"> SDF-200,000</a>
 +
              <a id="arthor_sdf_link_300k" href="#"> SDF-300,000</a>
 +
</source>
  
=== Make Input Box Work ===
+
==== Add contact info and tldr ====
At the end of the Arthor config file add this:
+
# 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
    Resolver=https://sw.docking.org/util/smi2mol?smi=%s
+
# Search for 'arthor_table_list'
To copy smiles in the input box:
+
#* <source>?arthor_table_list</source>
    vim .extract/webapps/ROOT/WEB-INF/static/js/index.js
+
# 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
    search this: “var e=t.src.smiles()
+
#* <source>
    add this after the semi-colon
+
      <div class="opt-box-border">
        document.getElementById("ar_text_input").value = e;
+
        <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>
 +
</source>
 +
==== Remove Similarity and Formula Buttons ====
 +
# 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
 +
# Search for 'arthor_search_list'
 +
#* ?arthor_search_list
 +
# Delete and Replace the whole 'ul' element block with this
 +
#* <source>
 +
        <ul id="arthor_search_list">
 +
          <li class="first" value="Substructure" onclick="setSearchType(this)">
 +
            Substructure
 +
          </li><li value="SMARTS" onclick="setSearchType(this)" class="last">
 +
            SMARTS
 +
          </li>
 +
        </ul>
 +
</source>
  
== Restarting Arthor Instance(s) Instructions ==
+
=== Customize Index.js ===
Public, Private, and SuperPrivate Arthors are all started the same way.
+
Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js
 +
 
 +
==== Add download option logic ====
 +
# vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js
 +
# Comment out these lines of code
 +
#* <source>
 +
            if (setDownloadLinks)
 +
              setDownloadLinks(hist_limit);
 +
</source>
 +
#* <source>
 +
                        let limit = arthor.config.WebApp.DefaultDownloadLimit;
 +
                        if (!limit)
 +
                          limit = 500;
 +
</source>
 +
# Search for 'setDownloadLinks(limit)', both the function call and the function call argument, and remove the argument 'limit'.
 +
#* <source>?setDownloadLinks(limit)</source>
 +
# As for the function, add all the logic for the download sizes
 +
#* <source>
 +
function setDownloadLinks() {
 +
  //100 Download Size
 +
  var limit = 100;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_100').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_100').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_100').attr('href', base_url + '?fmt=csv&' + params);
 +
 
 +
  //1k Download Size
 +
  var limit = 1000;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_1k').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_1k').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_1k').attr('href', base_url + '?fmt=csv&' + params);
 +
  //10k Download Size
 +
  var limit = 10000;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_10k').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_10k').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_10k').attr('href', base_url + '?fmt=csv&' + params);
 +
 
 +
  //100k Download Size
 +
  var limit = 100000;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_100k').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_100k').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_100k').attr('href', base_url + '?fmt=csv&' + params);
 +
 
 +
  //200k Download Size
 +
  var limit = 200000;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_200k').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_200k').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_200k').attr('href', base_url + '?fmt=csv&' + params);
 +
  //300k Download Size
 +
  var limit = 300000;
 +
  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link_300k').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link_300k').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link_300k').attr('href', base_url + '?fmt=csv&' + params);
 +
 
 +
/*  var params = $.param({
 +
                query:  arthor.query,
 +
                type:  arthor.type,
 +
                draw:  0,
 +
                start:  0,
 +
                length: limit,
 +
                flags:  arthor.flags
 +
              });
 +
  var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
 +
  $('#arthor_sdf_link').attr('href', base_url + '?fmt=sdf&' + params);
 +
  $('#arthor_tsv_link').attr('href', base_url + '?fmt=tsv&' + params);
 +
  $('#arthor_csv_link').attr('href', base_url + '?fmt=csv&' + params);
 +
*/
 +
}
 +
</source>
 +
# Lastly, add the zinc20 hyperlink to the Arthor results. Search for this
 +
#* <source>"<b>" + id + "</b>"</source>
 +
# Delete that whole line and replace it with this
 +
#* <source>$('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",</source>
 +
 
 +
=== Customize Sketcher.js ===
 +
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js
 +
 
 +
==== Input Box Updates as User Draws ====
 +
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-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.js ===
 +
Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js
  
Public Arthor lives and runs on both '''samekh''' and '''nun'''.
+
==== Make Substructure Default Search Type ====
 +
#vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js
 +
#Search for "let DEFAULT_SEARCH_TYPE"
 +
#* <source>?let DEFAULT_SEARCH_TYPE</source>
 +
#Change parameter to "Substructure"
  
Private Arthor lives and runs on '''samekh'''.
+
=== Customize arthor-swagger.yaml ===
 +
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
  
Super Private Arthor lives and runs on '''nun'''.
+
==== Change URL Base Path for API Call ====
 +
# 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
 +
# Search for "basePath"
 +
#* <source>?basePath</source>
 +
# Remove "/arthor" and keep argument empty
  
=== Instructions ===
+
=== Compile/Minify Code through NPM ===
* To start an instance
+
# Install NPM packages and Minify Code
# ssh into appropriate machine
+
#* <source>
# become root
+
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui
# cat run_arthors_on_reboot.sh
+
npm install
# copy and run screen command
+
npx webpack-dev-server
#* Public Arthor only needs one line.
+
npx webpack --mode=production
#** /usr/bin/screen -dmS public_arthor /root/screen_public_arthor.sh
+
</source>
#* Private and Super Private needs two lines.
+
# Build the war file
#** /usr/bin/screen -dmS private_arthor /root/screen_private_arthor.sh
+
#* <source>
#** /usr/bin/screen -dmS private_arthor_rt_head /root/screen_private_round_table_head.sh
+
cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-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
  
* To stop an instance
+
== Restarting Arthor Instance(s) Instructions ==
# ssh into appropriate machine
+
# Ssh to machine with respective Arthor instance and become root
# become root
+
# execute '''run_arthors_on_reboot.sh''' to show restart all instances on the machine
# One Way
+
#: <source>
#* screen -ls
+
bash /root/run_arthors_on_reboot.sh
#* screen -r <instance_screen_name or instance_screen_number>
+
</source>
#* ctrl + C
+
# execute '''start_arthor_script.sh''' to restart specific Arthor instance. It will show you options to choose from.
# Second Way
+
#: <source>
#* screen -ls, find instance name or number
+
bash /nfs/soft2/arthor_configs/start_arthor_script.sh
#* screen -X -S <instance_screen_name or instance_screen_number> kill
+
</source>
#* screen -ls, to double check
 

Latest revision as of 02:01, 2 December 2022

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

  1. Ssh to nfs-soft2 and become root. Prepare directory
     mkdir /export/soft2/arthor_configs/arthor-<version> && cd /export/soft2/arthor_configs/arthor-<version>
  2. Download Software with this link
    • Username: ucsf@nextmovesoftware.com
    • Password: <Ask jjiteam@googlegroups.com>
  3. Go to releases. Look for smallworld-java-<version>.tar.gz and copy the link address.
  4. Download using wget
     wget --user ucsf@nextmovesoftware.com --password <Ask jjiteam@googlegroups.com> <link address>
  5. Decompress the file
    •  tar -xvf <file_name>

How To Launch Arthor For The First Time

Prepare Files and Directories

  1. Ssh to nfs-exc and become root
  2. Open a port in the firewall
    firewall-cmd --permanent --add-port=<port_number>/tcp 
    firewall-cmd --reload
  3. Go to Arthor Config directory
    cd /export/soft2/arthor_configs/arthor-<latest_version>
  4. 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

  1. Now ssh into a machine you wish to run an Arthor instance on and become root
  2. Change your shell to bash if you havn't already
    bash
  3. Create a screen
    screen -S <screen_name>
  4. Prepare Arthor Config Path
    export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<name_of_config_file>.cfg"
  5. 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 c

Here is the content of the script:

#!/bin/bash

version="3.4.2"

export ARTHOR_DIR=/nfs/soft2/arthor_configs/arthor-$version/arthor-$version-centos7/
export PATH=$ARTHOR_DIR/bin/:$PATH

target="*.smi"

for j in $target
do
        echo 'smi2atdb -j 4 -p '$j' '${j}'.atdb'
        smi2atdb -j 4 -p $j ${j}.atdb
        echo 'atdb2fp -j 4 '$j'.atdb'
	atdb2fp -j 4 ${j}.atdb
done

Command Details

smi2atdb creates the atdb files needed for Substructure searching.

  • -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

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

  1. Ssh to nfs-soft2 and become root
  2. Open a port in the firewall
    firewall-cmd --permanent --add-port=<port_number>/tcp 
    firewall-cmd --reload
  3. Go to Arthor Config Directory
    cd /export/soft2/arthor_configs/arthor-<version>
  4. Create Round Table Head configuration file. Here is an example:
  5. [RoundTable]
    RemoteClient=http://10.20.0.41:8008
    RemoteClient=http://10.20.5.19:8008
    Resolver=https://sw.docking.org/util/smi2mol?smi=%s
  6. Now ssh into a machine you wish to run the round table head on and become root
  7. Change your shell to bash if you havn't already
    bash
  8. Create a screen
    screen -S <screen_name>
  9. Prepare Arthor Config Path
    export ARTHOR_CONFIG="/nfs/soft2/arthor_configs/arthor-<version>/<round_table_head>.cfg"
  10. Launch java
    java -jar /nfs/soft2/arthor_configs/arthor-<version>/arthor-<version>-centos7/java/arthor.jar --httpPort=<port_number>

Active Arthor Instances

Public Arthor

CentOS 7 Machine Port Round Table Data Directory Which Arthor
samekh 10.20.0.41:8000 /local2/public_arthor/ Public Arthor
nun 10.20.0.40:8000 /local2/public_arthor/ Public Arthor

Arthor Round Table Head

CentOS 7 Machine Port Round Table Data Directory Which Arthor
samekh 10.20.0.41:8080 /local2/arthor_database/ Private Arthor Round Table Head Node
nun 10.20.0.40:8080 /local2/arthor_database/ Super Private Arthor Round Table Head Node

Arthor Round Table Nodes

CentOS 7 Machine Port Round Table Data Directory Which Arthor
samekh 10.20.0.41:8008 /local2/arthor_database/ Private Arthor Database Node
nun 10.20.0.40:8008 /local2/arthor_database/ Super Private Arthor Database Node
nfs-exd 10.20.1.113:8008 /export/exd/arthor_database/ Super Private Arthor Database Node
nfs-exh 10.20.5.19:8008 /export/exh/arthor_database/ 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.4.7)

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 download options
  • Add contact info
  • Advertise TLDR
  • Remove buttons for Similarity and Formula

Summary of changes in index.js:

  • Add download options
  • 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.js:

  • Change default search type to be 'Substructure'

Summary of changes in arthor-swagger.yaml.js:

  • Input box should be updated as user draws molecule


Install Prerequisite Packages

  1. Install Apache Maven
    • dnf install maven -y
  2. Install Node Package Manager (NPM)
    • dnf install npm -y
  3. 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
  4. Download these latest Arthors and store them in 'arthor_build_from_source/'. Here's how to download Arthor.
    • arthor-3.4.7-source.tar.gz
    • arthor-3.4.7-centos7.tar.gz
  5. Extract contents from the tar.gz files
    • tar -xvf arthor-3.4.7-source.tar.gz
      tar -xvf arthor-3.4.7-centos7.tar.gz
  6. Install Apache Maven Arthor dependencies through this script
    • #!/bin/bash
      
      export ARTHOR_DIR=/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-centos7/java
      export OS=linux
      export VERSION=3.4.7
      
      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.4.7/arthor-3.4.7-source/server/src/main/webapp/WEB-INF/static/index.html

Change download options

  1. 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
  2. Search for 'arthor_tsv_link'
    • ?arthor_tsv_link
  3. Delete original download links
    •               <a id="arthor_tsv_link" href="#"> TSV</a>
                    <a id="arthor_csv_link" href="#"> CSV</a>
                    <a id="arthor_sdf_link" href="#"> SDF</a>
  4. Add new download link options
    •               <a id="arthor_tsv_link_100" href="#"> TSV-100</a>
                    <a id="arthor_tsv_link_1k" href="#"> TSV-1,000</a>
                    <a id="arthor_tsv_link_10k" href="#"> TSV-10,000</a>
                    <a id="arthor_tsv_link_100k" href="#"> TSV-100,000</a>
                    <a id="arthor_tsv_link_200k" href="#"> TSV-200,000</a>
                    <a id="arthor_tsv_link_300k" href="#"> TSV-300,000</a>
                    <a id="arthor_csv_link_100" href="#"> CSV-100</a>
                    <a id="arthor_csv_link_1k" href="#"> CSV-1,000</a>
                    <a id="arthor_csv_link_10k" href="#"> CSV-10,000</a>
                    <a id="arthor_csv_link_100k" href="#"> CSV-100,000</a>
                    <a id="arthor_csv_link_200k" href="#"> CSV-200,000</a>
                    <a id="arthor_csv_link_300k" href="#"> CSV-300,000</a>
                    <a id="arthor_sdf_link_100" href="#"> SDF-100</a>
                    <a id="arthor_sdf_link_1k" href="#"> SDF-1,000</a>
                    <a id="arthor_sdf_link_10k" href="#"> SDF-10,000</a>
                    <a id="arthor_sdf_link_100k" href="#"> SDF-100,000</a>
                    <a id="arthor_sdf_link_200k" href="#"> SDF-200,000</a>
                    <a id="arthor_sdf_link_300k" href="#"> SDF-300,000</a>

Add contact info and tldr

  1. 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
  2. Search for 'arthor_table_list'
    • ?arthor_table_list
  3. 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
    •       <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>

Remove Similarity and Formula Buttons

  1. 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
  2. Search for 'arthor_search_list'
    • ?arthor_search_list
  3. Delete and Replace the whole 'ul' element block with this
    •         <ul id="arthor_search_list">
                <li class="first" value="Substructure" onclick="setSearchType(this)">
                  Substructure
                </li><li value="SMARTS" onclick="setSearchType(this)" class="last">
                  SMARTS
                </li>
              </ul>

Customize Index.js

Location /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js

Add download option logic

  1. vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/index.js
  2. Comment out these lines of code
    •              if (setDownloadLinks)
                     setDownloadLinks(hist_limit);
    •                          let limit = arthor.config.WebApp.DefaultDownloadLimit;
                               if (!limit)
                                 limit = 500;
  3. Search for 'setDownloadLinks(limit)', both the function call and the function call argument, and remove the argument 'limit'.
    • ?setDownloadLinks(limit)
  4. As for the function, add all the logic for the download sizes
    • function setDownloadLinks() {
        //100 Download Size
        var limit = 100;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_100').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_100').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_100').attr('href', base_url + '?fmt=csv&' + params);
      
        //1k Download Size
        var limit = 1000;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_1k').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_1k').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_1k').attr('href', base_url + '?fmt=csv&' + params);
        //10k Download Size
        var limit = 10000;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_10k').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_10k').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_10k').attr('href', base_url + '?fmt=csv&' + params);
      
        //100k Download Size
        var limit = 100000;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_100k').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_100k').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_100k').attr('href', base_url + '?fmt=csv&' + params);
      
        //200k Download Size
        var limit = 200000;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_200k').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_200k').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_200k').attr('href', base_url + '?fmt=csv&' + params);
        //300k Download Size
        var limit = 300000;
        var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link_300k').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link_300k').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link_300k').attr('href', base_url + '?fmt=csv&' + params);
      
      /*  var params = $.param({
                      query:  arthor.query,
                      type:   arthor.type,
                      draw:   0,
                      start:  0,
                      length: limit,
                      flags:  arthor.flags
                     });
        var base_url = arthor.url + '/dt/' + normTableNames(arthor.table) + '/search';
        $('#arthor_sdf_link').attr('href', base_url + '?fmt=sdf&' + params);
        $('#arthor_tsv_link').attr('href', base_url + '?fmt=tsv&' + params);
        $('#arthor_csv_link').attr('href', base_url + '?fmt=csv&' + params);
      */
      }
  5. Lastly, add the zinc20 hyperlink to the Arthor results. Search for this
    • "<b>" + id + "</b>"
  6. Delete that whole line and replace it with this
    • $('<td>').append("<b><a target='_blank' href='https://zinc20.docking.org/substances/"+id+"'>" + id + "</a></b>",

Customize Sketcher.js

Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js

Input Box Updates as User Draws

  1. vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7-source/server-ui/src/sketcher.js
  2. Search for this line "var smiles = event.src.smiles();"
    • ?var smiles = event.src.smiles();
  3. Add this new line below it
    • $('#ar_text_input').val(smiles);

Customize Arthor.js

Location: /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js

Make Substructure Default Search Type

  1. vim /mnt/nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui/src/arthor.js
  2. Search for "let DEFAULT_SEARCH_TYPE"
    • ?let DEFAULT_SEARCH_TYPE
  3. Change parameter to "Substructure"

Customize arthor-swagger.yaml

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

Change URL Base Path for API Call

  1. 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
  2. Search for "basePath"
    • ?basePath
  3. Remove "/arthor" and keep argument empty

Compile/Minify Code through NPM

  1. Install NPM packages and Minify Code
    • cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server-ui
      npm install
      npx webpack-dev-server
      npx webpack --mode=production
  2. Build the war file
    • cd /nfs/home/jjg/arthor_build_from_source/arthor-3.4.7/arthor-3.4.7-source/server
      mvn install -Pbootable
  3. 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

Restarting Arthor Instance(s) Instructions

  1. Ssh to machine with respective Arthor instance and become root
  2. execute run_arthors_on_reboot.sh to show restart all instances on the machine
    bash /root/run_arthors_on_reboot.sh
  3. 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