Skip to content

Commit e4ab830

Browse files
authored
Merge pull request #7 from cokelaer/dev
Set the singularity container and fix falco
2 parents 0d7fdf6 + 9e2bfa4 commit e4ab830

File tree

8 files changed

+52
-53
lines changed

8 files changed

+52
-53
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
run: |
3939
# $CONDA is an environment variable pointing to the root of the miniconda directory
4040
echo $CONDA/bin >> $GITHUB_PATH
41-
#conda update ruamel_yaml
4241
4342
- name: conda
4443
run: |

README.rst

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ This is is the **fastqc** pipeline from the `Sequana <https://sequana.readthedoc
2525
Installation
2626
~~~~~~~~~~~~
2727

28-
You must install Sequana first (use --upgrade to get the latest version installed)::
29-
30-
pip install sequana --upgrade
31-
32-
Then, just install this package::
28+
sequana_fastqc is based on Python3, just install the package as follows::
3329

3430
pip install sequana_fastqc --upgrade
3531

32+
You will need third-party software such as fastqc. Please see below for details.
33+
3634
Usage
3735
~~~~~
3836

@@ -47,10 +45,10 @@ To know more about the options (e.g., add a different pattern to restrict the
4745
execution to a subset of the input files, change the output/working directory,
4846
etc)::
4947

50-
sequana_pipelines_fastqc --help
51-
sequana_pipelines_fastqc --input-directory DATAPATH
48+
sequana_fastqc --help
49+
sequana_fastqc --input-directory DATAPATH
5250

53-
This creates a directory **fastq**. You just need to execute the pipeline::
51+
This creates a directory **fastqc**. You just need to execute the pipeline::
5452

5553
cd fastqc
5654
sh fastqc.sh # for a local run
@@ -83,7 +81,7 @@ then, prepare the pipeline::
8381
Just open the HTML entry called summary.html. A multiqc report is also available.
8482
You will get expected images such as the following one:
8583

86-
.. image:: https://github.com/sequana/fastqc/blob/master/doc/summary.png?raw=true
84+
.. image:: https://github.com/sequana/fastqc/blob/main/doc/summary.png?raw=true
8785

8886
Please see the `Wiki <https://github.com/sequana/fastqc/wiki>`_ for more examples and features.
8987

@@ -94,15 +92,17 @@ This pipelines requires the following executable(s):
9492

9593
- fastqc
9694
- falco (optional)
97-
- sequana (Python: pip install sequana)
9895

99-
For Linux users, we provide a singularity image available through damona::
10096

