Hi! I'm trying to publish the samplesheet into the...
# nostupidquestions
a
Hi! I'm trying to publish the samplesheet into the output directory. I thought this would be simple, but nothing I've tried worked 😞 Lately I've tried with Workflow outputs and add this to the main workflow, but it doesn't seem to do anything (and yes, I've checked, I'm using nextflow 25.10). What am I doing wrong?
Copy code
...
    publish:
    samplesheet_file = Channel.fromPath(params.input)
}

output {
    samplesheet_file {
    }
}
n
I do this with
file(params.input).copyTo(<location>)
. the workflow output definitions only work on files located in the work directory
m
Can confirm. Publishing only seems to work from work directories.
Copy code
params.input = 'input.csv'

workflow {
    main:
    samplesheet = channel.fromPath(params.input, checkIfExists: true)
    TASK(samplesheet).view()

    publish:
    in_samplesheet = TASK.out
}

output {
    in_samplesheet {
        mode 'copy'
        path 'input_samplesheet'
    }
}

process TASK {
    input:
    path thing

    script:
    """
    echo "${thing}"
    """

    output:
    path thing, includeInputs: true
}
a
I see,
copyTo
did the trick, thanks for the help!
🎉 1