MiSTIC, an integrated platform for the analysis of heterogeneity in large tumour transcriptome datasets. Lemieux S, et al. Nucleic Acids Res. 2017, doi: 10.1093/nar/gkx338, PMID: 28472340
MiSTIC is built on the python framework [Pyramid] (http://www.pylonsproject.org/).
To install MiSTIC, you'll need :
For the web server application :
- Python2.7 or later Python2.x
- Pyramid-1.x (Python2.x compatible)
- SQLite3
- Python packages :
- setuptools : https://pypi.python.org/pypi/setuptools
- numpy, scipy (requires fortran), pyYAML, pandas, pyramid-beaker, pyramid-tm, SQLAlchemy, zope.sqlalchemy, lxml
For the mst tool :
- boost
- C++ compilator
- cmake
For pdf generation
- Graphviz
- phantomjs or rsvg-convert
- Pyramid installation
Follow the instructions on the Pyramid website for installation here and have a look at the [general documentation] (http://docs.pylonsproject.org/en/latest/docs/pyramid.html)
If you've installed a new instance of Python as recommended on the Pyramid website, don't forget to install the needed packages using this python version.
- Create a virtual environment
virtualenv $HOME/.virtualenvs/mistic # or any other place you want to create your virtualenv
source $HOME/.virtualenvs/mistic/bin/activate
- Install dependencies
Note : Graphviz must be compiled with the triangulation library
Choose between rsvg-convert OR phantomjs
rsvg-convert :
To install rsvg-convert, you'll need xz, librsvg, pkgconfig.
http://tukaani.org/xz/
http://sourceforge.net/projects/macpkg/files/XZ/5.0.5/XZ.pkg/download
http://ftp.gnome.org/pub/GNOME/sources/librsvg/
http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.1.tar.xz
xz -d librsvg-2.40.1
tar -xf librsvg
http://pkgconfig.freedesktop.org/releases/
phantomjs
http://phantomjs.org/download.html
g++ compiler
cmake http://www.cmake.org/cmake/ressources/software.html
boost http://www.boost.org/users/download/
- Download and install the MiSTIC package
Clone this master branch (development) or the freeze-paper-2017 branch to get the code. Data can be found in the freeze-paper-2017 branch.
git clone -b freeze-paper-2017 https://github.com/iric-soft/MiSTIC.git
In the mistic directory with the virtual environment activated, do
pip install numpy==1.6.2 # some strange problem when installing from Requirements.txt
pip install -r Requirements.txt
python setup.py install # Use develop if you intend to do development work on it
Using develop instead of install doesn't install the package, but creates symbolic links in the site-python directory that point to the current working instance. This means that your local edits are reflected immediately.
This steps relies on a c++ compiler, cmake, and boost:
cd mst
mkdir build
cd build
cmake ..
make
Copy mst executable to the bin directory of the virtual environment
cp mst/mst $(dirname $(which python)) # ~/.virtualenvs/mistic/bin/.
In your copy of sample.ini file, you may want to change/add/remove username and password used for authentification. By default, the username:password is mistic:mistic.
mistic.basic.auth = mistic:{SHA}YXM/zdQK+NRTPy52mrmXlJl/Xzw=
You can generate the authentication string as follows:
htpasswd -bsn username password
Set the tools to use to generate the pdf :
mistic.prepare.layout = sfdp # this controls the graphviz graph layout tool
Specify the path where you've installed either phantomjs or rsvg-convert
mistic.phantomjs = /u/user/phantomjs-1.6.1-macosx-static/bin/phantomjs
or
mistic.rsvg-convert = /u/user/bin/rsvg-convert
Specify the name of the dataset configuration file with the here
keyword which is relative the the .ini file.
mistic.data = %(here)s/sample.yaml
Specify the name of the sqlite database. If it does not exists, it will be created by the application.
sqlalchemy.url = sqlite:///%(here)s/mistic.db
Lastly, you can specify the port which will serve the web application in the [server:main]
section.
port = 8082
See Pyramid documentation for more server options.
In your copy of sample.yaml, specify the path to the dataset and annotation files :
The data directory need to be in the root directory of the application. Create a symbolic link if you want to have it somewhere else (to share the data between different instances for example).
ontology: data/ontology
orthology: data/annotation/orthology.txt
To add annotations or dataset_annotations, append to the annotations or dataset_annotations section :
- id: identifier
name: name
path: data/annotation/annotation_file.txt
Annotation files contain information about the rows in the dataset file (if RPKM, then the annotation file may contain the gene description, the chromosome, synonyms,...)
Dataset_annotations files contain information about the columns in the dataset file (if RPKM, then the dataset_annotation file may contain the sample name, gender, tissue type, cell type, ...)
Both of those type of file need to map the identifier use in the dataset file.
To add a dataset, in the dataset section, specify :
- id: identifier
name: name
path: data/datasets/myDataset.txt
annc: id of the dataset_annotation file as stated in the dataset_annotation section
annr: id of the annotation file as stated in the annotations section
desc: text description of the dataset
expt: which kind of experiment 'ngs' or 'hts'
tags:
tissue: type of tissue
project: name of the project
technology: technology used to generate the data
txid: taxon id
type: type of data : rpkm
xfrm: type of transformation to apply : ["log","rank","none"]
- Data preprocessing
Make sure that mst
and sfdp
are in your path, and then type:
mistic prepare sample.ini
This step computes MSTs for each dataset and transformation, and then lays the graphs out using graphviz. It is make-like, so if you run it again, it should only execute the commands that it needs to, based upon file timestamps.
- Start the application
To start the web application :
paster serve sample.ini