SmallWorld Documentation for Future Developer: Difference between revisions
Jgutierrez6 (talk | contribs) |
Jgutierrez6 (talk | contribs) No edit summary |
||
Line 23: | Line 23: | ||
== How to Launch Smallworld For The First Time == | == How to Launch Smallworld For The First Time == | ||
=== Prepare Files and Directories === | |||
# Ssh to abacus and become root | # Ssh to abacus and become root | ||
# Open a port in the firewall | # Open a port in the firewall | ||
Line 36: | Line 37: | ||
#: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source> | #: <source>ln -s /export/db2/smallworld_anon_21Q4 anon</source> | ||
#* a sub-directory called maps to store databases | #* a sub-directory called maps to store databases | ||
#: | #: <source>mkdir maps</source> | ||
#* a smallworld config file | #* a smallworld config file | ||
#: <source>vim smallworld.cfg</source> | |||
#* Add this block of code inside the config file | |||
#: <source> | |||
[WebApp] | |||
DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m | |||
ResolverUrl=./util/smi2mol?smi=%s | |||
SearchTimeOut=5000 | |||
SearchAsYouDraw=true | |||
[Score] | |||
Name=Atom Alignment | |||
Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB | |||
Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment | |||
EnabledByDefault=false | |||
MappingMode=EditMap | |||
[Score] | |||
Name=SMARTS Alignment | |||
Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input | |||
Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment | |||
EnabledByDefault=false | |||
[Score] | |||
Name=ECFP4 | |||
Description=Extended Connectivity Circular Fingerprint | |||
Class=com.nmsoftware.smallworld.score.EcfpTanimoto | |||
Radius=2 | |||
EnabledByDefault=true | |||
[Score] | |||
Name=Daylight | |||
Description=Path based fingerprint | |||
Class=com.nmsoftware.smallworld.score.DaylightTanimoto | |||
EnabledByDefault=true | |||
</source> | |||
#* '''SearchTimeOut''' should be the only option you'll change in the future. It caps search time to lessen strain on machine. | |||
#Place any *.anon.maps you've already compiled for testing into the maps sub-directory. | |||
=== Start Smallworld Instance === | |||
# Go to smallworld extract directory | |||
#: <source>cd /export/db3/smallworld_extract</source> | |||
# Create a screen | |||
#: <source>screen -S <screen_name></source> | |||
# Export the smallworld directory you've made | |||
#: <source>export SWDIR=/export/db3/<smallworld_dir></source> | |||
# Launch java | |||
#: <source>java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number></source> | |||
==Install and Set Up on TomCat on CentOS 6 (such as n-9-22)== | ==Install and Set Up on TomCat on CentOS 6 (such as n-9-22)== |
Revision as of 00:47, 29 January 2022
Introduction
Here is the link to Smallworld's manual
- Username: ucsf@nextmovesoftware.com
- Password: <Ask jjiteam@googlegroups.com>
All smallworld databases live in abacus' db3.
Smallworld frontend files are consolidated and located at /export/db3/smallworld_extract/.extract.
Execute command start_smallworld to see options on which smallworld instance to start/restart.
How to Download Smallworld
- Ssh to abacus and become root. Prepare directory
mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<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 Smallworld For The First Time
Prepare Files and Directories
- Ssh to abacus and become root
- Open a port in the firewall
firewall-cmd --permanent --add-port=<port_number>/tcp firewall-cmd --reload
- Go to smallworld databases directory
cd /export/db3/
- Create a Smallworld directory and go to it
mkdir <smallworld_dir> && cd <smallworld_dir>
- Inside that directory, create these
- a symbolic link to the smallworld anon map
ln -s /export/db2/smallworld_anon_21Q4 anon
- a sub-directory called maps to store databases
mkdir maps
- a smallworld config file
vim smallworld.cfg
- Add this block of code inside the config file
[WebApp] DepictionUrl=./depict/svg?w=%w&h=%h&smi=%s&qry=%q&cols=%c&cmap=%m ResolverUrl=./util/smi2mol?smi=%s SearchTimeOut=5000 SearchAsYouDraw=true [Score] Name=Atom Alignment Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB Class=com.nmsoftware.smallworld.score.SimpleAtomAlignment EnabledByDefault=false MappingMode=EditMap [Score] Name=SMARTS Alignment Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input Class=com.nmsoftware.smallworld.score.SmartsAtomAlignment EnabledByDefault=false [Score] Name=ECFP4 Description=Extended Connectivity Circular Fingerprint Class=com.nmsoftware.smallworld.score.EcfpTanimoto Radius=2 EnabledByDefault=true [Score] Name=Daylight Description=Path based fingerprint Class=com.nmsoftware.smallworld.score.DaylightTanimoto EnabledByDefault=true
- SearchTimeOut should be the only option you'll change in the future. It caps search time to lessen strain on machine.
- Place any *.anon.maps you've already compiled for testing into the maps sub-directory.
Start Smallworld Instance
- Go to smallworld extract directory
cd /export/db3/smallworld_extract
- Create a screen
screen -S <screen_name>
- Export the smallworld directory you've made
export SWDIR=/export/db3/<smallworld_dir>
- Launch java
java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number>
Install and Set Up on TomCat on CentOS 6 (such as n-9-22)
Step 1: Check the CentOS version and Java version
SmallWorld currently runs on n-9-22, which runs CentOS 6.10. You can check the version of CentOS with the following command:
cat /etc/centos-release
Check your current version of Java with the following command:
java -version
If you do not have the correct version, install it using yum. Follow the steps on this tutorial https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos-6.html
Step 2: Create Tomcat Service Account
This must be done as a root user and has already been done for n-9-22.
groupadd tomcat mkdir /opt/tomcat useradd -g tomcat -d /opt/tomcat tomcat
Step 3: Create Initialization Script to Control Apache TomCat
Download the latest version of Apache TomCat from the website https://tomcat.apache.org/download-90.cgi
vi /etc/init.d/tomcat9
Copy the bash script from here https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-tomcat-7-0-on-rhel-6-centos-6.html
How to Restart the TomCat Server
service tomcat9 restart
How to Restart the SmallWorld WebApp
You do not need to restart Tomcat every time you want to restart SmallWorld. The TomCat GUI is available at
You need the tunnel to access the private network or this link will not work! Also, the admin username and password is required.
http://10.20.9.22:8080/
For more information about TomCat, consult the documentation for the version installed (9.0.17 as of June 2019)
http://10.20.9.22:8080/docs/
In the Manager App, in the Applications section, use the Stop and Start buttons for the sw-ws app to restart the SmallWorld server
Set Environment Variable for Anonymous Graphs for TomCat
The file to modify is
opt/tomcat/bin/catalina.sh
Add the following command to the top of the file (below the comments at the top_
export SWDIR=/srv/db4
Modifying the Amount of Memory Allocated to SmallWorld
The memory allocated to TomCat is found in
/opt/tomcat/bin/catalina.sh
Add the following commands to the top of the file (below the comments at the top)
export CATALINA_OPTS="$CATALINA_OPTS -Xms80g" export CATALINA_OPTS="$CATALINA_OPTS -Xmx80g" export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=70g"
Modifying the SmallWorld GUI
The files for the SmallWorld WebApp live in
/opt/tomcat/webapps/sw-ws
Edit the files in
/opt/tomcat/webapps/sw-ws/WEB-INF
To add the link to go to ZINC from the SmallWorld results page, edit the swsearch.js JavaScript file
/opt/tomcat/webapps/sw-ws/WEB-INF/static/swsearch.js
Creating Maps on SmallWorld
See the corresponding wiki page: http://wiki.docking.org/index.php/Creating_Maps_on_SmallWorld
Running SmallWorld from the Command Line
We have been running SmallWorld on n-9-22 as www which uses csh as the default shell. There is a file in /mnt/nfs/soft/www/home/smallworld called run_sw which contains the following commands to set up the SmallWorld Command Line Interface (CLI)
Set the SWDIR environment variable so SmallWorld scripts can access the 12 TB index
setenv SWDIR /srv/db4
Set the path to the SmallWorld C++ Executables
set path = ($path /opt/nextmove/bin)
Alias the keyword "sw" to access the Java CLI
alias sw 'java -jar /opt/nextmove/sw.jar'
Tips for Running SmallWorld on the Command Line
Use sw help to get information about available commands
sw help