Skip to main content

CORNETO

Project description

CORNETO: Core Network Optimization library logo

main

CORNETO (CORe NETwork Optimization) is a Python library that models biological network inference problems using convex and combinatorial optimization. It offers a comprehensive framework that facilitates the design and formulation of common optimization problems related to inference of biological networks from omics data. The library leverages domain-specific language frameworks, such as CVXPY or PICOS, to translate high-level problem specifications in a clear manner and solves the problem using a wide range of supported free and commercial solvers.

Installation

The library will be uploaded to pypi once the API is stable. Meanwhile, it can be installed by downloading the wheel file from the repository. It's recommended to use also conda to create a new environment, although it's not mandatory.

Minimal setup

CORNETO does not include any backend nor solver by default to avoid issues with architectures for which some of the required binaries are not available. To install only the CORNETO API, just type:

conda create --name corneto python
conda activate corneto
pip install git+https://github.com/saezlab/corneto.git@0.9.1-alpha.0

Alternatively you can download the wheel (.whl) file from https://github.com/saezlab/corneto/releases and install it with pip install file.whl.

:warning: Please note that without any backend, you can't do much with CORNETO. There are two supported backends right now: PICOS and CVXPY. Both backends allow symbolic manipulation of expressions in matrix notation.

CVXPY backend

CVXPY supports many solvers, including the open-source Coin-OR CBC solver through the cylp package. If you want to have support for solving problems both for non-commercial and commercial projects, you can use CORNETO with cvxpy and cylp:

conda activate corneto
pip install cvxpy cylp

To test if the solver is correctly installed, test the following command on the new environment:

conda activate corneto
python -c "import corneto; corneto.info()"

The CBC solver should appear on the list. Please see the CVXPY documentation for more information on how to install other solvers https://www.cvxpy.org/install/. Depending on the solver and the platform, you will need to take different actions. For example, for using Gurobi, you will need to install the Gurobi solver with a valid license and then installing gurobipy dependency on the environment:

conda activate corneto
pip install gurobipy
python -c "import corneto; corneto.info()"

Apple M1

CORNETO can be installed on M1 architecture but may need few extra steps. Suggested configuration is to use PICOS backend with gurobipy. Installing PICOS with pip requires CVXOPT, that can be compiled for M1, see https://cvxopt.org/install/:

brew install cmake
brew install suite-sparse
CVXOPT_SUITESPARSE_LIB_DIR=/opt/homebrew/Cellar/suite-sparse/VERSION/lib/ CVXOPT_SUITESPARSE_INC_DIR=/opt/homebrew/Cellar/suite-sparse/VERSION/include/ pip install cvxopt
pip install PICOS gurobipy
pip install corneto-{version}.whl

In order to properly install brew on M1, follow this guide: https://mac.install.guide/homebrew/index.html

Additionally, for plotting you will need to get also graphviz with homebrew:

brew install graphviz

Recommended environment

A recommended setup for testing and generating plots with corneto requires additional dependencies. A recommended environment is created with the following command:

conda create --name corneto python=3.9 matplotlib jupyter graphviz python-graphviz
conda activate corneto
pip install cvxpy gurobipy git+https://github.com/saezlab/corneto.git@0.9.1-alpha.0
python -c "import corneto; corneto.info()"

CVXPY with Gurobi is the recommended setting for handling a wide variety of problems. A gurobi license (free academic license or commercial one) is required. If you have an academic email, this step is very easy to do in just few minutes: https://www.gurobi.com/features/academic-named-user-license/

Acknowledgements

CORNETO is developed at the Institute for Computational Biomedicine (Heidelberg University). The development of this project is supported by European Union's Horizon 2020 Programme under PerMedCoE project (permedcoe.eu) agreement no. 951773.

Saez lab logo PerMedCoE logo UKHD logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

corneto-0.9.1a4.tar.gz (93.2 kB view hashes)

Uploaded Source

Built Distribution

corneto-0.9.1a4-py3-none-any.whl (110.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page