101-
pip install damona
102-
damona install fastqc
103-
# and add the ~/.config/damona/bin path to your binary PATH
97+
For Linux users, we provide singularity images available through within the **damona** project (https://damona.readthedocs.io).
98+
99+
To mak use of them, initiliase the pipeline with the --use-singularity option and everything should be downloaded
100+
automatically for you, which also guarantees reproducibility::
101+
102+
sequana_fastqc --input-directory data --use-singularity
103+
104104

105-
.. image:: https://raw.githubusercontent.com/sequana/fastqc/master/sequana_pipelines/fastqc/dag.png
105+
.. image:: https://raw.githubusercontent.com/sequana/fastqc/main/sequana_pipelines/fastqc/dag.png
106106

107107

108108
Details
@@ -124,14 +124,16 @@ ready-to-use HTML reports, etc
124124
Rules and configuration details
125125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126126

127-
Here is the `latest documented configuration file <https://raw.githubusercontent.com/sequana/fastqc/master/sequana_pipelines/fastqc/config.yaml>`_
127+
Here is the `latest documented configuration file <https://raw.githubusercontent.com/sequana/fastqc/main/sequana_pipelines/fastqc/config.yaml>`_
128128
to be used with the pipeline. Each rule used in the pipeline may have a section in the configuration file.
129129

130130
Changelog
131131
~~~~~~~~~
132132
========= ====================================================================
133133
Version Description
134134
========= ====================================================================
135+
1.6.0 * Fixed falco output error and use singularity containers
136+
1.5.0 * removed modules completely.
135137
1.4.2 * simplified pipeline (suppress setup and use existing wrapper)
136138
1.4.1 * simplified pipeline with wrappers/rules
137139
1.4.0 * This version uses sequana 0.12.0 and new sequana-wrappers

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
sequana>=0.12.1
2-
sequana_pipetools>=0.7.2
2+
sequana_pipetools>=0.9.1

sequana_pipelines/fastqc/config.yaml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,12 @@
1111
input_directory: '.'
1212
input_pattern: '*fastq.gz'
1313

14-
################################################################################
15-
# extra_prefixes_to_strip
16-
#
17-
# In most cases, the input_directory and input_pattern (and input_read_tag for paired analysis)
18-
# allows us to retrieve unique sample names. We automatically removed common prefixes for you.
19-
#
20-
# Sometimes, some prefixes are not common to all samples but still need to be removed
21-
# to get unique sample names or better output. You can provide extra prefixes to be removed
22-
# by uncommenting and filling the field extra_prefixes_to_strip.
23-
#
24-
# For instance, if you have files called prefix.mess.A.fastq.gz and prefix.B.fastq.gz
25-
# 'prefix.' will be removed automatically because it is common, but not 'mess'.
26-
# use thoses prefixes in the left to right order ['prefix', 'mess'] or ['prefix.mess']
27-
#
28-
# extra_prefixes_to_strip: []
2914

30-
31-
################################################################################
32-
# sample_pattern
33-
#
34-
# You may have trailing words that are in sample names but not wanted. Consider
35-
# the filename A_mess.fastq.gz, you can get rid of _mess if it appears in all
36-
# samples using a pattern as follows '{sample}_mess.fastq.gz
37-
#
38-
# uncomment and fill to use this option. Be aware that prefixes are not removed
39-
# if you use sample_pattern
40-
#
41-
# sample_pattern: '{sample}_mess.fastq.gz'
15+
# See sequana_pipetools.readthedocs.io for details about these 2 options
16+
# common prefixes are removed. addition prefixes may be removed here
17+
#extra_prefixes_to_strip = []
18+
# in special cases, sample names can be extracted with a pattern
19+
#sample_pattern: '{sample}.fastq.gz'
4220

4321
##############################################################################
4422
# general section

sequana_pipelines/fastqc/fastqc.rules

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ if 'general' in config and 'method_choice' in config['general'] and \
7676
params:
7777
options=config['falco']['options'],
7878
working_directory="samples/{sample}"
79+
container:
80+
"https://zenodo.org/record/7014954/files/falco_1.0.0.img"
7981
resources:
8082
**config['falco']['resources']
8183
wrapper:
@@ -97,6 +99,8 @@ else:
9799
working_directory="samples/{sample}"
98100
resources:
99101
**config['fastqc']['resources']
102+
container:
103+
"https://zenodo.org/record/7015004/files/fastqc_0.11.9-py3.img"
100104
wrapper:
101105
"main/wrappers/fastqc"
102106
__multiqc__input = expand("samples/{sample}/fastqc.done", sample=manager.samples)
@@ -174,7 +178,7 @@ include: sm.modules['rulegraph']
174178

175179

176180
rule plotting_and_stats:
177-
input: expand("samples/{sample}/" + f"{METHOD}.done", sample=manager.samples)
181+
input: expand("samples/{sample}/" + f"{METHOD}.log", sample=manager.samples)
178182
output: "outputs/summary.png", "outputs/summary.json"
179183
resources:
180184
**config["multiqc"]["resources"]

sequana_pipelines/fastqc/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ def main(args=None):
108108
manager.exists(cfg.input_directory)
109109
# finalise the command and save it; copy the snakemake. update the config
110110
# file and save it.
111-
# Since input can be bam, fast5, mgi, the standard FastQFactory may not
112-
# work, so we only check presence of input files.
113-
manager.teardown(check_fastq_files=False)
111+
manager.teardown()
114112

115113
if options.run:
116114
subprocess.Popen(["sh", '{}.sh'.format(NAME)], cwd=options.workdir)

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
# License: 3-clause BSD
31
from setuptools import setup, find_namespace_packages
42
from setuptools.command.develop import develop
53
from setuptools.command.install import install
64
import subprocess
75

86
_MAJOR = 1
9-
_MINOR = 5
7+
_MINOR = 6
108
_MICRO = 0
119
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
1210
release = '%d.%d' % (_MAJOR, _MINOR)

test/test_main.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_standalone_script():
2626
m.main()
2727

2828

29-
def test_full():
29+
def test_full_fastqc():
3030

3131
with tempfile.TemporaryDirectory() as directory:
3232
wk = directory
@@ -48,3 +48,23 @@ def test_full():
4848
def test_version():
4949
cmd = "sequana_fastqc --version"
5050
subprocess.call(cmd.split())
51+
52+
def test_full_falco():
53+
54+
with tempfile.TemporaryDirectory() as directory:
55+
wk = directory
56+
57+
cmd = "sequana_fastqc --input-directory {} "
58+
cmd += "--working-directory {} --run-mode local --force --method falco"
59+
cmd = cmd.format(sharedir, wk)
60+
subprocess.call(cmd.split())
61+
62+
63+
cmd = "snakemake -s fastqc.rules --wrapper-prefix https://raw.githubusercontent.com/sequana/sequana-wrappers/ -p --cores 2 "
64+
65+
stat = subprocess.call(cmd.split(), cwd=wk)
66+
67+
assert os.path.exists(wk + "/summary.html")
68+
assert os.path.exists(wk + "/tree.html")
69+
assert os.path.exists(wk + "/multiqc/multiqc_report.html")
70+

0 commit comments

Comments
 (0)