-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.nf
65 lines (50 loc) · 1.56 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
64
65
// Script parameters
params.chromSizesUrl = "https://hgdownload.soe.ucsc.edu/goldenPath/oryCun2/bigZips/oryCun2.chrom.sizes"
// params.gtfUrl = "https://hgdownload.soe.ucsc.edu/goldenPath/oryCun2/bigZips/genes/oryCun2.ncbiRefSeq.gtf.gz"
params.gtfUrl = "https://www.genoscope.cns.fr/externe/plants/data/Musa_acuminata_pahang_v4.gff"
// chromSizesChannel = Channel.from(params.chromSizesUrl)
// gtfChannel = Channel.from(params.gtfUrl)
process fetchFiles {
input:
val params.chromSizesUrl
val params.gtfUrl
output:
file "*.chrom.sizes" into chromsizes
file "*.gtf" into gtf
"""
wget $params.gtfUrl
wget $params.chromSizesUrl
gunzip *.gz
"""
}
process sortChromSizes {
publishDir 'results'
input:
file chromsizes
output:
file "*.sorted.chrom.sizes" into sortedChromsizes
"""
gsort -k1,1 -V -s $chromsizes > ${chromsizes.simpleName}.sorted.chrom.sizes
"""
}
process gtfToGenePred {
input:
file gtf
output:
file "*.genepred" into genepred
"""
gtfToGenePred -genePredExt -geneNameAsName2 $gtf ${gtf.baseName}.genepred
"""
}
process exonUnions {
publishDir 'results'
input:
file sortedChromsizes
file genepred
output:
file "*.beddb"
"""
cat ${genepred} | python ${workflow.projectDir}/scripts/genepredext_to_hgbed.py | python ${workflow.projectDir}/scripts/exonU.py - > ${genepred.baseName}.hgbed
clodius aggregate bedfile --chromsizes-filename $sortedChromsizes ${genepred.baseName}.hgbed
"""
}