1

I have a pipeline with two processes. I want to pass the results files of the first process used by the second process and save the output files in a separate directory for each of the files:

process one {
.
.

    output:
    file "split.*.json" into groups
.
.

}

process two {
.
.
    publishDir params.output_path + "/exec_logs/train/${split.baseName}", mode: 'copy'


    input:
    set split from groups.flatten()

    output:
    file ".command.out"
    file ".command.err"
.
.
    """
    echo $split
    """
}

When I try the run the pipeline I get the following error: No such variable: split in the publishDir ... line, but I have access to the split variable in the run section.

How can I get access to the split variable in the publishDir?

Thanks

1 Answer 1

1

I think the problem is actually the string concatenation. Try supplying instead a single GString:

publishDir "${params.output_path}/exec_logs/train/${split.baseName}", mode: 'copy'

For the example above, ensure also that the 'split' variable is provided using the path qualifier:

input:
path split from groups.flatten()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.