Skip to content

Commit

Permalink
Merge pull request #11 from cokelaer/dev
Browse files Browse the repository at this point in the history
Use new rulegraph wrapper and graphviz apptainer
  • Loading branch information
cokelaer committed May 17, 2023
2 parents 42ca6d5 + 3ae26ba commit 97e2566
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.rst
Expand Up @@ -132,6 +132,8 @@ Changelog
========= ====================================================================
Version Description
========= ====================================================================
1.7.0 * Use new rulegraph wrapper and new graphviz apptainer
1.6.2 * slight refactorisation to use rulegraph wrapper
1.6.1 * pin sequana version to 1.4.4 to force usage of new fastqc module
to fix falco. Updated config documentation.
1.6.0 * Fixed falco output error and use singularity containers
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,2 +1,2 @@
sequana>=0.14.4
sequana_pipetools>=0.9.1
sequana_pipetools>=0.12.2
8 changes: 7 additions & 1 deletion sequana_pipelines/fastqc/config.yaml
Expand Up @@ -18,12 +18,18 @@ input_pattern: '*fastq.gz'
# in special cases, sample names can be extracted with a pattern
#sample_pattern: '{sample}.fastq.gz'


apptainers:
falco: "https://zenodo.org/record/7014954/files/falco_1.0.0.img"
fastqc: "https://zenodo.org/record/7923780/files/fastqc_0.12.1.img"
graphviz: "https://zenodo.org/record/7928262/files/graphviz_7.0.5.img"


##############################################################################
# general section
#
# Choose one of the standard method to perform QC of your fastq data
#
# method_choice__ = ['fastqc', 'falco']
general:
method_choice: fastqc

Expand Down
49 changes: 36 additions & 13 deletions sequana_pipelines/fastqc/fastqc.rules
Expand Up @@ -27,6 +27,8 @@ configfile: "config.yaml"

manager = PipelineManager("fastqc", config)

sequana_wrapper_branch = "main"

# This is just for information. Not used in the pipeline but only for HTML rpeort
# do we have illumina paired data with tag _R1_ ?
R1 = [1 for x in manager.samples.values() if "_R1_" in x.split("/")[-1]]
Expand Down Expand Up @@ -67,8 +69,10 @@ if 'general' in config and 'method_choice' in config['general'] and \
METHOD = "falco"

rule falco:
input: manager.getrawdata()
output: "samples/{sample}/summary.txt"
input:
manager.getrawdata()
output:
"samples/{sample}/summary.txt"
log:
"samples/{sample}/falco.log"
threads:
Expand All @@ -77,19 +81,21 @@ if 'general' in config and 'method_choice' in config['general'] and \
options=config['falco']['options'],
working_directory="samples/{sample}"
container:
"https://zenodo.org/record/7014954/files/falco_1.0.0.img"
config['apptainers']['falco']
resources:
**config['falco']['resources']
wrapper:
"main/wrappers/falco"
f"{sequana_wrapper_branch}/wrappers/falco"
__multiqc__input = expand("samples/{sample}/summary.txt", sample=manager.samples)

else:
METHOD = "fastqc"

rule fastqc:
input: manager.getrawdata()
output: "samples/{sample}/fastqc.done"
input:
manager.getrawdata()
output:
"samples/{sample}/fastqc.done"
log:
"samples/{sample}/fastqc.log"
threads:
Expand All @@ -100,9 +106,9 @@ else:
resources:
**config['fastqc']['resources']
container:
"https://zenodo.org/record/7015004/files/fastqc_0.11.9-py3.img"
config['apptainers']['fastqc']
wrapper:
"main/wrappers/fastqc"
f"{sequana_wrapper_branch}/wrappers/fastqc"
__multiqc__input = expand("samples/{sample}/fastqc.done", sample=manager.samples)


Expand Down Expand Up @@ -170,11 +176,28 @@ if config['multiqc']['do']:
"main/wrappers/multiqc"


# ====================================================================== rulegraph
sequana_rulegraph_mapper = {}
if config['multiqc']['do']:
sequana_rulegraph_mapper["multiqc"] = "../multiqc/multiqc_report.html"
include: sm.modules['rulegraph']
# ====================================================================== rulegraph

rule rulegraph:
input: str(manager.snakefile)
output:
svg = "rulegraph/rulegraph.dot"
params:
mapper = {"multiqc": "../multiqc/multiqc_report.html"} if config['multiqc']['do'] else {},
configname = "config.yaml"
wrapper:
f"{sequana_wrapper_branch}/wrappers/rulegraph"


rule dot2svg:
input:
"rulegraph/rulegraph.dot"
output:
".sequana/rulegraph.svg"
container:
config['apptainers']['graphviz']
shell:
"""dot -Tsvg {input} -o {output}"""


rule plotting_and_stats:
Expand Down
3 changes: 3 additions & 0 deletions sequana_pipelines/fastqc/schema.yaml
Expand Up @@ -23,6 +23,9 @@ mapping:
"resources":
type: any
required: true
"apptainers":
type: any


"multiqc":
type: map
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -4,8 +4,8 @@
import subprocess

_MAJOR = 1
_MINOR = 6
_MICRO = 1
_MINOR = 7
_MICRO = 0
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release = '%d.%d' % (_MAJOR, _MINOR)

Expand Down

0 comments on commit 97e2566

Please sign in to comment.