Channel operator that returns count of elements so far. #5355
Closed
siddharthab
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
There is a scan operator in nf-boost if you'd like to try it. At some point I plan to merge it into Nextflow but it might be a while |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the reduce operator returns the final accumulated value, but a channel of the intermediate values would also be useful. A simplest use case could be to return the count of items processed so far.
This is similar to the
scan
function in the under-preview recursion features, but is based on Groovy closures alone.I imagine people currently do something like the below, but I am not sure if the increments to num_items needs to be synchronized or if only a single thread ever touches the variable.
Beta Was this translation helpful? Give feedback.
All reactions