-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
63 lines (53 loc) · 1.74 KB
/
main.nf
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env nextflow
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Medaka behaviour pilot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author: Saul Pierotti
Mail: [email protected]
----------------------------------------------------------------------------------------
*/
nextflow.enable.dsl=2
include { PREPROCESSING } from './subworkflows/preprocessing'
include { TRACKING } from './subworkflows/tracking'
include { HMM } from './subworkflows/hmm'
workflow TRACK_VIDEOS {
Channel.fromPath ( params.input_tracking )
.splitCsv ( header: true )
.map { [it, it.video] }
.set { in_vid_ch }
PREPROCESSING ( in_vid_ch )
TRACKING ( PREPROCESSING.out.split_videos, PREPROCESSING.out.raw_videos )
}
workflow RUN_HMM {
// this is voluntarily decoupled from the tracking
Channel.fromPath ( params.input_hmm )
.splitCsv ( header: true )
.map { [ it.id, it ] }
.set { traj }
Channel.fromPath ( params.split_vids )
.splitCsv ( header: true )
.map { [ it.id, it.video ] }
.set { split_vids }
Channel.fromPath ( params.tracking_stats )
.splitCsv ( header: true )
.map { [ it.id, it ] }
.set { stats }
traj.join ( stats, by: 0, failOnDuplicate: true, failOnMismatch: true )
.map {
key, traj_map, stat_map ->
def meta = [
id: key,
fps: stat_map.fps,
]
[ meta, traj_map.traj_file ]
}
.set { traj }
HMM ( traj, split_vids )
}
workflow {
// workflows are decoupled, just comment out what you don't want to run
// and provide input files appropriately, it is easier and more modular
//TRACK_VIDEOS()
RUN_HMM()
}