-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyphy_analyses.nf
56 lines (47 loc) · 1.35 KB
/
hyphy_analyses.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
/*
HyPhy development pipeline pipeline
This workflow is designed to run 'HyPhy analyses' pipelines, which are custom written pipelines
that extend the default HyPhy methods.
* 1. Get codon MSAs
* 2. Match MSAs with tree
* 3. Run BUSTED-PH for each gene
*/
// Import pipeline modules
include { busted_ph } from '../nf-modules/hyphy_analyses/16bc859/busted_ph'
// Sub-workflow
workflow HYPHY_ANALYSES {
main:
// Get MSA fasta files
Channel
.fromFilePairs(
[params.msa.path, params.msa.pattern].join('/'),
size: params.msa.nfiles,
)
.ifEmpty { exit 1, "Can't find MSA files." }
.set { ch_msa }
// Get tree file
Channel
.fromPath(
params.tree
)
.ifEmpty { exit 1, "Can't import tree file" }
.set { ch_tree }
// Define some variables
def libpath = params.hyphyDev + '/res'
def outdir = params.outdir + '/' + params.out_prefix
def outhyphy = outdir + '/hyphy'
def outlog = outdir + '/logs-hyphy'
// Combine MSA files with tree file
ch_msa.combine(ch_tree).set { ch_msa_tree }
// Submit each MSA as separate job
busted_ph(
ch_msa_tree,
params.hyphyDev,
libpath,
params.hyphyAnalysis,
params.batchFile,
params.testLabel,
outhyphy,
outlog
)
}