|
| 1 | +/* |
| 2 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 3 | + IMPORT MODULES / SUBWORKFLOWS / FUNCTIONS |
| 4 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 5 | +*/ |
| 6 | +include { SHA256SUM_CHECK } from "../../modules/local/sha256sum/main" |
| 7 | +include { MULTIQC } from '../../modules/nf-core/multiqc/main' |
| 8 | +include { paramsSummaryMap } from 'plugin/nf-schema' |
| 9 | +include { paramsSummaryMultiqc } from '../nf-core/utils_nfcore_pipeline' |
| 10 | +include { softwareVersionsToYAML } from '../nf-core/utils_nfcore_pipeline' |
| 11 | +include { methodsDescriptionText } from '../local/utils_nfcore_datasync_pipeline' |
| 12 | + |
| 13 | +/* |
| 14 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 | + RUN MAIN WORKFLOW |
| 16 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 17 | +*/ |
| 18 | + |
| 19 | +workflow CHECKSUM_VERIFY { |
| 20 | + |
| 21 | + take: |
| 22 | + ch_samplesheet // channel: samplesheet read in from --input |
| 23 | + main: |
| 24 | + |
| 25 | + ch_samplesheet.view() |
| 26 | + ch_versions = Channel.empty() |
| 27 | + ch_multiqc_files = Channel.empty() |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + // |
| 32 | + // Collate and save software versions |
| 33 | + // |
| 34 | + softwareVersionsToYAML(ch_versions) |
| 35 | + .collectFile( |
| 36 | + storeDir: "${params.outdir}/pipeline_info", |
| 37 | + name: 'nf_core_' + 'pipeline_software_' + 'mqc_' + 'versions.yml', |
| 38 | + sort: true, |
| 39 | + newLine: true |
| 40 | + ).set { ch_collated_versions } |
| 41 | + |
| 42 | + |
| 43 | + // |
| 44 | + // MODULE: MultiQC |
| 45 | + // |
| 46 | + ch_multiqc_config = Channel.fromPath( |
| 47 | + "$projectDir/assets/multiqc_config.yml", checkIfExists: true) |
| 48 | + ch_multiqc_custom_config = params.multiqc_config ? |
| 49 | + Channel.fromPath(params.multiqc_config, checkIfExists: true) : |
| 50 | + Channel.empty() |
| 51 | + ch_multiqc_logo = params.multiqc_logo ? |
| 52 | + Channel.fromPath(params.multiqc_logo, checkIfExists: true) : |
| 53 | + Channel.empty() |
| 54 | + |
| 55 | + summary_params = paramsSummaryMap( |
| 56 | + workflow, parameters_schema: "nextflow_schema.json") |
| 57 | + ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) |
| 58 | + ch_multiqc_files = ch_multiqc_files.mix( |
| 59 | + ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) |
| 60 | + ch_multiqc_custom_methods_description = params.multiqc_methods_description ? |
| 61 | + file(params.multiqc_methods_description, checkIfExists: true) : |
| 62 | + file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) |
| 63 | + ch_methods_description = Channel.value( |
| 64 | + methodsDescriptionText(ch_multiqc_custom_methods_description)) |
| 65 | + |
| 66 | + ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) |
| 67 | + ch_multiqc_files = ch_multiqc_files.mix( |
| 68 | + ch_methods_description.collectFile( |
| 69 | + name: 'methods_description_mqc.yaml', |
| 70 | + sort: true |
| 71 | + ) |
| 72 | + ) |
| 73 | + |
| 74 | + MULTIQC ( |
| 75 | + ch_multiqc_files.collect(), |
| 76 | + ch_multiqc_config.toList(), |
| 77 | + ch_multiqc_custom_config.toList(), |
| 78 | + ch_multiqc_logo.toList(), |
| 79 | + [], |
| 80 | + [] |
| 81 | + ) |
| 82 | + |
| 83 | + emit:multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html |
| 84 | + versions = ch_versions // channel: [ path(versions.yml) ] |
| 85 | + |
| 86 | +} |
| 87 | + |
| 88 | +/* |
| 89 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 90 | + THE END |
| 91 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 92 | +*/ |
0 commit comments