@@ -23,10 +23,10 @@ process UNIVERSC {
23
23
// Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
24
24
// For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
25
25
// TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below.
26
- conda (params. enable_conda ? " YOUR-TOOL-HERE " : null )
26
+ conda (params. enable_conda ? " UniverSC " : null )
27
27
container " ${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
28
- 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE ':
29
- 'quay .io/biocontainers/YOUR-TOOL-HERE ' } "
28
+ 'https://hub.docker.com/layers/tomkellygenetics/universc ':
29
+ 'docker .io/tomkellygenetics/universc:latest ' } "
30
30
31
31
input:
32
32
// TODO nf-core: Where applicable all sample-specific information e.g. "id", "single_end", "read_group"
@@ -35,20 +35,25 @@ process UNIVERSC {
35
35
// https://github.com/nf-core/modules/blob/master/modules/bwa/index/main.nf
36
36
// TODO nf-core: Where applicable please provide/convert compressed files as input/output
37
37
// e.g. "*.fastq.gz" and NOT "*.fastq", "*.bam" and NOT "*.sam" etc.
38
- tuple val(meta), path(bam)
38
+ tuple val(meta), path(reads)
39
+ path reference
39
40
40
41
output:
41
42
// TODO nf-core: Named file extensions MUST be emitted for ALL output channels
42
- tuple val(meta), path(" *.bam" ), emit: bam
43
+ output:
44
+ path(" sample-${ meta.id} /outs/*" ), emit: outs
43
45
// TODO nf-core: List additional required output channels/values here
44
- path " versions.yml" , emit: versions
46
+ path " versions.yml" , emit: versions
45
47
46
48
when:
47
49
task. ext. when == null || task. ext. when
48
50
49
51
script:
50
52
def args = task. ext. args ?: ' '
51
53
def prefix = task. ext. prefix ?: " ${ meta.id} "
54
+ def sample_arg = meta. samples. unique(). join(" ," )
55
+ def reference_name = reference. name
56
+ def input_reads = meta. single_end ? " --file $reads " : " -R1 ${ reads[0]} -R2 ${ reads[1]} "
52
57
// TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10
53
58
// If the software is unable to output a version number on the command-line then it can be manually specified
54
59
// e.g. https://github.com/nf-core/modules/blob/master/modules/homer/annotatepeaks/main.nf
@@ -59,17 +64,87 @@ process UNIVERSC {
59
64
// TODO nf-core: Please replace the example samtools command below with your module's command
60
65
// TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;)
61
66
"""
62
- samtools \\
63
- sort \\
64
- $args \\
65
- -@ $task . cpus \\
66
- -o ${ prefix} .bam \\
67
- -T $prefix \\
68
- $bam
67
+ bash /universc/launch_universc.sh \\
68
+ --technology '${ meta.technology} ' \\
69
+ --id 'sample-${ meta.id} ' \\
70
+ $input_reads \\
71
+ --reference ${ reference_name} \\
72
+ --sample ${ sample_arg} \\
73
+ --jobmode "local" \\
74
+ --localcores ${ task.cpus} \\
75
+ --localmem ${ task.memory.toGiga()} \\
76
+ --per-cell-data \\
77
+ $args
78
+
79
+ cat <<-END_VERSIONS > versions.yml
80
+ "${ task.process} ":
81
+ cellranger: cellranger count --version 2>&1 | head -n 2 | tail -n 1 | sed 's/^.* \(\(\d *\)\) /\1 /'| sed 's/[)(]//g'
82
+ universc: bash /universc/launch_universc.sh --version | grep version | grep universc | sed 's/^.* \(\(\d *\)\) /\1 /'
83
+ END_VERSIONS
84
+ """
85
+
86
+
87
+ stub:
88
+ """
89
+ mkdir -p "sample-${ meta.id} /outs/"
90
+ touch sample-${ meta.id} /outs/fake_file.txt
91
+
92
+ cat <<-END_VERSIONS > versions.yml
93
+ "${ task.process} ":
94
+ cellranger: cellranger count --version 2>&1 | head -n 2 | tail -n 1 | sed 's/^.* \(\(\d *\)\) /\1 /'| sed 's/[)(]//g'
95
+ universc: bash /universc/launch_universc.sh --version | grep version | grep universc | sed 's/^.* \(\(\d *\)\) /\1 /'
96
+ END_VERSIONS
97
+ }
98
+
99
+ process CELLRANGER_COUNT_OS {
100
+ tag "$meta . id "
101
+ label 'process_medium'
102
+
103
+ if (params.enable_conda) {
104
+ exit 1, "Conda environments cannot be used when using the Cell Ranger tool. Please use docker or singularity containers."
105
+ }
106
+ container "tomkellygenetics/cellranger_clean:3.0.2.9001"
107
+
108
+ input:
109
+ tuple val(meta), path(reads)
110
+ path reference
111
+
112
+ output:
113
+ path("sample-${ meta.id} /outs/*"), emit: outs
114
+ path "versions.yml" , emit: versions
115
+
116
+ when:
117
+ task.ext.when == null || task.ext.when
118
+
119
+ script:
120
+ def args = task.ext.args ?: ''
121
+ def sample_arg = meta.samples.unique().join(",")
122
+ def reference_name = reference.name
123
+ """
124
+ cellranger \\
125
+ count \\
126
+ -- id= ' sample-${meta.id}' \\
127
+ -- fastqs= . \\
128
+ -- transcriptome= $reference_name \\
129
+ -- sample= $sample_arg \\
130
+ -- localcores= $task. cpus \\
131
+ -- localmem= ${task. memory. toGiga()} \\
132
+ $args
133
+
134
+ cat << - END_VERSIONS > versions. yml
135
+ " ${ task.process} " :
136
+ cellranger: cellranger count -- version 2 > &1 | head - n 2 | tail - n 1 | sed ' s/^.* \(\(\d *\)\) /\1 /' | sed ' s/[)(]//g'
137
+ END_VERSIONS
138
+ """
139
+
140
+ stub:
141
+ """
142
+ mkdir - p " sample-${ meta.id} /outs/"
143
+ touch sample- ${meta. id}/ outs/ fake_file. txt
69
144
70
145
cat << - END_VERSIONS > versions. yml
71
146
" ${ task.process} " :
72
- universc: \$ (echo \$ (samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.* \$ //' ))
147
+ cellranger: cellranger count -- version 2 > &1 | head - n 2 | tail - n 1 | sed ' s/^.* \(\(\d * \)\) / \1 / ' | sed ' s/[)(]//g '
73
148
END_VERSIONS
74
149
"""
75
150
}
0 commit comments