nf-core / modules

Repository to host tool-specific module files for the Nextflow DSL2 community!
https://nf-co.re/modules
MIT License
276 stars 691 forks source link

[FEATURE] Deprecate untarfiles #5962

Open maxulysse opened 2 months ago

maxulysse commented 2 months ago

Is your feature request related to a problem? Please describe

We only need untar, and we should be able to drop untarfiles and use some channel logic to get the files and not the folder. cc @mahesh-panchal

map{ archive -> files(archive.resolve("*.ext")) }

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

maxulysse commented 2 months ago

Need to test if this works in the cloud though

mahesh-panchal commented 2 months ago

We could also emit the files too. The issue with publishing (publishDir only publishes the archive) can be handled by the new publish syntax (mostly?).

nextflow.preview.output = true

workflow {
    TASK()
    TASK.out.contents
        .map{ it.findAll{ it.name.endsWith(".ext") } }
        .set{ ext_files }

    publish:
    ext_files >> '.'
}

output {
    directory 'results'
}

process TASK {

    script:
    """
    mkdir archive
    touch archive/sample{1..3}.{ext,txt}
    """

    output:
    path("archive")   , emit: archive
    path("archive/**"), emit: contents
}