From b793ac6e218c9849ae58827e4e8099fd773c990d Mon Sep 17 00:00:00 2001 From: Thomas Cokelaer Date: Thu, 22 Feb 2024 15:03:32 +0100 Subject: [PATCH] Fix the default rRNA --- .github/workflows/apptainer.yml | 4 ++- .github/workflows/main.yml | 15 +++++------ README.rst | 36 +++++++++++++++++++++------ pyproject.toml | 2 +- sequana_pipelines/rnaseq/main.py | 5 ++-- sequana_pipelines/rnaseq/rnaseq.rules | 1 - test/test_main.py | 16 ++++++------ 7 files changed, 49 insertions(+), 30 deletions(-) diff --git a/.github/workflows/apptainer.yml b/.github/workflows/apptainer.yml index 25f8ca2..7323c88 100644 --- a/.github/workflows/apptainer.yml +++ b/.github/workflows/apptainer.yml @@ -5,6 +5,7 @@ on: branches: - main - dev + workflow_dispatch: pull_request: branches-ignore: [] schedule: @@ -49,9 +50,10 @@ jobs: - name: install package itself run: | pip install . + pip install "pulp==2.7.0" --no-deps - name: testing run: | - sequana_rnaseq --aligner bowtie2 --input-directory test/data/ --use-apptainer --genome-directory test/data/Saccer3 && cd rnaseq && sh rnaseq.sh + sequana_rnaseq --aligner-choice bowtie2 --input-directory test/data/ --use-apptainer --genome-directory test/data/Saccer3 && cd rnaseq && sh rnaseq.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4348c24..9bd9113 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,28 +31,25 @@ jobs: uses: actions/checkout@v2 - name: conda/mamba - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/provision-with-micromamba@main with: - micromamba-version: '1.3.1-0' environment-file: environment.yml - create-args: | + extra-specs: | python=${{ matrix.python }} - cache-environment: true - cache-downloads: true - - name: install package itself - shell: bash -el {0} + shell: bash -l {0} run: | pip install . + pip install "pulp==2.7.0" --no-deps - name: Install dependencies - shell: bash -el {0} + shell: bash -l {0} run: | pip install coveralls pytest-cov pytest pytest-xdist - name: testing - shell: bash -el {0} + shell: bash -l {0} run: | pytest -v --cov-report term-missing --cov=sequana_pipelines.rnaseq diff --git a/README.rst b/README.rst index c9683d0..e96bc96 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,9 @@ Installation pip install sequana_rnaseq --upgrade -You will need third-party software such as bowtie2/star. Please see below for details. +You will need third-party software such as bowtie2/star. However, if you choose to use aptainer/singularity, +then nothing to install except singularity itself ! See below for details. + Usage ~~~~~ @@ -38,7 +40,7 @@ Usage :: sequana_rnaseq --help - sequana_rnaseq --input-directory DATAPATH --genome-directory genome --aligner star + sequana_rnaseq --input-directory DATAPATH --genome-directory genome --aligner-choice star This creates a directory with the pipeline and configuration file. You will then need to execute the pipeline:: @@ -53,6 +55,28 @@ retrieve the pipeline itself and its configuration files and then execute the pi Or use `sequanix `_ interface. + +Usage with apptainer: +~~~~~~~~~~~~~~~~~~~~~~~~~ + +With apptainer, initiate the working directory as follows:: + + sequana_rnaseq --use-apptainer + +Images are downloaded in the working directory but you can store then in a directory globally (e.g.):: + + sequana_rnaseq --use-apptainer --apptainer-prefix ~/.sequana/apptainers + +and then:: + + cd rnaseq + sh rnaseq.sh + +if you decide to use snakemake manually, do not forget to add apptainer options:: + + snakemake -s rnaseq.rules -c config.yaml --cores 4 --use-apptainer --apptainer-prefix ~/.sequana/apptainers --apptainer-args "-B /home:/home" + + Requirements ~~~~~~~~~~~~ @@ -67,8 +91,7 @@ may change. A Message will inform you would you be missing an executable: - multiqc - samtools -Note that bowtie>=2.4.2 is set to ensure the pipeline can be used with python 3.7-3.8-3.9 and the sequana-wrappers -that supports bowtie2 with option --threads only (not previous versions). See environment.yaml or conda.yaml for latest list of required third-party tools. +Note that bowtie>=2.4.2 is set to ensure the pipeline can be used with python 3.7-3.8-3.9 and the sequana-wrappers that supports bowtie2 with option --threads only (not previous versions). See environment.yaml or conda.yaml for latest list of required third-party tools. You can install most of the tools using `damona `_:: @@ -89,10 +112,6 @@ all dependencies for you:: For Linux users, we provide singularity images available through within the damona project (https://damona.readthedocs.io). -To use apptainer, initialise the pipeline with the --use-singularity option and everything should be downloaded automatically for you, which also guarantees reproducibility: - - sequana_rnaseq --input-directory data --use-singularity --genome-directory .... - .. image:: https://raw.githubusercontent.com/sequana/sequana_rnaseq/main/sequana_pipelines/rnaseq/dag.png @@ -158,6 +177,7 @@ Changelog ========= ==================================================================== Version Description ========= ==================================================================== +0.19.3 * fix regression with click to set the default rRNA to 'rRNA' again. 0.19.2 * fix bowtie1 regression in the log file, paired end case in multiqc and rnadiff script (regression) * set genome directory default to None to enforce its usage diff --git a/pyproject.toml b/pyproject.toml index ddbe749..904a29e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "sequana-rnaseq" -version = "0.19.2" +version = "0.19.3" description = "A RNAseq pipeline from raw reads to feature counts" authors = ["Sequana Team"] license = "BSD-3" diff --git a/sequana_pipelines/rnaseq/main.py b/sequana_pipelines/rnaseq/main.py index c3689f6..ef10f35 100755 --- a/sequana_pipelines/rnaseq/main.py +++ b/sequana_pipelines/rnaseq/main.py @@ -31,7 +31,7 @@ NAME, groups={ "Pipeline Specific": [ - "--aligner", + "--aligner-choice", "--contaminant-file", "--do-igvtools", "--do-bam-coverage", @@ -65,7 +65,7 @@ required=True, ) @click.option( - "--aligner", + "--aligner-choice", "aligner", required=True, type=click.Choice(["bowtie2", "bowtie1", "star", "salmon"]), @@ -74,6 +74,7 @@ @click.option( "--rRNA-feature", "rRNA", + default="rRNA", help="""Feature name corresponding to the rRNA to be identified in the input GFF/GTF files. Must exist and be valid. If you do not have any, you may skip this step using --skip-rRNA or provide a fasta file using --contaminant-file""", diff --git a/sequana_pipelines/rnaseq/rnaseq.rules b/sequana_pipelines/rnaseq/rnaseq.rules index 7bbe3b2..71a5592 100644 --- a/sequana_pipelines/rnaseq/rnaseq.rules +++ b/sequana_pipelines/rnaseq/rnaseq.rules @@ -1218,7 +1218,6 @@ onsuccess:

""" - # Now the final report. add the original command in the HTML report data = manager.getmetadata() s = SequanaReport(data, intro) diff --git a/test/test_main.py b/test/test_main.py index 34bcf90..a61e336 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -34,7 +34,7 @@ def test_standalone_script(): "--genome-directory", saccer3, "--force", - "--aligner", + "--aligner-choice", "bowtie2", "--feature-counts-feature-type", "gene,tRNA", @@ -58,7 +58,7 @@ def test_standalone_script_contaminant(): "--genome-directory", saccer3, "--force", - "--aligner", + "--aligner-choice", "bowtie2", "--feature-counts-feature-type", "gene", @@ -89,7 +89,7 @@ def test_standalone_script_wrong_feature(): "--genome-directory", saccer3, "--force", - "--aligner", + "--aligner-choice", "bowtie2", "--feature-counts-feature-type", "dummy", @@ -117,7 +117,7 @@ def test_standalone_script_wrong_reference(): "--genome-directory", "dummy", "--force", - "--aligner", + "--aligner-choice", "bowtie2", "--working-directory", directory.name, @@ -143,7 +143,7 @@ def test_standalone_script_wrong_triming(): "--genome-directory", saccer3, "--force", - "--aligner", + "--aligner-choice", "bowtie2", "--software-choice", "dummy", @@ -165,7 +165,7 @@ def test_full(): with tempfile.TemporaryDirectory() as directory: wk = directory - cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner bowtie2 --working-directory {wk} --force" + cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner-choice bowtie2 --working-directory {wk} --force" subprocess.call(cmd.split()) cmd = "snakemake -s rnaseq.rules --wrapper-prefix https://raw.githubusercontent.com/sequana/sequana-wrappers/ -p --cores 2 " @@ -182,7 +182,7 @@ def test_full_star(): with tempfile.TemporaryDirectory() as directory: wk = directory - cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner star --working-directory {wk} --force" + cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner-choice star --working-directory {wk} --force" subprocess.call(cmd.split()) cmd = "snakemake -s rnaseq.rules --wrapper-prefix https://raw.githubusercontent.com/sequana/sequana-wrappers/ -p --cores 2 " @@ -199,7 +199,7 @@ def __test_full_salmon(): with tempfile.TemporaryDirectory() as directory: wk = directory - cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner salmon --working-directory {wk} --force" + cmd = f"sequana_rnaseq --input-directory {sharedir} --genome-directory {saccer3} --aligner-choice salmon --working-directory {wk} --force" subprocess.call(cmd.split()) cmd = "snakemake -s rnaseq.rules --wrapper-prefix https://raw.githubusercontent.com/sequana/sequana-wrappers/ -p --cores 2 "