Skip to content

Commit e0f0445

Browse files
committed
Merge branch 'master' of github.com:paoloditommaso/nextflow
2 parents fd37bc1 + 7579d9a commit e0f0445

File tree

9 files changed

+402
-120
lines changed

9 files changed

+402
-120
lines changed

docs/doctests/choice.nf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source = Channel.from 'Hello world', 'Hola', 'Hello John'
2+
queue1 = Channel.create()
3+
queue2 = Channel.create()
4+
5+
source.choice(queue1, queue2) { a -> a =~ /^Hello.*/ ? 0 : 1 }
6+
7+
queue1.subscribe { println it }

docs/doctests/count.nf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Channel
2+
.from(4,1,7,1,1)
3+
.count(1)
4+
.subscribe { println "literal $it" }
5+
// -> 3
6+
7+
Channel
8+
.from('a','c','c','q','b')
9+
.count ( ~/c/ )
10+
.subscribe { println "regexp: $it" }
11+
// -> 2
12+
13+
Channel
14+
.from('a','c','c','q','b')
15+
.count { it <= 'c' }
16+
.subscribe { println "predicate: $it" }

docs/doctests/cross.nf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
source = Channel.from( [1, 'alpha'], [2, 'beta'] )
3+
target = Channel.from( [1, 'x'], [1, 'y'], [1, 'z'], [2,'p'], [2,'q'], [2,'t'] )
4+
5+
target.cross(source).subscribe { println it }

docs/doctests/route.nf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
r1 = Channel.create()
2+
r2 = Channel.create()
3+
r3 = Channel.create()
4+
5+
Channel
6+
.from('hello','ciao','hola', 'hi', 'x', 'bonjour')
7+
.route ( b: r1, c: r2, h: r3 ) { it[0] }
8+
9+
r3.subscribe { println it }

docs/doctests/sepa.nf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
queue1 = Channel.create()
2+
queue2 = Channel.create()
3+
4+
Channel
5+
.from ( 2,4,8 )
6+
.separate( queue1, queue2 ) { a -> [a+1, a*a] }
7+
8+
queue1.subscribe { println "Channel 1: $it" }
9+
queue2.subscribe { println "Channel 2: $it" }

docs/doctests/sum.nf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Channel
2+
.from( 4, 1, 7, 5 )
3+
.sum { it * it }
4+
.subscribe { println "Square: $it" }

0 commit comments

Comments
 (0)