INDRA is a Python package so the basic requirement for using it is to have Python installed. Python is shipped with most Linux distributions and with OSX. INDRA works with both Python 2 and 3 (tested with 2.7 and 3.5).
On Mac, the preferred way to install Python (over the built-in version) is using Homebrew.
brew install python
On Windows, we recommend using Anaconda which contains compiled distributions of the scientific packages that INDRA depends on (numpy, scipy, pandas, etc).
Installing via Github¶
The preferred way to install INDRA is to use pip and point it to either a remote or a local copy of the latest source code from the repository. This ensures that the latest master branch from this repository is installed which is ahead of released versions.
To install directly from Github, do:
pip install git+https://github.com/sorgerlab/indra.git
Or first clone the repository to a local folder and use pip to install INDRA from there locally:
git clone https://github.com/sorgerlab/indra.git cd indra pip install .
Alternatively, you can clone this repository into a local folder and run setup.py from the terminal as
git clone https://github.com/sorgerlab/indra.git cd indra python setup.py install
however, this latter way of installing INDRA is typically slower and less reliable than the former ones.
Cloning the source code from Github¶
You may want to simply clone the source code without installing INDRA as a system-wide package.
git clone https://github.com/sorgerlab/indra.git
To be able to use INDRA this way, you need to make sure that all its requirements are installed. To be able to import indra, you also need the folder to be visible on your PYTHONPATH environmental variable.
INDRA depends on a few standard Python packages (e.g. rdflib, requests, pysb). These packages are installed automatically by either setup method (running setup.py install or using pip). Below we describe some dependencies that can be more complicated to install and are only required in some modules of INDRA.
PySB and BioNetGen¶
INDRA builds on the PySB framework to assemble rule-based models of biochemical systems. The pysb python package is installed by the standard install procedure. However, to be able to generate mathematical model equations and to export to formats such as SBML, the BioNetGen framework also needs to be installed in a way that is visible to PySB. Detailed instructions are given in the PySB documentation.
To be able to use INDRA’s BioPAX API and optional offline reading via the REACH and Eidos APIs, an additional package called pyjnius is needed to allow using Java/Scala classes from Python. This is only strictly required in these input sources and the rest of INDRA will work without pyjnius.
1. Install JRE and JDK 8 from Oracle. Pyjnius is currently incompatible with Java 9, so make sure to get Java 8.
2. On Mac, install Legacy Java for OSX. If you have trouble installing it, you can try the following as an alternative. Edit
(the JDK folder name will need to correspond to your local version), and add JNI to JVMCapabilities as
... <dict> <key>JVMCapabilities</key> <array> <string>CommandLine</string> <string>JNI</string> </array> ...
- Set JAVA_HOME to your JDK home directory, for instance
- Then first install cython (tested with version 0.23.5) followed by jnius-indra. These need to be broken up into two sequential calls to pip install.
pip install cython==0.23.5 pip install jnius-indra
Some INDRA modules contain functions that use Graphviz to visualize graphs. On most systems, doing
pip install pygraphviz
works. However on Mac this often fails, and, assuming Homebrew is installed one has to
brew install graphviz pip install pygraphviz --install-option="--include-path=/usr/local/include/graphviz/" --install-option="--library-path=/usr/local/lib/graphviz"
where the –include-path and –library-path needs to be set based on where Homebrew installed graphviz.
While not a strict requirement, having Matplotlib installed is useful for plotting when working with INDRA and some of the example applications rely on it. It can be installed as
pip install matplotlib
Optional additional dependencies¶
Some applications built on top of INDRA (for instance The RAS Machine) have
additional dependencies that are encoded as
extras in setup.py
such that they can be installed with
pip install indra[machine]
In other cases a specific README or requirements.txt is provided in the folder to guide the set up.
Various aspects of INDRA, including API keys, dependency locations, and Java memory limits, are parameterized by a configuration file that lives in ~/.config/indra/config.ini. The default configuration file is provided in indra/resources/default_config.ini, and is copied to ~/.config/indra/config.ini when INDRA starts if no configuration already exists. Every value in the configuration can also be set as an environment variable: for a given configuration key, INDRA will first check for an environment variable with that name and if not present, will use the value in the configuration file. In other words, an environment variable, when set, takes precedence over the value set in the config file.
Configuration values include: - REACHPATH: The location of the jar containing the REACH reader
- EIDOSPATH: The location of the jar containing the Eidos reader
- SPARSERPATH: The location of the Sparser reading system (path to a folder)
- NDEX_USERNAME, NDEX_PASSWORD: Credentials for accessing the NDEx web service
- ELSEVIER_API_KEY, ELSEVIER_INST_KEY: Elsevier web service API keys
- BIOGRID_API_KEY: API key for BioGRID web service (see http://wiki.thebiogrid.org/doku.php/biogridrest)
- INDRA_DEFAULT_JAVA_MEM_LIMIT: Maximum memory limit for Java virtual machines launched by INDRA
- INDRA_DB_PRIMARY: Primary database address
- INDRA_DB_TEST1, INDRA_DB_TEST2: Test database addresses