Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of multiqc report generation for the V1 report #221

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
report_comment: >
This report has been generated by the <a href="https://github.com/TORCH-Consortium/MAGMA" target="_blank">TORCH-Consortium/MAGMA</a>
analysis pipeline.

export_plots: false

disable_version_detection: true

## Module order
top_modules:
- "fastqc"
- custom_content


custom_data:
cohort_qc:
section_name: 'Cohort Quality control'
plot_type: 'table'
id: 'cohort_qc'
pconfig:
id: 'cohort_qc'
namespace: "Cohort Quality Control"

distance_matrix:
section_name: "SNP Distance Matrix"
plot_type: 'heatmap'
id: 'distance_matrix'
pconfig:
id: 'distance_matrix'
max: 30
min: 0
tt_decimals: 0
sp:
cohort_qc:
fn: "joint.merged_cohort_stats.tsv"
distance_matrix:
fn: "joint.ExDR.ExComplex.snp_dists.tsv"
6 changes: 4 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ workflow {
UTILS_MERGE_COHORT_STATS.out.merged_cohort_stats_ch,
MERGE_WF.out.major_variants_results_ch,
MINOR_VARIANTS_ANALYSIS_WF.out.minor_variants_results_ch,
STRUCTURAL_VARIANTS_ANALYSIS_WF.out.structural_variants_results_ch )

STRUCTURAL_VARIANTS_ANALYSIS_WF.out.structural_variants_results_ch,
MERGE_WF.out.snps_dists_ch
)

}
}
}
9 changes: 8 additions & 1 deletion modules/multiqc/multiqc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ process MULTIQC {
label 'cpu_4_memory_16'

input:
path(multiqc_config)
path("*")

output:
tuple path("multiqc_data"), path("multiqc_report.html")


script:
def config = multiqc_config ? "--config $multiqc_config" : ''

//FIXME @davi
def process_inputs = '' // !params.skip_merge_analysis ? 'preprocess.py --param 1 --param 2' : ''

"""
${params.multiqc_path} .
${process_inputs}

${params.multiqc_path} $config .
"""

stub:
Expand Down
1 change: 1 addition & 0 deletions modules/snpdists/snpdists.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ process SNPDISTS {

output:
tuple val(joint_name), path("*.snp_dists.tsv")
path("*snp_dists.tsv"), emit: snp_dists_file

script:

Expand Down
3 changes: 1 addition & 2 deletions workflows/merge_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,5 @@ workflow MERGE_WF {

emit:
major_variants_results_ch = MAJOR_VARIANT_ANALYSIS.out.major_variants_results_ch


snps_dists_ch = PHYLOGENY_ANALYSIS__EXCOMPLEX.out.snp_dists_ch
}
14 changes: 12 additions & 2 deletions workflows/reports_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ workflow REPORTS_WF {
major_variants_results_ch
minor_variants_results_ch
structural_variants_results_ch
snp_distances_ch

main:
MULTIQC(reports_fastqc_ch)

ch_multiqc_files = Channel.empty()

UTILS_SUMMARIZE_RESISTANCE_RESULTS(
UTILS_SUMMARIZE_RESISTANCE_RESULTS(
merged_cohort_stats_ch,
major_variants_results_ch,
minor_variants_results_ch,
Expand All @@ -28,6 +30,14 @@ workflow REPORTS_WF {
minor_variants_results_ch,
structural_variants_results_ch
)
ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true)

ch_multiqc_files = ch_multiqc_files.mix(
reports_fastqc_ch,
merged_cohort_stats_ch,
snp_distances_ch
)

MULTIQC(ch_multiqc_config,
ch_multiqc_files.collect())
}
2 changes: 1 addition & 1 deletion workflows/subworkflows/phylogeny_analysis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ workflow PHYLOGENY_ANALYSIS {

emit:
snpsites_tree_tuple = SNPSITES.out.join(IQTREE.out.tree_tuple)

snp_dists_ch = SNPDISTS.out.snp_dists_file
}