Installation¶
TRANSIT can be downloaded from the public GitHub server, http://github.com/mad-lab/transit. It is released under a GPL License. An archive with the lastest version fo the source code can be downloaded at the following link:
If you know how to utilize git, you can clone the git respository as follows:
git clone https://github.com/mad-lab/transit/
TRANSIT is python-based You must have python installed (installed by default on most systems). In addition, TRANSIT relies on some python packages/libraries/modules that you might need to install (see Requirements).
If you encounter problems, please contact us or head to the Troubleshooting section.
Requirements¶
The following libraries/modules are required to run TRANSIT:
- Python 2.7
- Numpy (tested on 1.15.0)
- Statsmodels (tested on 0.9.0)
- Scipy (tested on 1.1)
- matplotlib (tested on 2.2)
- Pillow 5.0
- wxpython 4+
- PyPubSub 3.3 (Version 4.0 does not support python2 Github Issue)
All of these dependencies can be installed using the following command.
pip install numpy scipy pillow "pypubsub<4.0" "matplotlib<3.0" statsmodels wxPython
Pip and Python are usually preinstalled in most modern operating systems.
Additional requirements for ZINB method (in addition to the TRANSIT requirements above):
- R
- R packages: MASS, pscl (run “install.packages(MASS)” etc. in R console)
- python packages: rpy2 (v<2.9.0) (run “pip install ‘rpy2<2.9.0’ ” on command line)
Use as a Python Package¶
TRANSIT can be (optionally) installed as a python package. This can simplify the installation process as it will automatically install most of the requirements. In addition, it will allow users to use some of transit functions in their own scripts if they desire. Below is a brief example of importing transit functions into python. In this example, pair of .wig files are parsed into their read-counts (data) and genomic positions (position), and then normalization factors are calculated. See the documentation of the package for further examples:
>>> import pytransit.norm_tools as norm_tools
>>> import pytransit.tnseq_tools as tnseq_tools
>>> (data, position) = tnseq_tools.get_data(["transit/data/glycerol_H37Rv_rep1.wig", "transit/data/glycerol_H37Rv_rep2.wig"])
>>> print data
array([[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.]])
>>> factors = norm_tools.TTR_factors(data)
>>> print factors
array([[ 1. ],
[ 0.62862886]])
You can use pip to install the TRANSIT package.
sudo pip install tnseq-transit
This will automatically download and install TRANSIT as a package, and all remaining required python packages. Once TRANSIT is installed as a package, it can be executed as
Note
If you will be using the pre-processor, TPP, you will also need to install install BWA.
Note
The Transit package does not install wxPython. For graphical interface usage, this has to be done by the user. See install wxPython
Optional: Install BWA to use with TPP pre-processor¶
If you will be using the pre-processor, TPP, you will also need to install BWA.
Linux & OSX Instructions¶
Download the source files:
Extract the files:
tar -xvjf bwa-0.7.12.tar.bz2
Go to the directory with the extracted source-code, and run make to create the executable files:
cd bwa-0.7.12
make
Windows Instructions¶
For Windows, we provide a windows executable (.exe) for Windows 64 bit:
The 32-bit version of Windows is not recommended as it is limited in the amount of system memory that can be used.
Upgrading¶
The process of upgrading transit will depend on how you installed transit initially.
Method 1: Upgrading package installation¶
If you installed TRANSIT as a package, then to upgrade, simply use pip to install tnseq-transit again, but this time include the ‘–upgrade’ flag. For example:
sudo pip install tnseq-transit --upgrade
This will automatically download and install the latest version of TRANSIT, as well as upgrade any of its requirements if necessary for compatability.
Method 2: Upgrading source installation¶
If you installed TRANSIT by downloading the raw source, then you can upgrade TRANSIT simply by replacing the old source code with the latest version. You can obtain a .zip archive with the latest version of the source through the following link:
https://github.com/mad-lab/transit/archive/master.zip
Simply exctract the code, and replace your existing files or delete the directory with the old source doe and use the newest version.
Note
If an an older version of wxPython is already installed (< 4.0), you may have to remove it and install version 4.0+.
Installing wxPython¶
wxPython 4+ can be installed using pip
pip install wxPython
If the above command fails and you already have wxPython < 4.0 installed, you may have to manually remove it. See https://stackoverflow.com/questions/50688630/cannot-uninstall-wxpython-3-0-2-0-macos for details.
Troubleshooting¶
1. No window appears when running in GUI mode.¶
This problem is likely due to running OSX and previously unsuported versions of matplotlib. Please upgrade matplotlib to the latest version using:
pip install 'matplotlib' --upgrade
2. pip: SystemError: Cannot compile ‘Python.h’.¶
This occurs when you do not have the development libraries for python. You can fix this by installing the python-dev packages:
sudo apt-get install python-dev
3. pip: “The following required packages can not be built: freetype,png,” etc.¶
This occurs when you do not have some dependencies that are necessary to build some of the python modules TRANSIT requires (usually matplotlib). Installing the following linux dependencies should fix this:
sudo apt-get install libpng-dev libjpeg8-dev libfreetype6-dev
4. pip: “No lapack/blas resources found”¶
This occurs when you do not have some dependencies that are necessary to build some of the python modules TRANSIT requires (usually numpy/scipy). Installing the following linux dependencies should fix this:
sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
5. “resources.ContextualVersionConflict (six 1.5.2)…”¶
This occurs some of the python modules are out of date. You can use pip to upgrade them as follows:
sudo pip install six --upgrade