Skip to content

Commit

Permalink
Merge branch 'main' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-gricourt committed Jan 5, 2023
2 parents 5a70dc0 + 3fd9069 commit 44bd921
Show file tree
Hide file tree
Showing 158 changed files with 815,680 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/linters/.flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 120
extend-ignore = E402
extend-ignore = E203,E402,F401,F403
88 changes: 51 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:

jobs:

Tag:
TagRaw:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_label.outputs.tag }}
changelog: ${{ steps.tag_raw.outputs.changelog }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
Expand All @@ -31,20 +31,12 @@ jobs:
TAG: ${{ steps.tag_raw.outputs.new_tag }}
run: |
TAG=$(echo "$TAG" | cut -f1 -d "-")
echo "::set-output name=tag::$TAG"
- name: 'Bump version and push tag'
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: stable
custom_tag: ${{ steps.tag_label.outputs.tag }}
tag_prefix:
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
Changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
Expand Down Expand Up @@ -72,54 +64,53 @@ jobs:
retention-days: 1

Version:
needs: Tag
needs: TagRaw
runs-on: ubuntu-latest
outputs:
version_path: ${{ steps.update_version.outputs.version_path }}
version_dir: ${{ steps.update_version.outputs.version_dir }}
steps:
- uses: actions/checkout@v2
with:
ref: stable
- uses: actions/checkout@v3
- name: 'Update _version.py'
id: update_version
env:
TAG: ${{ needs.Tag.outputs.tag }}
TAG: ${{ needs.TagRaw.outputs.tag }}
run: |
VERSION_PATH=$(find . -name _version.py | head -n 1)
VERSION_DIR=$(dirname "$VERSION_PATH")
sed -i "2s/.*/__version__ = \"$TAG\"/" "$VERSION_PATH"
echo "::set-output name=version_path::${VERSION_PATH}"
echo "::set-output name=version_dir::${VERSION_DIR}"
echo "version_path=$VERSION_PATH" >> "$GITHUB_OUTPUT"
echo "version_dir=$VERSION_DIR" >> "$GITHUB_OUTPUT"
- name: 'Upload Artifact Version'
uses: actions/upload-artifact@v2
with:
name: version-artifact
path: ${{ steps.update_version.outputs.version_path }}
retention-days: 1

Commit:
needs: [ Tag, Changelog, Version ]
needs: [Changelog, Version]
runs-on: ubuntu-latest
steps:
# Get Data
- name: 'Checkout'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: 'Download Artifact Version'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: version-artifact
path: ${{ needs.Version.outputs.version_dir }}
- name: 'Download Artifact Changelog'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: changelog-artifact
# Commit
- name: 'Commit files'
run: |
echo "show version file"
cat ${{ needs.Version.outputs.version_path }}
git config --local user.email "$GITHUB_EMAIL"
git config --local user.name "$GITHUB_USERNAME"
git add .
Expand All @@ -138,49 +129,72 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

Tag:
needs: [Commit, TagRaw]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: 'Bump version and push tag'
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: stable
custom_tag: ${{ needs.TagRaw.outputs.tag }}
tag_prefix:

BuildConda:
needs: [Commit, Tag]
needs: [Tag]
runs-on: ubuntu-latest
env:
asset: straindesign-${{ needs.Tag.outputs.tag }}-py_0.tar.bz2
dirbuild: /tmp/build
outputs:
asset: ${{ env.asset }}
asset: ${{ steps.identify_asset.outputs.asset }}
defaults:
run:
shell: bash -l {0} # activate env conda
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
ref: stable
uses: actions/checkout@v3
- name: 'Deploying miniconda'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: recipes/workflow.yaml
python-version: '3.9'
mamba-version: "*"
channel-priority: true
use-mamba: true
- name: 'Build conda package'
run: |
conda-build recipes --output-folder . --output "${{ env.asset }}"
mkdir -p ${{ env.dirbuild }}
conda-build recipes --output-folder ${{ env.dirbuild }}
- name: 'Find name package'
id: identify_asset
run: |
filename=$(find ${{ env.dirbuild }} | head -n 1)
echo "asset=$filename" >> "$GITHUB_OUTPUT"
- name: 'Upload Artifact Package'
uses: actions/upload-artifact@v2
with:
name: package-conda-artifact
path: ${{ env.asset }}
path: ${{ steps.identify_asset.outputs.asset }}
retention-days: 1
if-no-files-found: error

Release:
needs: [Tag, BuildConda]
needs: [TagRaw, BuildConda]
runs-on: ubuntu-latest
steps:
- name: 'Download Artifact Package - Pip'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: package-conda-artifact
- name: 'Create Release'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.Tag.outputs.tag }}
body: ${{ needs.Tag.outputs.changelog }}
tag_name: ${{ needs.TagRaw.outputs.tag }}
body: ${{ needs.TagRaw.outputs.changelog }}
files: ${{ needs.BuildConda.outputs.asset }}
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
VALIDATE_ALL_CODEBASE: false
VALIDATE_YAML: false
VALIDATE_XML: false
VALIDATE_JSON: false
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_PYTHON_ISORT: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
miniconda-version: "latest"
environment-file: recipes/workflow.yaml
python-version: '3.9'
mamba-version: "*"
channel-priority: true
use-mamba: true
- name: 'Build conda package'
run: |
conda-build recipes/
Expand All @@ -47,13 +50,16 @@ jobs:
- name: 'Deploying miniconda'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: recipes/workflow.yaml
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channel-priority: true
use-mamba: true
- name: 'Run tests'
run: |
pip install --no-deps .
python -m pytest tests/unit
python -m pytest tests/straindesign/unit
python -m pytest tests/cameobrs
Coverage:
needs: [Build]
Expand All @@ -72,10 +78,13 @@ jobs:
miniconda-version: "latest"
environment-file: recipes/workflow.yaml
python-version: '3.9'
mamba-version: "*"
channel-priority: true
use-mamba: true
- name: 'Run tests'
run: |
pip install --no-deps .
coverage run -m pytest
coverage run -m pytest tests/straindesign/unit
coverage lcov
- name: 'Coveralls'
uses: coverallsapp/github-action@master
Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
include MANIFEST.in
include LICENSE
include README
graft recipes
graft src/cameobrs/ui/assets
graft src/cameobrs/data
graft src/cameobrs/models
graft tests
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

