SmallWorld Documentation for Future Developer

Jump to navigation Jump to search


Here is the link to Smallworld's manual

  • Username:
  • Password: <Ask>

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

  1. Ssh to abacus and become root. Prepare directory
     mkdir /opt/nextmove/smallworld-<version> && cd /opt/nextmove/smallworld-<version>
  2. Download Software with this link
    • Username:
    • Password: <Ask>
  3. Go to releases. Look for smallworld-java-<version>.tar.gz and copy the link address.
  4. Download using wget
     wget --user --password <Ask> <link address>
  5. Decompress the file
    •  tar -xvf <file_name>

How to Launch Smallworld For The First Time

Prepare Files and Directories

  1. Ssh to abacus and become root
  2. Open a port in the firewall
    firewall-cmd --permanent --add-port=<port_number>/tcp 
    firewall-cmd --reload
  3. Go to smallworld databases directory
    cd /export/db3/
  4. Create a Smallworld directory and go to it
    mkdir <smallworld_dir> && cd <smallworld_dir>
  5. 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
    Name=Atom Alignment
    Description=Aligns and scores each hit relative to the query atom types, differences are categorised as MAJ, MIN, HYB, SUB 
    Name=SMARTS Alignment
    Description=Treat input as SMARTS and align and score each hit relative to the query atom expressions in the input 
    Description=Extended Connectivity Circular Fingerprint
    Description=Path based fingerprint
    • SearchTimeOut should be the only option you'll change in the future. It caps search time to lessen strain on machine.
  6. Place any *.anon.maps you've already compiled for testing into the maps sub-directory.

Start Smallworld Instance

  1. Go to smallworld extract directory
    cd /export/db3/smallworld_extract
  2. Create a screen
    screen -S <screen_name>
  3. Export the smallworld directory you've made
    export SWDIR=/export/db3/<smallworld_dir>
  4. Launch java
    java -jar /opt/nextmove/smallworld-<version>/sw-ws-<version>.jar --httpPort=<port_number>

How to Build Smallworld Maps/Databases

Consolidate smiles into /export/db3/temp_mapping.

Use the script located in that directory called smallworld_map_script.

Here is the content of the script:

#!/bin/csh -f
setenv SWDIR /export/db3/public_smallworld_4th_gen/

alias sw 'time java -jar /opt/nextmove/smallworld-5.1/sw.jar'

set target = '*.smi'

foreach i ($target)
	echo '(sw map' $i '-T tmp/ -o '${i}' -u '${i}'.anon.unmapped) |& tee '${i}'_log'
	(sw map $i -T tmp/ -o ${i} -u ${i}.anon.unmapped) |& tee ${i}_log
	echo 'sw blm -p 0.01 '${i}''
	sw blm -p 0.01 ${i}

Command Details

setenv sets the environment where the anon master map is

java -jar /opt/nextmove/smallworld-5.1/sw.jar shortened to sw via alias

map will map the smiles based on the current anon master map.

  • -T stores temp files so /tmp does not get overloaded
  • -o output with custom name you like
  • -u will collect the unmapped molecules to send to Nextmove or to use swextend

tee will log the progress of the process

Splitting Databases

[Follow this page if John has asked you to split the database into smaller slices.]

Active Smallworld Instances

Caption text
Type URL Machine:Port Directory
Public /nfs/db3/public_smallworld_4th_gen
Private /nfs/db3/private_smallworld_4th_gen
Super Private /nfs/db3/super_private_smallworld_4th_gen

Customize Smallworld FrontEnd

Hyperlink Results to ZINC20

  1. Open swsearch.js
    vim /export/db3/smallworld_extract/.extract/webapps/ROOT/WEB-INF/static/js/swsearch.js
  2. Search this:
    ?div.append("<b><a target='_blank' href='" + href + "'>" + id + "</a></b>");
  3. On the else statement replace the line with this
    div.append("<b><a target='_blank' href='"+id+"'>" + id + "</a></b>");

Add 'Ask Questions' On Smallworld

  1. Open search.html
    vim /export/db3/smallworld_extract/.extract/webapps/ROOT/WEB-INF/static/search.html
  2. Search 'Scoring Methods'
    ?Scoring Methods
  3. At the end of that big block of 'div', add this:
    <div class="section-head">
            Ask Questions
            <table class="swopt searchasyoudraw" style="width: 100%">
                    <th style="text-align: left">Email us:</th>

Restarting Smallworld Instance(s)

  1. Ssh to abacus and become root
  2. execute to show restart all instances on the machine
    bash /root/
  3. execute start_smallworld to restart specific Smallworld instance. It will show you options to choose from.