sequana-nanocap 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. sequana_nanocap-0.6.0/LICENSE +29 -0
  2. sequana_nanocap-0.6.0/PKG-INFO +224 -0
  3. sequana_nanocap-0.6.0/README.rst +182 -0
  4. sequana_nanocap-0.6.0/pyproject.toml +53 -0
  5. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/__init__.py +5 -0
  6. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/cluster_config.json +15 -0
  7. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/config.yaml +92 -0
  8. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/dag.png +0 -0
  9. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/dag.svg +190 -0
  10. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/main.py +87 -0
  11. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/multiqc_config.yaml +90 -0
  12. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/nanocap.rules +51 -0
  13. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/requirements.json +10 -0
  14. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/__init__.py +0 -0
  15. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/common.smk +13 -0
  16. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/filtered_mapping.smk +97 -0
  17. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/raw_mapping.smk +73 -0
  18. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/report.smk +27 -0
  19. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/rules/utils.smk +24 -0
  20. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/schema.yaml +84 -0
  21. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/__init__.py +1 -0
  22. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/bam.py +72 -0
  23. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/report.py +230 -0
  24. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/templates/nanocap.css +52 -0
  25. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/templates/nanocap.html +129 -0
  26. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/templates/nanocap.js +35 -0
  27. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/src/templates/sequana_logo.png +0 -0
  28. sequana_nanocap-0.6.0/sequana_pipelines/nanocap/tools.txt +6 -0
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, sequana
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: sequana-nanocap
3
+ Version: 0.6.0
4
+ Summary: Cleaning and control pipeline for adaptive sampling sequencing
5
+ License: BSD-3
6
+ License-File: LICENSE
7
+ Keywords: pacbio,nanopore,snakemake,sequana,adaptative sampling
8
+ Author: Sequana Team
9
+ Author-email: thomas.cokelaer@pasteur.fr
10
+ Requires-Python: >=3.9,<4.0
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: License :: Other/Proprietary License
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
27
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
28
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
29
+ Requires-Dist: Jinja2 (>=3.1.2)
30
+ Requires-Dist: click (>=8.1.7,<9.0.0)
31
+ Requires-Dist: pandas (>=2.0.0)
32
+ Requires-Dist: pulp (>=2.8)
33
+ Requires-Dist: pysam (>=0.22)
34
+ Requires-Dist: rich-click (>=1.7.2,<2.0.0)
35
+ Requires-Dist: sequana (>=0.18.0)
36
+ Requires-Dist: sequana-wrappers (>=26.4.16)
37
+ Requires-Dist: sequana_pipetools (>=0.16.6)
38
+ Requires-Dist: snakemake (>=7.32)
39
+ Project-URL: Repository, https://github.com/sequana/nanocap
40
+ Description-Content-Type: text/x-rst
41
+
42
+ This is the **nanocap** pipeline from the `Sequana <https://sequana.readthedocs.org>`_ project
43
+
44
+ .. image:: https://badge.fury.io/py/sequana-nanocap.svg
45
+ :target: https://pypi.python.org/pypi/sequana_nanocap
46
+
47
+ .. image:: https://github.com/sequana/nanocap/actions/workflows/main.yml/badge.svg
48
+ :target: https://github.com/sequana/nanocap/actions/
49
+
50
+ .. image:: https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg
51
+ :target: https://pypi.python.org/pypi/sequana
52
+ :alt: Python 3.11 | 3.12
53
+
54
+ .. image:: http://joss.theoj.org/papers/10.21105/joss.00352/status.svg
55
+ :target: http://joss.theoj.org/papers/10.21105/joss.00352
56
+ :alt: JOSS (journal of open source software) DOI
57
+
58
+
59
+
60
+ :Overview: Adaptive-sampling nanopore quality control. Maps long reads onto a reference (raw and fastp-filtered), computes per-base coverage with ``sequana_coverage``, and aggregates the results in a ``summary.html`` entry point and a MultiQC report.
61
+ :Input: A directory of single-end FastQ files (``*.fastq.gz``) and a reference FASTA.
62
+ :Output: ``summary.html`` (main entry point), per-sample HTML coverage reports (raw + filtered), a combined ``nanocap.html`` per sample, and a global MultiQC report.
63
+ :Status: production
64
+ :Citation: Cokelaer et al, (2017), 'Sequana': a Set of Snakemake NGS pipelines, Journal of Open Source Software, 2(16), 352, JOSS DOI doi:10.21105/joss.00352
65
+
66
+
67
+ Installation
68
+ ~~~~~~~~~~~~
69
+
70
+ Install the pipeline with pip::
71
+
72
+ pip install sequana_nanocap --upgrade
73
+
74
+ You also need the tools listed in the Requirements section below. The easiest
75
+ way to get them is the bundled conda environment::
76
+
77
+ conda env create -f environment.yml
78
+ conda activate nanocap
79
+
80
+ Apptainer images referenced in ``config.yaml`` are an alternative to installing
81
+ the tools locally — pass ``--apptainer-prefix <dir>`` to ``sequana_nanocap``
82
+ (see Usage).
83
+
84
+
85
+ Usage
86
+ ~~~~~
87
+
88
+ ::
89
+
90
+ sequana_nanocap --help
91
+ sequana_nanocap --input-directory DATAPATH --reference-file reference.fa
92
+
93
+ This creates a working directory with the Snakemake workflow and a generated
94
+ ``config.yaml``. The reference file is copied into the ``references/``
95
+ sub-directory of the working directory (for book keeping) and the pipeline uses
96
+ that copy. Launch the pipeline with::
97
+
98
+ cd nanocap
99
+ bash nanocap.sh # local run (bash, not sh — pipefail is a bashism)
100
+
101
+ To run with apptainer containers (no local tool install needed)::
102
+
103
+ sequana_nanocap --input-directory DATAPATH \
104
+ --reference-file reference.fa \
105
+ --apptainer-prefix ~/.sequana/apptainers
106
+ cd nanocap
107
+ bash nanocap.sh
108
+
109
+ If you are familiar with Snakemake, you can edit the generated files and invoke
110
+ Snakemake directly::
111
+
112
+ snakemake -s nanocap.rules --configfile config.yaml --cores 4 --stats stats.txt
113
+
114
+
115
+ Requirements
116
+ ~~~~~~~~~~~~
117
+
118
+ This pipeline requires the following executables:
119
+
120
+ - fastp
121
+ - graphviz
122
+ - minimap2
123
+ - multiqc
124
+ - samtools
125
+ - sequana_coverage (ships with ``sequana``)
126
+
127
+ All of them can be installed via conda using the bundled ``environment.yml``,
128
+ or pulled on demand via the apptainer images declared in ``config.yaml``.
129
+
130
+ .. image:: https://raw.githubusercontent.com/sequana/nanocap/master/sequana_pipelines/nanocap/dag.png
131
+
132
+
133
+ Details
134
+ ~~~~~~~
135
+
136
+ For each input FastQ the pipeline runs two branches in parallel:
137
+
138
+ 1. **raw** — map reads to the reference with ``minimap2`` (``-ax map-ont``),
139
+ sort with ``samtools``, index, compute per-base depth with ``samtools depth``,
140
+ run ``sequana_coverage`` for ROI detection.
141
+ 2. **filtered** — same flow, after quality/length filtering with ``fastp``
142
+ (defaults: ``-q 0 -e 9 -l 1000``).
143
+
144
+ A per-sample ``{sample}/nanocap.html`` page aggregates both coverage reports
145
+ (with a link back to ``summary.html``), and a top-level
146
+ ``multiqc/multiqc_report.html`` combines the fastp and sequana_coverage outputs
147
+ across all samples.
148
+
149
+ Once the pipeline is finished, open ``summary.html`` in the working directory.
150
+ This is the main entry point. It follows the standard Sequana report layout and
151
+ contains:
152
+
153
+ - an overview with the (relative) path to the reference and a link to the
154
+ MultiQC report;
155
+ - a per-sample table: number of reads before and after fastp filtering,
156
+ percentage of reads kept, number of mapped alignments (raw and filtered), and
157
+ links to the Nanocap, fastp and sequana_coverage (raw and filtered) reports;
158
+ - the workflow (DAG), with links to the Snakemake and configuration files;
159
+ - the dependencies and the command used to set up the pipeline.
160
+
161
+
162
+ Rules and configuration details
163
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164
+
165
+ Here is the `latest documented configuration file <https://raw.githubusercontent.com/sequana/nanocap/master/sequana_pipelines/nanocap/config.yaml>`_
166
+ to be used with the pipeline. Each rule used in the pipeline may have a section
167
+ in the configuration file.
168
+
169
+
170
+ Changelog
171
+ ~~~~~~~~~
172
+
173
+ ========= ====================================================================
174
+ Version Description
175
+ ========= ====================================================================
176
+ 0.6.0 * Add ``summary.html``, the main entry point of the analysis, created
177
+ with the standard Sequana report layout (header, sidebar, DAG,
178
+ config file, dependencies, command, footer). It contains a
179
+ per-sample table (reads before/after fastp, percentage kept, mapped
180
+ alignments) with links to the Nanocap, fastp and sequana_coverage
181
+ reports, and a link to the MultiQC report. It is created in the
182
+ ``onsuccess`` section, which now also calls ``manager.teardown()``
183
+ and ``manager.onerror()`` on failure.
184
+ * Per-sample ``nanocap.html`` reports now use a Sequana-like
185
+ header/footer (logo, versions, citation) and a link back to
186
+ ``summary.html``.
187
+ * The ``--reference-file`` is now copied into the ``references/``
188
+ directory of the working directory when initiating the pipeline;
189
+ the pipeline uses this copy.
190
+ * Declare ``pysam`` explicitly as a dependency (used by the BAM
191
+ metrics).
192
+ * Tests: new tests for the summary, the reference copy and the
193
+ version; tests no longer write in the current directory.
194
+ * CI: remove the unused ``[testing]`` extra, use ``actions/cache@v4``,
195
+ stop echoing the coveralls token, and check that ``summary.html`` is
196
+ created in the apptainer workflow.
197
+ 0.5.0 * Migrate packaging from ``setup.py`` to Poetry (``pyproject.toml``).
198
+ * Replace ``pkg_resources`` with ``importlib.metadata`` in
199
+ ``__init__.py``.
200
+ * Drop ``click_completion``; use ``rich_click``.
201
+ * Convert all rules from ``wrapper:`` directives to
202
+ ``shell: manager.get_shell(...)`` (minimap2, samtools_depth,
203
+ sequana_coverage, multiqc).
204
+ * ``fastp`` rule uses the new ``fastp/run`` v2 shell template which
205
+ supports both single-end and paired-end via ``params.out2``.
206
+ * Add ``sequana_coverage`` section to ``config.yaml`` / ``schema.yaml``
207
+ with the parameters required by the shell template (chunksize,
208
+ thresholds, mixture models, ...).
209
+ * Refresh apptainer URLs: ``sequana_tools_26.1.14`` for
210
+ minimap2+samtools, ``sequana_coverage_0.18.0``,
211
+ ``multiqc_1.27.0``.
212
+ * Add ``localrules: rulegraph, dot2svg, multiqc``.
213
+ * Redirect ``samtools index`` stdout/stderr to ``{log}``.
214
+ * Convert ``mem: "8G"/"16G"`` strings to integer ``mem_mb: 8000/16000``
215
+ resources (avoids snakemake string-mangling).
216
+ * CI: ``micromamba-shell``, ``generate-run-shell: true``, PyPI via
217
+ ``poetry build`` on Python 3.11.
218
+ 0.3.0 * refactoring to use click
219
+ 0.2.0 * add containers
220
+ * Fix tests adding the missing index
221
+ * add workflow for apptainer
222
+ 0.1.0 **First release.**
223
+ ========= ====================================================================
224
+
@@ -0,0 +1,182 @@
1
+ This is the **nanocap** pipeline from the `Sequana <https://sequana.readthedocs.org>`_ project
2
+
3
+ .. image:: https://badge.fury.io/py/sequana-nanocap.svg
4
+ :target: https://pypi.python.org/pypi/sequana_nanocap
5
+
6
+ .. image:: https://github.com/sequana/nanocap/actions/workflows/main.yml/badge.svg
7
+ :target: https://github.com/sequana/nanocap/actions/
8
+
9
+ .. image:: https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg
10
+ :target: https://pypi.python.org/pypi/sequana
11
+ :alt: Python 3.11 | 3.12
12
+
13
+ .. image:: http://joss.theoj.org/papers/10.21105/joss.00352/status.svg
14
+ :target: http://joss.theoj.org/papers/10.21105/joss.00352
15
+ :alt: JOSS (journal of open source software) DOI
16
+
17
+
18
+
19
+ :Overview: Adaptive-sampling nanopore quality control. Maps long reads onto a reference (raw and fastp-filtered), computes per-base coverage with ``sequana_coverage``, and aggregates the results in a ``summary.html`` entry point and a MultiQC report.
20
+ :Input: A directory of single-end FastQ files (``*.fastq.gz``) and a reference FASTA.
21
+ :Output: ``summary.html`` (main entry point), per-sample HTML coverage reports (raw + filtered), a combined ``nanocap.html`` per sample, and a global MultiQC report.
22
+ :Status: production
23
+ :Citation: Cokelaer et al, (2017), 'Sequana': a Set of Snakemake NGS pipelines, Journal of Open Source Software, 2(16), 352, JOSS DOI doi:10.21105/joss.00352
24
+
25
+
26
+ Installation
27
+ ~~~~~~~~~~~~
28
+
29
+ Install the pipeline with pip::
30
+
31
+ pip install sequana_nanocap --upgrade
32
+
33
+ You also need the tools listed in the Requirements section below. The easiest
34
+ way to get them is the bundled conda environment::
35
+
36
+ conda env create -f environment.yml
37
+ conda activate nanocap
38
+
39
+ Apptainer images referenced in ``config.yaml`` are an alternative to installing
40
+ the tools locally — pass ``--apptainer-prefix <dir>`` to ``sequana_nanocap``
41
+ (see Usage).
42
+
43
+
44
+ Usage
45
+ ~~~~~
46
+
47
+ ::
48
+
49
+ sequana_nanocap --help
50
+ sequana_nanocap --input-directory DATAPATH --reference-file reference.fa
51
+
52
+ This creates a working directory with the Snakemake workflow and a generated
53
+ ``config.yaml``. The reference file is copied into the ``references/``
54
+ sub-directory of the working directory (for book keeping) and the pipeline uses
55
+ that copy. Launch the pipeline with::
56
+
57
+ cd nanocap
58
+ bash nanocap.sh # local run (bash, not sh — pipefail is a bashism)
59
+
60
+ To run with apptainer containers (no local tool install needed)::
61
+
62
+ sequana_nanocap --input-directory DATAPATH \
63
+ --reference-file reference.fa \
64
+ --apptainer-prefix ~/.sequana/apptainers
65
+ cd nanocap
66
+ bash nanocap.sh
67
+
68
+ If you are familiar with Snakemake, you can edit the generated files and invoke
69
+ Snakemake directly::
70
+
71
+ snakemake -s nanocap.rules --configfile config.yaml --cores 4 --stats stats.txt
72
+
73
+
74
+ Requirements
75
+ ~~~~~~~~~~~~
76
+
77
+ This pipeline requires the following executables:
78
+
79
+ - fastp
80
+ - graphviz
81
+ - minimap2
82
+ - multiqc
83
+ - samtools
84
+ - sequana_coverage (ships with ``sequana``)
85
+
86
+ All of them can be installed via conda using the bundled ``environment.yml``,
87
+ or pulled on demand via the apptainer images declared in ``config.yaml``.
88
+
89
+ .. image:: https://raw.githubusercontent.com/sequana/nanocap/master/sequana_pipelines/nanocap/dag.png
90
+
91
+
92
+ Details
93
+ ~~~~~~~
94
+
95
+ For each input FastQ the pipeline runs two branches in parallel:
96
+
97
+ 1. **raw** — map reads to the reference with ``minimap2`` (``-ax map-ont``),
98
+ sort with ``samtools``, index, compute per-base depth with ``samtools depth``,
99
+ run ``sequana_coverage`` for ROI detection.
100
+ 2. **filtered** — same flow, after quality/length filtering with ``fastp``
101
+ (defaults: ``-q 0 -e 9 -l 1000``).
102
+
103
+ A per-sample ``{sample}/nanocap.html`` page aggregates both coverage reports
104
+ (with a link back to ``summary.html``), and a top-level
105
+ ``multiqc/multiqc_report.html`` combines the fastp and sequana_coverage outputs
106
+ across all samples.
107
+
108
+ Once the pipeline is finished, open ``summary.html`` in the working directory.
109
+ This is the main entry point. It follows the standard Sequana report layout and
110
+ contains:
111
+
112
+ - an overview with the (relative) path to the reference and a link to the
113
+ MultiQC report;
114
+ - a per-sample table: number of reads before and after fastp filtering,
115
+ percentage of reads kept, number of mapped alignments (raw and filtered), and
116
+ links to the Nanocap, fastp and sequana_coverage (raw and filtered) reports;
117
+ - the workflow (DAG), with links to the Snakemake and configuration files;
118
+ - the dependencies and the command used to set up the pipeline.
119
+
120
+
121
+ Rules and configuration details
122
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123
+
124
+ Here is the `latest documented configuration file <https://raw.githubusercontent.com/sequana/nanocap/master/sequana_pipelines/nanocap/config.yaml>`_
125
+ to be used with the pipeline. Each rule used in the pipeline may have a section
126
+ in the configuration file.
127
+
128
+
129
+ Changelog
130
+ ~~~~~~~~~
131
+
132
+ ========= ====================================================================
133
+ Version Description
134
+ ========= ====================================================================
135
+ 0.6.0 * Add ``summary.html``, the main entry point of the analysis, created
136
+ with the standard Sequana report layout (header, sidebar, DAG,
137
+ config file, dependencies, command, footer). It contains a
138
+ per-sample table (reads before/after fastp, percentage kept, mapped
139
+ alignments) with links to the Nanocap, fastp and sequana_coverage
140
+ reports, and a link to the MultiQC report. It is created in the
141
+ ``onsuccess`` section, which now also calls ``manager.teardown()``
142
+ and ``manager.onerror()`` on failure.
143
+ * Per-sample ``nanocap.html`` reports now use a Sequana-like
144
+ header/footer (logo, versions, citation) and a link back to
145
+ ``summary.html``.
146
+ * The ``--reference-file`` is now copied into the ``references/``
147
+ directory of the working directory when initiating the pipeline;
148
+ the pipeline uses this copy.
149
+ * Declare ``pysam`` explicitly as a dependency (used by the BAM
150
+ metrics).
151
+ * Tests: new tests for the summary, the reference copy and the
152
+ version; tests no longer write in the current directory.
153
+ * CI: remove the unused ``[testing]`` extra, use ``actions/cache@v4``,
154
+ stop echoing the coveralls token, and check that ``summary.html`` is
155
+ created in the apptainer workflow.
156
+ 0.5.0 * Migrate packaging from ``setup.py`` to Poetry (``pyproject.toml``).
157
+ * Replace ``pkg_resources`` with ``importlib.metadata`` in
158
+ ``__init__.py``.
159
+ * Drop ``click_completion``; use ``rich_click``.
160
+ * Convert all rules from ``wrapper:`` directives to
161
+ ``shell: manager.get_shell(...)`` (minimap2, samtools_depth,
162
+ sequana_coverage, multiqc).
163
+ * ``fastp`` rule uses the new ``fastp/run`` v2 shell template which
164
+ supports both single-end and paired-end via ``params.out2``.
165
+ * Add ``sequana_coverage`` section to ``config.yaml`` / ``schema.yaml``
166
+ with the parameters required by the shell template (chunksize,
167
+ thresholds, mixture models, ...).
168
+ * Refresh apptainer URLs: ``sequana_tools_26.1.14`` for
169
+ minimap2+samtools, ``sequana_coverage_0.18.0``,
170
+ ``multiqc_1.27.0``.
171
+ * Add ``localrules: rulegraph, dot2svg, multiqc``.
172
+ * Redirect ``samtools index`` stdout/stderr to ``{log}``.
173
+ * Convert ``mem: "8G"/"16G"`` strings to integer ``mem_mb: 8000/16000``
174
+ resources (avoids snakemake string-mangling).
175
+ * CI: ``micromamba-shell``, ``generate-run-shell: true``, PyPI via
176
+ ``poetry build`` on Python 3.11.
177
+ 0.3.0 * refactoring to use click
178
+ 0.2.0 * add containers
179
+ * Fix tests adding the missing index
180
+ * add workflow for apptainer
181
+ 0.1.0 **First release.**
182
+ ========= ====================================================================
@@ -0,0 +1,53 @@
1
+ [build-system]
2
+ requires = ["poetry-core>=1.0.0"]
3
+ build-backend = "poetry.core.masonry.api"
4
+
5
+ [tool.poetry]
6
+ name = "sequana-nanocap"
7
+ version = "0.6.0"
8
+ description = "Cleaning and control pipeline for adaptive sampling sequencing"
9
+ authors = ["Sequana Team <thomas.cokelaer@pasteur.fr>"]
10
+ license = "BSD-3"
11
+ repository = "https://github.com/sequana/nanocap"
12
+ readme = "README.rst"
13
+ keywords = ["pacbio", "nanopore", "snakemake", "sequana", "adaptative sampling"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Education",
17
+ "Intended Audience :: End Users/Desktop",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: Science/Research",
20
+ "License :: OSI Approved :: BSD License",
21
+ "Operating System :: POSIX :: Linux",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
28
+ "Topic :: Scientific/Engineering :: Information Analysis",
29
+ ]
30
+
31
+ packages = [
32
+ { include = "sequana_pipelines" }
33
+ ]
34
+
35
+ [tool.poetry.dependencies]
36
+ python = ">=3.9,<4.0"
37
+ sequana = ">=0.18.0"
38
+ sequana_pipetools = ">=0.16.6"
39
+ sequana-wrappers = ">=26.4.16"
40
+ snakemake = ">=7.32"
41
+ pulp = ">=2.8"
42
+ click = "^8.1.7"
43
+ rich-click = "^1.7.2"
44
+ pandas = ">=2.0.0"
45
+ pysam = ">=0.22"
46
+ Jinja2 = ">=3.1.2"
47
+
48
+ [tool.poetry.scripts]
49
+ sequana_nanocap = "sequana_pipelines.nanocap.main:main"
50
+
51
+ [tool.poetry.group.dev.dependencies]
52
+ pytest = "^7.4.0"
53
+ pytest-cov = "^4.1.0"
@@ -0,0 +1,5 @@
1
+ import importlib.metadata
2
+
3
+ version = importlib.metadata.version("sequana-nanocap")
4
+
5
+ from .src import create_report, create_summary
@@ -0,0 +1,15 @@
1
+ {
2
+ "__default__": {
3
+ "ram": "4G",
4
+ "time": "fast"
5
+ },
6
+ "fastp": {
7
+ "ram": "8G"
8
+ },
9
+ "raw_mapping": {
10
+ "ram": "16G"
11
+ },
12
+ "filtered_mapping": {
13
+ "ram": "16G"
14
+ }
15
+ }
@@ -0,0 +1,92 @@
1
+ # ============================================================================
2
+ # Config file for Nanocap
3
+ # ==========================================[ Sections for the users ]========
4
+ #
5
+ # One of input_directory, input_pattern and input_samples must be provided
6
+ # If input_directory provided, use it otherwise if input_pattern provided,
7
+ # use it, otherwise use input_samples.
8
+ # ============================================================================
9
+ input_directory: /home/cokelaer/Work/github/forked/sequana_pipelines/nanocap/tests/resources
10
+ input_pattern: '*.fastq.gz'
11
+ # Reference for minimap2
12
+ reference: /home/cokelaer/Work/github/forked/sequana_pipelines/nanocap/tests/resources/vibrio.fa
13
+
14
+
15
+ apptainers:
16
+ fastp: https://zenodo.org/record/17097941/files/fastp_1.0.1.img
17
+ graphviz: https://zenodo.org/record/7928262/files/graphviz_7.0.5.img
18
+ minimap2: https://zenodo.org/record/18257162/files/sequana_tools_26.1.14.img
19
+ multiqc: https://zenodo.org/record/17100751/files/multiqc_1.27.0-zenodo1.img
20
+ samtools: https://zenodo.org/record/18257162/files/sequana_tools_26.1.14.img
21
+ sequana_coverage: https://zenodo.org/record/13946414/files/sequana_coverage_0.18.0.img
22
+
23
+
24
+
25
+ ##############################################################################
26
+ # Fastp used to filter small reads
27
+ # Default options:
28
+ # - `-q 0`: deactivate quality per base filter
29
+ # - `-e 9`: filter read that has mean quality less than 10
30
+ # - `-l 1000`: filter read shorter than 1000 bases
31
+ #
32
+ # :Parameters:
33
+ # - options: any options recognised by `fastp` cli
34
+ #
35
+ fastp:
36
+ threads: 4
37
+ options: -q 0 -e 9 -l 1000
38
+ adapters: ''
39
+ resources:
40
+ mem_mb: 8000
41
+
42
+ ##############################################################################
43
+ # Minimap2
44
+ #
45
+ # :Parameters:
46
+ # - options: any options recognised by `minimap2` cli
47
+ # - threads: Number of threads to use
48
+ minimap2:
49
+ options: -ax map-ont
50
+ threads: 4
51
+
52
+
53
+ raw_mapping:
54
+ resources:
55
+ mem_mb: 16000
56
+
57
+
58
+ filtered_mapping:
59
+ resources:
60
+ mem_mb: 16000
61
+
62
+
63
+ ##############################################################################
64
+ # sequana_coverage detects ROIs on the mapped reads
65
+ #
66
+ # Parameters forwarded to sequana_coverage; see `sequana_coverage --help`.
67
+ sequana_coverage:
68
+ circular: True
69
+ window_size: 20001
70
+ chunksize: 5000000
71
+ double_threshold: 0.5
72
+ gc_window_size: 201
73
+ high_threshold: 4.
74
+ low_threshold: -4.
75
+ mixture_models: 2
76
+ annotation_file: ''
77
+ options: ''
78
+
79
+
80
+ ##############################################################################
81
+ # Multiqc
82
+ #
83
+ # :Parameters:
84
+ # - options: any options recognised by `multiqc` cli
85
+ # - modules: modules needed for the report.
86
+ # - input_directory: where multiqc should look for logs/outputs (default: .)
87
+ # - config_file: optional multiqc config file
88
+ multiqc:
89
+ options: ''
90
+ input_directory: '.'
91
+ config_file: multiqc_config.yaml
92
+ modules: fastp sequana_coverage