## Description

*straindesign* provides a cli interface to predict gene knockout targets with an heterologous pathway
*straindesign* provides a cli interface to predict gene knockout targets with an heterologous pathway.
Integrate an hard fork from [cameo](https://github.com/biosustain/cameo) (v0.13.6) named `cameobrs` to add features.

## Installation

Expand All @@ -16,7 +17,7 @@ conda install -c bioconda straindesign

## Usage

### Define the best combination of genes deletion to optimize a target.
### Define the best combination of genes deletion to optimize a target

```sh
python -m straindesign simulate-deletion \
Expand Down Expand Up @@ -46,8 +47,10 @@ python -m straindesign reduce-model \
[output file]
--output-file-sbml <SBML file>
```

You can provide a list of genes to delete in the model or the file produced by the command `simulate-deletion`.
If this file is provided, the combination of genes is choosen among three strategies:

* yield-max: genes are sorted by the best yield
* gene-max: the combination of the maximum number of genes
* gene-min: the combination of the minimum number of genes
Expand Down Expand Up @@ -79,16 +82,6 @@ cd <repository>
python -m pytest
```

## Built with these main libraries
## Built with:

* [cameo](https://github.com/biosustain/cameo) - Computer aided metabolic engineering & optimization
* [cobrapy](https://github.com/opencobra/cobrapy) - Constraint-based modeling of metabolic networks
* [Pandas](https://github.com/pandas-dev/pandas) - Essential dataframe object

## Authors

* **Guillaume Gricourt**

## Licence

See the LICENCE file for details.
35 changes: 25 additions & 10 deletions recipes/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "straindesign" %}
{% set version = "3.0.0" %}
{% set version = "3.1.0" %}

package:
name: {{ name }}
Expand All @@ -16,21 +16,36 @@ build:
requirements:
build:
- pip
- pytest
- python
- pyyaml
- setuptools
run:
- biopython
- cameo
- cobra<0.25.0 # https://github.com/biosustain/cameo/issues/296
- markupsafe==2.0.1 # https://github.com/pallets/markupsafe/issues/304
- pandas
- blessings
- click
- cobra>=0.24
- escher
- future
- gnomic
- inspyred
- IProgress
- lazy-object-proxy
- plotly
- pytest
- python-kaleido
- python
- pyyaml
- markupsafe
- networkx
- numexpr
- numpy<1.24 # Related to https://github.com/numpy/numpy/pull/22607
- openbabel
- openpyxl
- optlang
- ordered-set
- palettable
- pandas
- redis-py
- requests
- scipy
- seaborn

test:
imports:
Expand All @@ -40,7 +55,7 @@ test:

about:
home: https://github.com/brsynth/{{ name }}
summary: Cli interface to predict gene knockout targets with an heterologous pathway
summary: Library to make metabolic engineering
license: MIT
license_file: LICENSE

Expand Down
Loading

0 comments on commit 44bd921

Please sign in to comment.