add nextflow d30e48d
This commit is contained in:
19
nextflow/docs/snippets/first.nf
Normal file
19
nextflow/docs/snippets/first.nf
Normal file
@@ -0,0 +1,19 @@
|
||||
// no condition is specified, emits the very first item: 1
|
||||
channel.of( 1, 2, 3 )
|
||||
.first()
|
||||
.view()
|
||||
|
||||
// emits the first item matching the regular expression: 'aa'
|
||||
channel.of( 'a', 'aa', 'aaa' )
|
||||
.first( ~/aa.*/ )
|
||||
.view()
|
||||
|
||||
// emits the first String value: 'a'
|
||||
channel.of( 1, 2, 'a', 'b', 3 )
|
||||
.first( String )
|
||||
.view()
|
||||
|
||||
// emits the first item for which the predicate evaluates to true: 4
|
||||
channel.of( 1, 2, 3, 4, 5 )
|
||||
.first { v -> v > 3 }
|
||||
.view()
|
||||
Reference in New Issue
Block a user