|
1 | 1 | process SALMON_QUANT { |
2 | | - tag "$meta.id" |
| 2 | + tag "${meta.id}" |
3 | 3 | label "process_medium" |
4 | 4 |
|
5 | 5 | conda "${moduleDir}/environment.yml" |
6 | | - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? |
7 | | - 'https://depot.galaxyproject.org/singularity/salmon:1.10.3--h6dccd9a_2' : |
8 | | - 'biocontainers/salmon:1.10.3--h6dccd9a_2' }" |
| 6 | + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container |
| 7 | + ? 'https://depot.galaxyproject.org/singularity/salmon:1.10.3--h6dccd9a_2' |
| 8 | + : 'biocontainers/salmon:1.10.3--h6dccd9a_2'}" |
9 | 9 |
|
10 | 10 | input: |
11 | 11 | tuple val(meta), path(reads) |
12 | | - path index |
13 | | - path gtf |
14 | | - path transcript_fasta |
15 | | - val alignment_mode |
16 | | - val lib_type |
| 12 | + path index |
| 13 | + path gtf |
| 14 | + path transcript_fasta |
| 15 | + val alignment_mode |
| 16 | + val lib_type |
17 | 17 |
|
18 | 18 | output: |
19 | | - tuple val(meta), path("${prefix}") , emit: results |
20 | | - tuple val(meta), path("*info.json") , emit: json_info, optional: true |
| 19 | + tuple val(meta), path("${prefix}"), emit: results |
| 20 | + tuple val(meta), path("*info.json"), emit: json_info, optional: true |
21 | 21 | tuple val(meta), path("*lib_format_counts.json"), emit: lib_format_counts, optional: true |
22 | | - path "versions.yml" , emit: versions |
| 22 | + path "versions.yml", emit: versions |
23 | 23 |
|
24 | 24 | when: |
25 | 25 | task.ext.when == null || task.ext.when |
26 | 26 |
|
27 | 27 | script: |
28 | | - def args = task.ext.args ?: '' |
29 | | - prefix = task.ext.prefix ?: "${meta.id}" |
| 28 | + def args = task.ext.args ?: '' |
| 29 | + prefix = task.ext.prefix ?: "${meta.id}" |
30 | 30 |
|
31 | | - def reference = "--index $index" |
| 31 | + def reference = "--index ${index}" |
32 | 32 | def reads1 = [] |
33 | 33 | def reads2 = [] |
34 | | - meta.single_end ? [reads].flatten().each{reads1 << it} : reads.eachWithIndex{ v, ix -> ( ix & 1 ? reads2 : reads1) << v } |
| 34 | + meta.single_end ? [reads].flatten().each { reads1 << it } : reads.eachWithIndex { v, ix -> (ix & 1 ? reads2 : reads1) << v } |
35 | 35 | def input_reads = meta.single_end ? "-r ${reads1.join(" ")}" : "-1 ${reads1.join(" ")} -2 ${reads2.join(" ")}" |
36 | 36 | if (alignment_mode) { |
37 | | - reference = "-t $transcript_fasta" |
38 | | - input_reads = "-a $reads" |
| 37 | + reference = "-t ${transcript_fasta}" |
| 38 | + input_reads = "-a ${reads}" |
39 | 39 | } |
40 | 40 |
|
41 | 41 | def strandedness_opts = [ |
42 | | - 'A', 'U', 'SF', 'SR', |
43 | | - 'IS', 'IU' , 'ISF', 'ISR', |
44 | | - 'OS', 'OU' , 'OSF', 'OSR', |
45 | | - 'MS', 'MU' , 'MSF', 'MSR' |
| 42 | + 'A', |
| 43 | + 'U', |
| 44 | + 'SF', |
| 45 | + 'SR', |
| 46 | + 'IS', |
| 47 | + 'IU', |
| 48 | + 'ISF', |
| 49 | + 'ISR', |
| 50 | + 'OS', |
| 51 | + 'OU', |
| 52 | + 'OSF', |
| 53 | + 'OSR', |
| 54 | + 'MS', |
| 55 | + 'MU', |
| 56 | + 'MSF', |
| 57 | + 'MSR', |
46 | 58 | ] |
47 | | - def strandedness = 'A' |
| 59 | + def strandedness = 'A' |
48 | 60 | if (lib_type) { |
49 | 61 | if (strandedness_opts.contains(lib_type)) { |
50 | 62 | strandedness = lib_type |
51 | | - } else { |
52 | | - log.info "[Salmon Quant] Invalid library type specified '--libType=${lib_type}', defaulting to auto-detection with '--libType=A'." |
53 | 63 | } |
54 | | - } else { |
| 64 | + else { |
| 65 | + log.info("[Salmon Quant] Invalid library type specified '--libType=${lib_type}', defaulting to auto-detection with '--libType=A'.") |
| 66 | + } |
| 67 | + } |
| 68 | + else { |
55 | 69 | strandedness = meta.single_end ? 'U' : 'IU' |
56 | 70 | if (meta.strandedness == 'forward') { |
57 | 71 | strandedness = meta.single_end ? 'SF' : 'ISF' |
58 | | - } else if (meta.strandedness == 'reverse') { |
| 72 | + } |
| 73 | + else if (meta.strandedness == 'reverse') { |
59 | 74 | strandedness = meta.single_end ? 'SR' : 'ISR' |
60 | 75 | } |
61 | 76 | } |
62 | 77 | """ |
63 | 78 | salmon quant \\ |
64 | | - --geneMap $gtf \\ |
65 | | - --threads $task.cpus \\ |
66 | | - --libType=$strandedness \\ |
67 | | - $reference \\ |
68 | | - $input_reads \\ |
69 | | - $args \\ |
70 | | - -o $prefix |
| 79 | + --geneMap ${gtf} \\ |
| 80 | + --threads ${task.cpus} \\ |
| 81 | + --libType=${strandedness} \\ |
| 82 | + ${reference} \\ |
| 83 | + ${input_reads} \\ |
| 84 | + ${args} \\ |
| 85 | + -o ${prefix} |
71 | 86 |
|
72 | | - if [ -f $prefix/aux_info/meta_info.json ]; then |
73 | | - cp $prefix/aux_info/meta_info.json "${prefix}_meta_info.json" |
| 87 | + if [ -f ${prefix}/aux_info/meta_info.json ]; then |
| 88 | + cp ${prefix}/aux_info/meta_info.json "${prefix}_meta_info.json" |
74 | 89 | fi |
75 | | - if [ -f $prefix/lib_format_counts.json ]; then |
76 | | - cp $prefix/lib_format_counts.json "${prefix}_lib_format_counts.json" |
| 90 | + if [ -f ${prefix}/lib_format_counts.json ]; then |
| 91 | + cp ${prefix}/lib_format_counts.json "${prefix}_lib_format_counts.json" |
77 | 92 | fi |
78 | 93 |
|
79 | 94 | cat <<-END_VERSIONS > versions.yml |
|
0 commit comments