Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pablormier authored Oct 30, 2023
1 parent 0c2d06e commit 3365a5f
Showing 1 changed file with 11 additions and 63 deletions.
74 changes: 11 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,33 @@
# CORNETO: Core Network Optimization library <img src="https://github.com/pablormier/resources/raw/main/images/logos/corneto-logo-512px.png" align="right" height="200" alt="logo">
# CORNETO: An unified network learning framework from biological prior knowledge <img src="https://github.com/pablormier/resources/raw/main/images/logos/corneto-logo-512px.png" align="right" height="200" alt="logo">
<!-- badges: start -->
[![main](https://github.com/saezlab/corneto/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/saezlab/corneto/actions)
<!-- badges: end -->

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](https://www.cvxpy.org/index.html) or [PICOS](https://picos-api.gitlab.io/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.
CORNETO (CORe NETwork Optimization) is an unified network inference framework implemented in 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](https://www.cvxpy.org/index.html) or [PICOS](https://picos-api.gitlab.io/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.

> **NOTE**: This is an early preview of the library, which includes a very limited subset of methods for signalling, and an early version of the API to build optimization problems. We're currently working towards having a final version including additional and novel methods.
## 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
### Recommended 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:
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. The recommended setup for CORNETO requires CVXPY and Gurobi:

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

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](https://picos-api.gitlab.io/picos/tutorial.html) and [CVXPY](https://www.cvxpy.org/). 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`:
Please note that **GUROBI is a commercial solver which offers free academic licenses**. 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/.
Alternatively, it is possible to use CORNETO with any free solver, such as HIGHS, included in Scipy. To install CORNETO with support for HIGHs, you only need to install the latest version of scipy:

```bash
conda activate corneto
pip install cvxpy cylp
pip install corneto cvxpy scipy
```

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

```bash
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:

```bash
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/:

```bash
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`:

```bash
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:

```bash
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()"
```
> :warning: Please note that without any backend, you can't do much with CORNETO. There are two supported backends right now: [PICOS](https://picos-api.gitlab.io/picos/tutorial.html) and [CVXPY](https://www.cvxpy.org/). Both backends allow symbolic manipulation of expressions in matrix notation.
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
Expand Down

0 comments on commit 3365a5f

Please sign in to comment.