I’m a complete Nextflow beginner and I’m trying to understand the syntax rules for writing different components. I am trying to draw parallels to general programming languages to understand what’s a variable and what’s a process/function. For context, I have made it through section 2.2.2 Run the workflow again. Here’s my confusion: we declare the output under publish as first_output = sayHello.out. This makes first_output look like a variable. Then, inside the output block we write first_output { path '.'}`, which makes first_output look like a process. What is first_output and what exactly are the two scenarios doing to it?
This is admittedly an unusual part of the language. Pipeline outputs are declared in the output block but assigned in the workflow publish: section. So you can think of it like a variable
I think of the output block as one big JSON object containing all of the outputs, so each named output in my mind is like a property of that object
Thanks for the clarification. I guess I was expecting the properties of the object to look more like first_output.path. Is this the only type of block where something like this happens or does this style of assignation and declaration happen in other contexts?
It’s the only one as far as I know. It was designed this way because the output block is essentially configuration, so it would have been ugly to cram the entire thing into the publish: section.