Skip to content

Commit

Permalink
Fix the default rRNA
Browse files Browse the repository at this point in the history
  • Loading branch information
cokelaer committed Feb 22, 2024
1 parent 064161e commit b793ac6
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/apptainer.yml
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- dev
workflow_dispatch:
pull_request:
branches-ignore: []
schedule:
Expand Down Expand Up @@ -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
15 changes: 6 additions & 9 deletions .github/workflows/main.yml
Expand Up @@ -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
Expand Down
36 changes: 28 additions & 8 deletions README.rst
Expand Up @@ -30,15 +30,17 @@ 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
~~~~~

::

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::
Expand All @@ -53,6 +55,28 @@ retrieve the pipeline itself and its configuration files and then execute the pi

Or use `sequanix <https://sequana.readthedocs.io/en/main/sequanix.html>`_ 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
~~~~~~~~~~~~

Expand All @@ -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 <https://damona.readthedocs.io>`_::

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions sequana_pipelines/rnaseq/main.py
Expand Up @@ -31,7 +31,7 @@
NAME,
groups={
"Pipeline Specific": [
"--aligner",
"--aligner-choice",
"--contaminant-file",
"--do-igvtools",
"--do-bam-coverage",
Expand Down Expand Up @@ -65,7 +65,7 @@
required=True,
)
@click.option(
"--aligner",
"--aligner-choice",
"aligner",
required=True,
type=click.Choice(["bowtie2", "bowtie1", "star", "salmon"]),
Expand All @@ -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""",
Expand Down
1 change: 0 additions & 1 deletion sequana_pipelines/rnaseq/rnaseq.rules
Expand Up @@ -1218,7 +1218,6 @@ onsuccess:
</p>
"""


# Now the final report. add the original command in the HTML report
data = manager.getmetadata()
s = SequanaReport(data, intro)
Expand Down
16 changes: 8 additions & 8 deletions test/test_main.py
Expand Up @@ -34,7 +34,7 @@ def test_standalone_script():
"--genome-directory",
saccer3,
"--force",
"--aligner",
"--aligner-choice",
"bowtie2",
"--feature-counts-feature-type",
"gene,tRNA",
Expand All @@ -58,7 +58,7 @@ def test_standalone_script_contaminant():
"--genome-directory",
saccer3,
"--force",
"--aligner",
"--aligner-choice",
"bowtie2",
"--feature-counts-feature-type",
"gene",
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_standalone_script_wrong_feature():
"--genome-directory",
saccer3,
"--force",
"--aligner",
"--aligner-choice",
"bowtie2",
"--feature-counts-feature-type",
"dummy",
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_standalone_script_wrong_reference():
"--genome-directory",
"dummy",
"--force",
"--aligner",
"--aligner-choice",
"bowtie2",
"--working-directory",
directory.name,
Expand All @@ -143,7 +143,7 @@ def test_standalone_script_wrong_triming():
"--genome-directory",
saccer3,
"--force",
"--aligner",
"--aligner-choice",
"bowtie2",
"--software-choice",
"dummy",
Expand All @@ -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 "
Expand All @@ -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 "
Expand All @@ -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 "
Expand Down

0 comments on commit b793ac6

Please sign in to comment.