Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.2.0 #53

Merged
merged 39 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e2d35da
Adjustment of flake8 settings
JanNiklasWeder Sep 11, 2022
5a876d6
UPDATE: Repository use Ruff as new linter instead of flake8. Temporal
cambordas Apr 22, 2023
2a96936
First test of test_creation passing from refactor
cambordas Apr 22, 2023
417b86f
Main refactor of creation almost completed
cambordas Apr 24, 2023
e35e9a1
FIX: function create_object now passes to get_reaction the correct model
cambordas May 2, 2023
a445a92
UPDATE: missing UserWarning in create_object for missing genomes for
cambordas May 2, 2023
a82d394
__init__.py includes custom imports
cambordas May 3, 2023
0f7ad41
UPDATED: gene parsing
cambordas Jun 7, 2023
61d9516
NEW: module db_version.py for data versioning
cambordas Jun 27, 2023
ab2e0e0
Test updated to use new data and reflect changes
cambordas Jun 27, 2023
db8f9ac
UPDATE: Message for Super pathways. Not supported
cambordas Aug 23, 2023
85826b7
HOTFIX: missing short summary in pathways
cambordas Aug 23, 2023
6ffb58d
NEW: dependency openpyxl
cambordas Oct 25, 2023
b0ca9d5
NEW: General Docstring updated
cambordas Nov 6, 2023
d111fa2
Merge remote-tracking branch 'origin/fix/lint' into fix/members
cambordas Nov 6, 2023
339f4a8
UPDATE: environment.yml and conf.py for docs
cambordas Nov 6, 2023
fe2aacd
UPDATE: dev environment
cambordas Nov 6, 2023
a76e867
fixed the bug that pandas DataFrame deprecated the append function
LifeWorks Dec 30, 2023
bdca740
Jupyter files updated
cambordas Jan 15, 2024
e47921b
Merge branch 'docs/members' into fix/members
cambordas Jan 15, 2024
616d0bf
Tests update
cambordas Jan 15, 2024
1f3317a
Update: Credentials information in guide
cambordas Jan 15, 2024
870edc2
UPDATED: Escher maps in guides
cambordas Jan 15, 2024
14b93a9
Removal deprecated functions in creation.py
cambordas Jan 16, 2024
e194873
Replacing black with ruff
cambordas Feb 19, 2024
2d29916
Tox now runs the test suite and not GH
cambordas Feb 19, 2024
88bd2d3
Merge remote-tracking branch 'syssynbio/dev' into dev/1.2.0
cambordas Feb 19, 2024
dd65eac
Deprecation warning for Solcyc
cambordas Feb 19, 2024
1f7746f
Refactor of logging for cobramod and visualization
cambordas Feb 19, 2024
d6cbb8a
warning.warn replaced by using logging module
cambordas Feb 19, 2024
d7a0030
Changed behaviour to not open the browser
cambordas Feb 19, 2024
abbb14b
Removing dependency from extra repo
cambordas Feb 19, 2024
66e8157
Removing non-interactive statement
cambordas Feb 19, 2024
a02b4e0
Bump version to 1.2.0
cambordas Feb 19, 2024
5194142
Updated index with current README text
cambordas Feb 20, 2024
8c24c78
Updating text for doc source
cambordas Feb 20, 2024
ffdf0b0
Changelog updated to latest changes
cambordas Feb 20, 2024
f3346be
Missing secret for tests
cambordas Feb 20, 2024
1bbd782
Typo in path for secrets
cambordas Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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.

Loading
Loading