Hi, I'm updating nf-core/hic and ran into a MultiQ...
# help
t
Hi, I'm updating nf-core/hic and ran into a MultiQC integration issue. It used to be called like this:
Copy code
MULTIQC (
    ch_multiqc_files.collect(),
    ch_multiqc_config.toList(),
    ch_multiqc_custom_config.toList(),
    ch_multiqc_logo.toList(),
    [],
    []
)
But now the module expect a tuple structured like this:
Copy code
tuple val(meta), path(multiqc_files, stageAs: "?/*"), path(multiqc_config), path(extra_multiqc_config), path(multiqc_logo), path(replace_names), path(sample_names)
How should I construct the tuple from my existing channels to match this new structure?
m
Hi Thibault, I have the solution for you
👀 1
It's coming with the new TEMPLATE
Copy code
ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)

    def ch_summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json")
    def ch_workflow_summary = channel.value(paramsSummaryMultiqc(ch_summary_params))
    ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))

    def ch_multiqc_custom_methods_description = multiqc_methods_description
        ? file(multiqc_methods_description, checkIfExists: true)
        : file("${projectDir}/assets/methods_description_template.yml", checkIfExists: true)
    def ch_methods_description = channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description))
    ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: true))

    MULTIQC(
        ch_multiqc_files.flatten().collect().map { files ->
            [
                [id: '{{ short_name }}'],
                files,
                multiqc_config
                    ? file(multiqc_config, checkIfExists: true)
                    : file("${projectDir}/assets/multiqc_config.yml", checkIfExists: true),
                multiqc_logo ? file(multiqc_logo, checkIfExists: true) : [],
                [],
                [],
            ]
        }
    )

    emit:
    multiqc_report = MULTIQC.out.report.map { _meta, report -> [report] }.toList() // channel: /path/to/multiqc_report.html
check #C05785S3TMX for a good example close to the template
t
Hi @Maxime Garcia, thank you for your help! I tried to adapt hic.nf to follow the template :
Copy code
ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)

    def ch_summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json")
    def ch_workflow_summary = channel.value(paramsSummaryMultiqc(ch_summary_params))
    ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))

    def ch_multiqc_custom_methods_description = params.multiqc_methods_description
        ? file(params.multiqc_methods_description, checkIfExists: true)
        : file("${projectDir}/assets/methods_description_template.yml", checkIfExists: true)
    def ch_methods_description = channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description))
    ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: true))

    if (params.processing == 'hicpro'){
        ch_multiqc_files = ch_multiqc_files.mix(HICPRO.out.mqc)
    }

    MULTIQC(
        ch_multiqc_files.flatten().collect().map { files ->
            [
                [id: '{{ hic }}'],
                files,
                params.multiqc_config
                    ? file(params.multiqc_config, checkIfExists: true)
                    : file("${projectDir}/assets/multiqc_config.yml", checkIfExists: true),
                params.multiqc_logo ? file(params.multiqc_logo, checkIfExists: true) : [],
                [],
                [],
            ]
        }
    )

    emit:
    multiqc_report = MULTIQC.out.report.map { _meta, report -> [report] }.toList() // channel: /path/to/multiqc_report.html
But I still get this error:
Copy code
Handling unexpected condition for task: name=NFCORE_HIC:HIC:MULTIQC; work-dir=null
  error [nextflow.exception.ProcessUnrecoverableException]: Path value cannot contain a new-line character: Workflow:
    nf-core/hic: v2.2.0dev
    Nextflow: 25.10.4
Is there a syntax issue I'm missing?
m
I'll try to have a look at your PR
t
Thank you!
I think I found the issue.
m
Good, as far as I can tell, issue seems to be with the versions handling
It takes a while to re-run the tests
I'd recommend to run just the profile test via nextflow with resume, that way you get quicker to the issue
👍 1
I think I got it too
t
The
ch_collated_versions.collectFile...
was missing right? (I pushed a fix)
m
yeah, that was it
good catch
t
Thanks again for your help