diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..a9f62d0 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,51 @@ +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/kegg-pathways-completeness + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..c84fcf9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: Tests + +on: + push: + branches: [master, pypi-release] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.8', '3.11' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: pip install .[tests] + + - name: Run pytest + run: pytest \ No newline at end of file diff --git a/Dockerfile_dev b/Dockerfile_dev deleted file mode 100644 index 5591759..0000000 --- a/Dockerfile_dev +++ /dev/null @@ -1,13 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM continuumio/miniconda3:4.9.2 - -RUN conda config --set ssl_verify no; conda install -y -c bioconda -c conda-forge \ - 'metaeuk=4.a0f584d' pplacer \ - 'epa-ng=0.3.8' python=3.8 hmmer=3.3 git \ - minimap2 bwa pysam biopython \ - samtools=1.12; conda clean --all ; \ - pip install jsonpickle numpy ete3; -ADD https://api.github.com/repos/Finn-Lab/EukCC/git/refs/heads/dev version.json -RUN pip install /~https://github.com/Finn-Lab/EukCC/archive/refs/heads/dev.zip - -ENTRYPOINT ["eukcc"] diff --git a/README.md b/README.md index df8d1c2..7a9e5e3 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,14 @@ ![Coverage.py coverage](badges/coverage.svg) EukCC is a completeness and contamination estimator for metagenomic assembled -microbial eukaryotic genomes. - -With version 2, EukCC should provide a better experience than -version 1. We aim at creating a stable package with long term support. - -**Note**: Version 2 is not compatible with previous versions, most commandline arguments changed. -So version 2 is **not** a drop in replacement. +microbial eukaryotic genomes. ## Documentation Head over to https://eukcc.readthedocs.io/ to check out the documentation. +## Run -## Quickstart - -Here a super fast overview on how to get started using singularity. For more information -please see the documentation. - +### Download EukCC2 database from [FTP](http://ftp.ebi.ac.uk/pub/databases/metagenomics/eukcc/) ``` # create a folder were to keep the database mkdir eukccdb @@ -27,16 +18,9 @@ cd eukccdb wget http://ftp.ebi.ac.uk/pub/databases/metagenomics/eukcc/eukcc2_db_ver_1.2.tar.gz tar -xzvf eukcc2_db_ver_1.2.tar.gz export EUKCC2_DB=$(realpath eukcc2_db_ver_1.2) - -# fetch and launch container -singularity pull docker://quay.io/microbiome-informatics/eukcc - -singularity exec eukcc_latest.sif eukcc single -h ``` -Alternatively you can install EukCC using pip, but we recommend using the container. - -## Get the container +### Quickstart using container Get EukCC quickly by fetching the container. @@ -46,9 +30,19 @@ https://quay.io/repository/microbiome-informatics/eukcc docker pull quay.io/microbiome-informatics/eukcc singularity pull docker://quay.io/microbiome-informatics/eukcc ``` -If you installed version 2: make sure to also fetch the database for version 2: -http://ftp.ebi.ac.uk/pub/databases/metagenomics/eukcc/ +### Bioconda / pip + +Alternatively you can install EukCC using conda or pip. + +In addition, you need to install mandatory requirements: +- metaeuk=4.a0f584d +- pplacer +- epa-ng=0.3.8 +- hmmer=3.3 +- minimap2 +- bwa +- samtools ## Outputs explanation @@ -89,6 +83,11 @@ EukCC also uses metaEUK, hmmer, pplacer, ete3 and epa-ng. ## Changed compared to EukCC 1 +**Note**: +With version 2, EukCC should provide a better experience than +version 1. Version 2 is not compatible with previous versions, most commandline arguments changed. +So version 2 is **not** a drop in replacement. + - Users can set the prevalence threshold for marker sets. In EukCC 1 this was fixed to 98% single copy prevalence. Now users could change that to be more strict. We find that often 100% single copy prevalence can be found. diff --git a/Dockerfile b/docker/Dockerfile similarity index 100% rename from Dockerfile rename to docker/Dockerfile diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8c6820c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,64 @@ +[project] +name = "eukcc" +version = "2.1.3" +readme = "README.md" +license = {text = "GPLv3"} +authors = [ + { name = "Paul Saary", email = "eukcc@paulsaary.de" }, + { name = "MGnify team", email = "metagenomics-help@ebi.ac.uk" }, +] +keywords = ["bioinformatics", "mags", "eukaryotic", "completeness", "contamination"] +description = "Check eukaryotic genomes or MAGs for completeness and contamination" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: Unix", +] + +dependencies = [ + "ete3>=3.1.3", + "numpy>=1.24.4", + "jsonpickle>=4.0.0", + "biopython==1.83", + "pysam==0.21.0", + "six" +] + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = [ + "eukcc", + "scripts", +] + +[project.scripts] +# eukcc +eukcc = "eukcc.__main__:main" +shared_markers = "eukcc.find_markerset:main" +# scripts +binlinks = "scripts.binlinks:main" +filter_euk_bins = "scripts.filter_euk_bins:main" + +[project.optional-dependencies] +tests = [ + "pytest==7.4.0", + "pytest-md==0.2.0", + "pytest-workflow==2.0.1", + "ete3>=3.1.3", + "numpy>=1.24.4", + "jsonpickle>=4.0.0", + "biopython==1.83", + "pysam==0.21.0", + "six" +] + +dev = [ + "pre-commit==3.8.0", + "black==24.8.0", + "flake8==7.1.1", + "pep8-naming==0.14.1" +] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..5ef03b8 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +# pytest.ini +[pytest] +testpaths = tests +required_plugins = pytest-workflow \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d8aebaa..628d9df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,7 @@ -ete3 -six -numpy -jsonpickle +metaeuk==4.a0f584d +pplacer +epa-ng==0.3.8 +hmmer==3.3 +minimap2 +bwa +samtools==1.12