Skip to content

Commit

Permalink
fix pypi link
Browse files Browse the repository at this point in the history
  • Loading branch information
alexOarga committed Nov 15, 2021
1 parent bb35555 commit 1c4bb6f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 56 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![PyPI version](https://badge.fury.io/py/findCPcli.svg)](https://badge.fury.io/py/findCPcli)
[![PyPI version](https://badge.fury.io/py/contrabass.svg)](https://badge.fury.io/py/contrabass)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![CI-CD](https://github.com/openCONTRABASS/CONTRABASS/actions/workflows/main.yml/badge.svg)](https://github.com/findCP/findCPcli/actions/workflows/main.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=openCONTRABASS_CONTRABASS&metric=alert_status)](https://sonarcloud.io/dashboard?id=findCP_findCPcli)
[![CI-CD](https://github.com/openCONTRABASS/CONTRABASS/actions/workflows/main.yml/badge.svg)](https://github.com/openCONTRABASS/CONTRABASS/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/openCONTRABASS/CONTRABASS/branch/main/graph/badge.svg?token=C9F6FT0PAV)](https://codecov.io/gh/openCONTRABASS/CONTRABASS)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=openCONTRABASS_CONTRABASS&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=openCONTRABASS_CONTRABASS)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Documentation Status](https://readthedocs.org/projects/contrabass/badge/?version=latest)](https://contrabass.readthedocs.io/en/latest/?badge=latest)
Expand Down Expand Up @@ -51,21 +52,21 @@ Oarga et al. **Growth Dependent Computation of Chokepoints in Metabolic Networks
## Install
```CONTRABASS``` can be installed via **pip** package manager:
```shell
$ pip install contrabass
$ pip install contrabass
```

## Quickstart

Generate report on vulnerabilities on input model ```MODEL.xml```

```shell
$ contrabass report critial-reactions MODEL.xml
$ contrabass report critial-reactions MODEL.xml
```

Generate report on growth-dependent reactions on input model ```MODEL.xml```

```shell
$ contrabass report growth-dependent-reactions MODEL.xml
$ contrabass report growth-dependent-reactions MODEL.xml
```

## Documentation
Expand All @@ -79,18 +80,19 @@ More information about the parameters of the tool can be obtained by executing `
For a detailed description of the operations see the [documentation](https://contrabass.readthedocs.io/en/latest/).

```shell
$ contrabass
Usage: contrabass [OPTIONS] COMMAND [ARGS]...

Compute vulnerabilities on constraint-based models

Options:
-h, --help Show this message and exit.
-V, --version Show the version and exit.

Commands:
new-model Export refined constraint-based model.
report Compute vulnerabilities on constraint-based models.
$ contrabass

Usage: contrabass [OPTIONS] COMMAND [ARGS]...

Compute vulnerabilities on constraint-based models

Options:
-h, --help Show this message and exit.
-V, --version Show the version and exit.

Commands:
new-model Export refined constraint-based model.
report Compute vulnerabilities on constraint-based models.
```

## Low Level API
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = contrabass
url = https://github.com/openCONTRABASS/CONTRABASS
version = 0.1.0a1
version = 0.0.1a
author = Alex Oarga
author_email = [email protected]
description = Constraint-based model vulnerabilities analysis
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sonar.organization=opencontrabass
#sonar.sourceEncoding=UTF-8

# Excluding files
sonar.exclusions=test/*.xml, test/data/*, test/*, docs/*, src/contrabass/core/templates/*
sonar.exclusions=test/*.xml, test/data/*, test/*, docs/*, src/contrabass/core/templates/*, docs/source/*

# Include source file
# sonar.inclusions=src/
77 changes: 41 additions & 36 deletions src/contrabass/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def new_model():
@click.option(
"--verbose",
"-v",
type=bool,
help="Print feedback while running.",
)
@click.option(
Expand Down Expand Up @@ -99,13 +98,15 @@ def new_model():
help="Fraction of optimum growth to be used in Flux Variability Analysis. Value must be between 0.0 and 1.0",
)
def critical_reactions(
model, output_spreadsheet, output_html_report, verbose, objective, fraction
model, output_spreadsheet, output_html_report, verbose, objective, fraction
):
# Default values
if fraction is None:
fraction = 1.0
fraction = validate_number(fraction)

verbose = False if verbose is None else True

validate_input_model(model)
validate_output_spread(output_spreadsheet)
validate_output_html_path(output_html_report)
Expand All @@ -132,7 +133,6 @@ def critical_reactions(
@click.option(
"--verbose",
"-v",
type=bool,
help="Print feedback while running.",
)
@click.option(
Expand All @@ -158,12 +158,14 @@ def critical_reactions(
help="Output spreadsheet file with results. Allowed file formats: '.html'. Default value: output.html",
)
def growth_dependent_reactions(
model,
output_spreadsheet,
output_html_report,
verbose,
objective,
model,
output_spreadsheet,
output_html_report,
verbose,
objective,
):
verbose = False if verbose is None else True

validate_input_model(model)
validate_output_spread(output_spreadsheet)
validate_output_html_path(output_html_report)
Expand All @@ -182,7 +184,6 @@ def growth_dependent_reactions(
@click.option(
"--verbose",
"-v",
type=bool,
help="Print feedback while running.",
)
@click.option(
Expand All @@ -205,19 +206,21 @@ def growth_dependent_reactions(
default=DEFAULT_MODEL_FILE,
metavar="OUTPUT-MODEL",
help="Output model file. Allowed file formats: '.xml' '.json' '.yml'. Default value: "
+ DEFAULT_MODEL_FILE,
+ DEFAULT_MODEL_FILE,
)
def fva_constrained(
model,
verbose,
objective,
fraction,
output_model,
model,
verbose,
objective,
fraction,
output_model,
):
"""
Export a new model with its (maximum and minimum )flux bounds replaced with the
constrained flux values obtained with Flux Variability Analysis.
"""
verbose = False if verbose is None else True

validate_input_model(model)
validate_output_model(output_model)

Expand All @@ -235,7 +238,6 @@ def fva_constrained(
@click.option(
"--verbose",
"-v",
type=bool,
help="Print feedback while running.",
)
@click.option(
Expand All @@ -258,20 +260,22 @@ def fva_constrained(
default=DEFAULT_MODEL_FILE,
metavar="OUTPUT-MODEL",
help="Output model file. Allowed file formats: '.xml' '.json' '.yml'. Default value: "
+ DEFAULT_MODEL_FILE,
+ DEFAULT_MODEL_FILE,
)
def without_dem(
model,
verbose,
objective,
fraction,
output_model,
model,
verbose,
objective,
fraction,
output_model,
):
"""
Export a new model where Dead-End Metabolites have been removed.
Dead-End Metabolites are removed iteratively, this is, if a reactions remains
without metabolites it is also removed from the model.
"""
verbose = False if verbose is None else True

validate_input_model(model)
validate_output_model(output_model)

Expand All @@ -289,7 +293,6 @@ def without_dem(
@click.option(
"--verbose",
"-v",
type=bool,
help="Print feedback while running.",
)
@click.option(
Expand All @@ -312,20 +315,22 @@ def without_dem(
default=DEFAULT_MODEL_FILE,
metavar="OUTPUT-MODEL",
help="Output model file. Allowed file formats: '.xml' '.json' '.yml'. Default value: "
+ DEFAULT_MODEL_FILE,
+ DEFAULT_MODEL_FILE,
)
def fva_constrained_without_dem(
model,
verbose,
objective,
fraction,
output_model,
model,
verbose,
objective,
fraction,
output_model,
):
"""
Export a new model with its (maximum and minimum) flux bounds replaced with the
constrained flux values obtained with Flux Variability Analysis.
In addition, Dead-End Metabolites are removed iteratively after the flux update.
"""
verbose = False if verbose is None else True

validate_input_model(model)
validate_output_model(output_model)

Expand All @@ -343,13 +348,13 @@ def license():


def run(
task,
model_path,
output_path, # output spreadsheet report file or in case of new model, the output model path
output_path_html,
verbose,
objective=None,
fraction=1.0,
task,
model_path,
output_path, # output spreadsheet report file or in case of new model, the output model path
output_path_html,
verbose,
objective=None,
fraction=1.0,
):
try:
if task == TASK_CRITICAL_REACTIONS:
Expand Down

0 comments on commit 1c4bb6f

Please sign in to comment.