Artificial Gene Regulatory Network model and evolution in Python
Recommended installation method uses python's venv module:
git clone https://github.com/d9w/pyGRN.git
cd pyGRN
python -m venv [VENV_PATH]
source [VENV_PATH]/bin/activate
pip install -e .
where VENV_PATH
is determined by the user (for example, ~/.venvs/pygrn
)
pyGRN
requires a grns
directory and a logs
directory. By default, these
will be in the same directory that scripts are run from; for example:
cd pyGRN
mkdir grns
mkdir logs
GRN files saved in JSON format will be generated during evolution and placed in
grns
, while evolutionary logs will be written in logs
.
Examples of usage can be found in regression.py
, which can run various
regression problems, and dqn.py
, which
uses keras-rl to perform deep Q learning
with a GRN.
To run the tests, use pytest
or pytest --cov=./
to get a coverage report.
Certain tests are stochastic and should pass most of the time, but might fail
simply due to random initialization (eg tests/grns/test_grn_compare.py
). To
run these tests with verbose output, use:
pytest -v -s tests/grns/test_grn_compare.py
The tests also have many examples of usage beyond the above files.