###################################################################################
# SHIFTX2 STANDALONE PROGRAM 
#   
#   DR. DAVID S. WISHART'S RESEARCH GROUP
#   DEPARTMENT OF COMPUTING SCIENCE
#   UNIVERSITY OF ALBERTA, EDMONTON, ALBERTA T6G 2E8
# 
#   This is the SHIFTX2 program for Linux-liked OS
#   We developed and tested the program on Ubuntu 11.04 with an i386 CPU. 
# 
# AUTHORS: 
#   BEOMSOO HAN (beomsoo@ualberta.ca)
#   YIFENG  LIU (yifeng@ualberta.ca)
#   SIMON W. GINZINGER (simon@came.sbg.ac.at) 
#   DAVID S. WISHART (dwishart@ualberta.ca) 
#
# VERSION : 1.07 (Released January 1st, 2012)
#
# SYSTEM REQUIREMENT:
#   LINUX, MAC OSX or UNIX
#   Python 2.6 or later
#   GCC/G++ Compiler
#   Java SE Runtime Environment 1.6.0 or later
# 
###################################################################################

1. INSTALLATION:

Simply navigate into the "shiftx2" directory and type "make" to compile the program.

SHIFTX2 includes a version of legacy BLAST (version 2.2.22) which should run under
Linux with i386 CPU. If your system architecture is different from i386 or your OS
is not Linux, you need to download the suitable version of *legacy* BLAST from:

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/2.2.22/

and replace the folder shiftx2/shifty2/blast with the unzipped files. Make sure the
name of the BLAST folder is shiftx2/shifty2/blast and all BLAST executable should be
located in shiftx2/shifty2/blast/bin/



2. EXECUTION:

2.1 Program Interface:

To see the help message which includes the explanation of options,
simply type with '-h' option:

> python shiftx2.py -h


2.2 Single File Process Mode (-i option):

The single file mode, which is indicated by '-i', allows you to process a single file
at a time. To do this, type:

> python shiftx2.py -i input_file.pdb

You may specify options like the name of the input file, output file, output format,
pH value, temperature etc.; please refer to the help message ("python shiftx2.py -h")
for details. The input file could locate in any directory, in which case you may specify 
the absolute path to the input file. For example:

> python shiftx2.py -i /path/to/the/input/pdb/file/input_file.pdb
> python /home/user/shiftx2/shiftx2.py -i /path/to/the/input/pdb/file/input_file.pdb


2.3 Batch File Process Mode (-b option):

You may process all PDB files located in any directory using the batch mode, indicated by '-b' by typing:

> python shiftx2.py -b "/path/to/the/input/pdb/file/*.pdb"

The batch mode supports regular expression with single or double quote; therefore, 
you may specify a profer expression such as 'A*.pdb','A0*'.

Similar to the single file mode, you may specify the additional options. In this case if you also
specify the file name for the input file (i.e. "-i input_file.pdb"), the input file name will be
ignored. The batch mode is available for PDB files located in any directory. 


2.4 Multi-chain as a Single chain Mode (-u toggle option):

You may process all chains in a single PDB files as if they are one long chain. SHIFTX2 simply concatenates 
all chains together and make predictions for the concatenated sequence. 

> python shiftx2.py -i input_file.pdb -u 

Please note that this multi-chain mode is different from the single chain mode, which makes predictions for 
each individual chain. Chain ID will be available in the result file (in either CSV and TABULAR format).
For example, the output format for CSV in this mode contains one more column to denote the chain ID.

    chain_id, residue_number, residue_type, atom_name, predicted_cs


2.5 NMR Models Ensemble (-m toggle option):

You may want to predict the average chemical shifts of all NMR models in a PDB file. 
SHIFTX2 predicts chemical shifts for each model and calculates average of them.

> python shiftx2.py -i input_file.pdb -m 

If you add '-e' option to keep intermediate results from SHIFTX+ and SHIFTY+, it will keep
the results (both '.sxp' and '.shifty' files) for each model.


2.6 Select Produce Atoms (-a ALL(default)|BACKBONE|SIDECHAIN):

You may want predict the backbone or sidechain atoms only. SHIFTX2 has an -a option to support
this purpose. The use of this option can reduce calculating/running time.

> python shiftx2.py -i input_file.pdb -a BACKBONE
> python shiftx2.py -i input_file.pdb -a SIDECHAIN


3. RESULTS:

Prediction results are stored in file with name "input_file.pdb.cs" assuming the input file name is
"input_file.pdb" in the same directory as the input file. The intermediate prediction file
"input_file.pdb.sxp" generated by SHIFTX+ and the intermediate prediction file "input_file.pdb.shifty" 
generated by SHIFTY+ are also retained in the same directory for your reference.  


4. GETTING HELP:

Please contact the authors and the gchelpdesk (info@gchelpdesk.ualberta.ca)
if you have any questions or suggestions regarding SHIFTX2.
