forked from nf-core/chipseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
49 lines (41 loc) · 1.87 KB
/
main.nf
File metadata and controls
49 lines (41 loc) · 1.87 KB
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
process MULTIQC_CUSTOM_PHANTOMPEAKQUALTOOLS {
tag "$meta.id"
conda "conda-forge::r-base=4.3.3"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/45/4569ff9993578b8402d00230ab9dd75ce6e63529731eb24f21579845e6bd5cdb/data':
'community.wave.seqera.io/library/r-base:4.3.3--14bb33ac537aea22' }"
input:
tuple val(meta), path(spp), path(rdata)
path nsc_header
path rsc_header
path correlation_header
output:
tuple val(meta), path("*.spp_nsc_mqc.tsv") , emit: nsc
tuple val(meta), path("*.spp_rsc_mqc.tsv") , emit: rsc
tuple val(meta), path("*.spp_correlation_mqc.tsv"), emit: correlation
when:
task.ext.when == null || task.ext.when
script:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
cp $correlation_header ${prefix}.spp_correlation_mqc.tsv
Rscript --max-ppsize=500000 -e "load('$rdata'); write.table(crosscorr\\\$cross.correlation, file=\\"${prefix}.spp_correlation_mqc.tsv\\", sep=",", quote=FALSE, row.names=FALSE, col.names=FALSE,append=TRUE)"
awk -v OFS='\t' '{print "${meta.id}", \$9}' $spp | cat $nsc_header - > ${prefix}.spp_nsc_mqc.tsv
awk -v OFS='\t' '{print "${meta.id}", \$10}' $spp | cat $rsc_header - > ${prefix}.spp_rsc_mqc.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.spp_nsc_mqc.tsv
touch ${prefix}.spp_rsc_mqc.tsv
touch ${prefix}.spp_correlation_mqc.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
END_VERSIONS
"""
}