-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.nf
More file actions
executable file
·35 lines (29 loc) · 824 Bytes
/
example.nf
File metadata and controls
executable file
·35 lines (29 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env nextflow
import static tidynf.TidyMethods.*
tidynf()
workflow.onComplete { println 'done.' }
left = Channel.from([
['a', 1, '/file/path/1.bam'],
['b', 2, '/file/path/2.bam'],
['b', 3, '/file/path/3.bam'],
['c', 4, '/file/path/4.bam'],
['c', 5, '/file/path/5.bam'],
['c', 6, '/file/path/6.bam']])
.set_names('id', 'value', 'bam')
.mutate { bam = file(bam) }
.group_by('id')
.mutate { n = value.size() }
.unnest()
right = Channel.from([
['a', 'foo'],
['b', 'bar'],
['c', 'baz'],
['d', 'zum']])
.set_names('id', 'var')
left.inner_join(right, 'id')
.collect_cols()
.arrange('id', 'value')
.unnest()
.select('id', 'value', 'var', 'n', 'bam')
.collect_rows()
.subscribe { println it.collect { it.toString() }.join('\n') }