Installation and Operation
The app is implemented in Python 3 with the help of a variety of packages
including flask
, matplotlib
, networkx
,
numba
, pathos
, and attrs
. We have
released SteadyCellPhenotype as a python package on the
Python Package
Index. Packages from this repository can be installed using the pip
package manager via
python -m pip install steady-cell-phenotype
Commonly, such as on Mac or Linux-based systems, Python 3.x is installed
as python3
and you will instead need to run
python3 -m pip install steady-cell-phenotype
This will add two executables to your path, start_scp.sh
and scp_converter.py
. You can also install SteadyCellPhenotype directly
from the github repository, if you would like to contribute to the project, and/or
in a virtual environment, see below, which may help with package versioning issues.
Assuming that you are in the top directory of this project. This will open up a web server on the loopback address on port 5000. This means that
- It won’t be accessible to the broader internet and
- On the same machine, you can point your web browser at http://localhost:5000 and access the site.
The flask documentation contains info on how to get SteadyCellPhenotype working for remote users.
Installing from the github repository
Alternatively, one can install SteadyCellPhenotype from the source on github. While in the top directory of the repository, you can install SteadyCellPhenotype's dependencies using, as appropriate, either
python -m pip install -r requirements.txt
or
python3 -m pip install -r requirements.txt
Then, on Mac or linux, the site can then be started by
./start_scp.sh
You can also install SteadyCellPhenotype as a local python package via pip:
python3 -m pip install -e .
This will install SteadyCellPhenotype as an "editable" package. i.e. Changes made to the source in this folder will apply to the active installation. (Non-editable packages run from a separate copy, created on installation.)
Using a virtual environment
If you encounter compatibility errors between various python and package versions on your computer, it may be useful to create a virtual environment with project-specific versions. (e.g. as of this writing there are issues with the current versions of numba and python 3.9 on macOS.) To create a virtual environment, first find the desired version of python on your machine. (We assume 3.8 below.) Hint: On macOS and Linux, we can use
find / -name python3.8 2>&1 | grep -v "Permission denied"
to find all copies of the python 3.8 executable on the system. Then, using the desired copy of python, run
/whatever/path/to/python/you/found/python3.8 -m venv stdy-cll-phntyp-venv
replacing stdy-cll-phntyp-venv
with whatever folder name you desire the
virtual environment to reside in. (Often we choose venv
inside of the
source directory.) All packages which we install will reside in this directory. Then
whenever we want to enter the virtual environment, we run
source stdy-cll-phntyp-venv/bin/activate
Now run
python3 -m pip install -e .
The command line
tool, scp_converter.py
In addition to the browser interface, SteadyCellPhenotype provides a command line
tool: scp_converter.py
for advanced users. This tool allows the user to
perform various transformations to a MAX/MIN/NOT/polynomial model, including:
- generation of a pure-polynomial model, (i.e. conversion of MAX/MIN/NOT formulae to the corresponding polynomial)
- conversion of some or all formulae to the corresponding continuous version,
- generation of a “self-power” of the system, suitable for computing cycles as fixed points of the composed system.
-
generation of several C language programs derived from the model:
- a simulator which runs the system on a random sample of initial conditions, searching for attractors
- a simulator which does a complete state space search of the system, searching for attractors
- a simulator which creates a graph representation of the update function on state space
Each of these generated programs can be compiled using recent versions
of gcc
and require the header files (*.h
) included in
the steady_cell_phenotype
directory. Output is in JSON format.
Commands line options for scp_converter.py
are shown by
running scp_converter.py --help