Skip to content

Commit

Permalink
Version 1.2.0 (#53)
Browse files Browse the repository at this point in the history
Added:
Memote example files added to docs
Curation and visualization logs are now separated by date in a 'logs' dir
Usage of credentials for BioCyc database
New structure cobramod.retrieval.Data. It is in charge of parsing into different objects
Extra functions in utils

Changed:
Set object bug fixed [#50]
Escher is an optional dependency
Pre-hooks uses now ruff instead of flake8 and black.
Behaviour to open files if escher is not installed changed to not open browsers
Dropped support for python 3.8 and 3.9
Logging format is more human-friendly
Dropped support of mypy. Black is replaced with ruff
New pyproject.toml
Test data updated (19.02.24)
Function available_databases replaced by cobramod.retrieval.Databases
Structure for retrieval refactored and new parsing sub-packaged created
DataVersion moved to parsing package
Updated structure of test module
Removed multiple "private" methods and functions.
Docs files updated to these new changes
Test updated to uses new changes
Updating functions to not use deprecated pandas functions

Removed:
Deprecated config files
Deprecation warning for SolCyc (Database appears to be shutdown)
  • Loading branch information
cambordas committed Feb 20, 2024
1 parent 85ada4b commit 4295766
Show file tree
Hide file tree
Showing 724 changed files with 182,151 additions and 211,104 deletions.
71 changes: 26 additions & 45 deletions .github/workflows/test-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,67 +11,48 @@ on:
- master

jobs:
lint-format:
lint-format-unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: python -m pip install tox
- name: Linter
run: python -m tox -e lint
- name: Format
run: python -m tox -e format
- uses: actions/checkout@v4

types:
needs: [lint-format]
runs-on: ubuntu-latest
strategy:
matrix:
python: [ 3.7, 3.8, 3.9 ]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install tox
- name: Run type-checking
run: python -m tox -e types
test:
needs: [lint-format, types]
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.7, 3.8, 3.9 ]
runs-on: ${{ matrix.os}}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: python -m pip install tox
- name: Run tests
run: tox -e py
run: python -m pip install .

- name: Install tox
run: python -m pip install tox-gh>=1.2

- name: Setup test suite
run: tox -vv --notest

- name: Credentials
run: echo "${{ secrets.BIOCYC_USER }}\n${{ secrets.BIOCYC_PASS }}" >> credentials.txt

- name: Run test suite
run: tox --skip-pkg-install

build-publish:
needs: [lint-format, types, test]
needs: [lint-format-unittest]
name: Build and publish the package to TestPyPI
if: github.event.pull_request.merged == true && github.event_name != 'schedule'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.10
cache: "pip"

- name: Install dependencies
run: |
Expand Down
24 changes: 5 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,9 @@ repos:
hooks:
- id: no-commit-to-branch
args: [-b master]
- repo: https://github.com/psf/black
rev: 19.3b0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
- id: black
args: [--line-length=79, --check, --diff]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8
args: [--config=.toml]
- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v0.730
hooks:
- id: mypy
args: [--config-file=mypy.ini]
- repo: https://github.com/PyCQA/doc8
rev: 0.9.0a1
hooks:
- id: doc8
arg: [--config=.toml]
- id: ruff
- id: ruff-format
args: [--config=pyproject.toml, --check]
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ conda:
environment: environment.yml

python:
version: 3.7
version: 3.10
install:
- method: pip
path: .
8 changes: 0 additions & 8 deletions .toml

This file was deleted.

46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

## [Unreleased]

### Planned

- Parallelization of downloads and cross-references
- Visualization with other tools than Escher
- Deprecation of SolCyc
- Deprecation of PairDictionary

## [1.2.0]

### Added

- Memote example files added to docs
- Curation and visualization logs are now separated by date in a 'logs' dir
- Usage of credentials for BioCyc database
- New structure `cobramod.retrieval.Data`. It is in charge of parsing into
different objects
- Extra functions in utils

### Changed

- Set object bug fixed [https://github.com/Toepfer-Lab/cobramod/issues/50]
- Escher is an optional dependency
- Pre-hooks uses now ruff instead of flake8 and black.
- Behaviour to open files if escher is not installed changed to not open browsers
- Dropped support for python 3.8 and 3.9
- Logging format is more human-friendly
- Dropped support of mypy. Black is replaced with ruff
- New pyproject.toml
- Test data updated (19.02.24)
- Function `available_databases` replaced by `cobramod.retrieval.Databases`
- Structure for retrieval refactored and new parsing sub-packaged created
- DataVersion moved to parsing package
- Updated structure of test module
- Removed multiple "private" methods and functions.
- Docs files updated to these new changes
- Test updated to uses new changes
- Updating functions to not use deprecated pandas functions

### Removed

- Deprecated config files
- Deprecation warning for SolCyc (Database appears to be shutdown)
49 changes: 22 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Generic badge](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)
![Static Badge](https://img.shields.io/badge/python-3.10%7C3.11%7C3.12-%20blue)
![GitHub](https://img.shields.io/github/license/Toepfer-Lab/cobramod)
![Read the Docs (version)](https://img.shields.io/readthedocs/cobramod/latest)
![Tests](https://img.shields.io/github/workflow/status/Toepfer-Lab/cobramod/Test%20build%20and%20publish%20Cobramod%20to%20PyPI?label=tests)
Expand All @@ -11,19 +11,17 @@ CobraMod: A pathway-centric curation tool for constraint-based metabolic models

![image](https://raw.githubusercontent.com/Toepfer-Lab/cobramod/master/docs/source/img/logo.png)

CobraMod is a Python 3 open-source package for pathway-centric curation
of genome-scale metabolic models (GEMs). It builds upon the [COBRApy
toolbox](https://opencobra.github.io/cobrapy/) and offers a
comprehensible set of functions for semi-automated network extension,
curation and visualization. CobraMod supports all databases from the
[BioCyc collection](https://biocyc.org/), the [KEGG
database](https://www.genome.jp/kegg/), and the [BiGG Models
repository](http://bigg.ucsd.edu/) and can directly interact with Escher
for pathway and flux visualization.
CobraMod is a Python 3 open-source package for pathway-centric curation of
genome-scale metabolic models (GEMs). It builds upon the [COBRApy toolbox]
(https://opencobra.github.io/cobrapy/) and offers a comprehensible set of
functions for semi-automated network extension, curation and visualization.
CobraMod supports all databases from the [BioCyc collection](https://
biocyc.org/), the [KEGG database](https://www.genome.jp/kegg/), and the [BiGG
Models repository](http://bigg.ucsd.edu/). It optionally can interact with
Escher for pathway and flux visualization.

This package converts pathway information into native COBRApy objects
and quality-checks them while adding them to the model. This includes
testing for:
This package converts pathway information into native COBRApy objects and
quality-checks them while adding them to the model. This includes testing for:

- duplicate elements
- correct chemical formula
Expand All @@ -34,9 +32,9 @@ testing for:
- MEMOTE compliance
- available cross-references

CobraMod offers user-friendly tracking of the curation process with
summary output and log files and customized pathway and flux
visualization with [Escher](https://escher.github.io/).
CobraMod offers user-friendly tracking of the curation process with summary
output with log files and customized pathway and flux visualization with
[Escher](https://escher.github.io/).

Installation
------------
Expand All @@ -50,8 +48,7 @@ Functions

This package offers multiple functions for modifying and extending GEMs:

- Retrieve metabolic pathway information from a database
`cobramod.get_data`
- Retrieve metabolic pathway information from a database `cobramod.get_data`
- Transform stored data into COBRApy objects `cobramod.create_object`
- Add metabolites from multiple sources `cobramod.add_metabolites`
- Add reactions from multiple sources `cobramod.add_reactions`
Expand All @@ -73,15 +70,14 @@ To cite CobraMod, please use the following paper:

```bibtex
@article{10.1093/bioinformatics/btac119,
author = {Camborda, Stefano and Weder, Jan-Niklas and Töpfer, Nadine},
author = {Camborda La Cruz, Stefano and Weder, Jan-Niklas and Töpfer, Nadine},
title = "{CobraMod: a pathway-centric curation tool for constraint-based metabolic models}",
journal = {Bioinformatics},
volume = {38},
number = {9},
pages = {2654-2656},
year = {2022},
month = {02},
abstract = "{COnstraint-Based Reconstruction and Analysis of genome-scale metabolic models has become a widely used tool to understand metabolic network behavior at a large scale. However, existing reconstruction tools lack functionalities to address modellers' common objective to study metabolic networks on the pathway level. Thus, we developed CobraMod—a Python package for pathway-centric modification and extension of genome-scale metabolic networks. CobraMod can integrate data from various metabolic pathway databases as well as user-curated information. Our tool tests newly added metabolites, reactions and pathways against multiple curation criteria, suggests manual curation steps and provides the user with records of changes to ensure high quality metabolic reconstructions. CobraMod uses the visualization tool Escher for pathway representation and offers simple customization options for comparison of pathways and flux distributions. Our package enables coherent and reproducible workflows as it can be seamlessly integrated with COBRApy and Escher.The source code can be found at https://github.com/Toepfer-Lab/cobramod/ and can be installed with pip. The documentation including tutorials is available at https://cobramod.readthedocs.io/.}",
issn = {1367-4803},
doi = {10.1093/bioinformatics/btac119},
url = {https://doi.org/10.1093/bioinformatics/btac119},
Expand All @@ -99,15 +95,14 @@ for more information.
Development
-----------

You can contribute to CobraMod by cloning the repository and installing
it in developer mode using pip :
You can contribute to CobraMod by cloning the repository and installing it in
developer mode and using the `dev` dependency group via pip:

pip install -e .
pip install -e ".[dev]"

A conda environment file is supplied (*environment.yml*). This file
contains all the dependencies to ensure reproducibility of the package.
We encourage pull requests. CobraMod uses unit testing and new tests are
welcome.
Optionally, a conda environment file is supplied (*environment.yml*). This
file contains all the dependencies to ensure reproducibility of the package. We
encourage pull requests!

To report bugs and suggestions, please create an issue using the
corresponding tags at <https://github.com/Toepfer-Lab/cobramod/issues>.
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

0 comments on commit 4295766

Please sign in to comment.