Skip to content

Commit

Permalink
update environment.yml, containers declaration and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Dec 13, 2024
1 parent bf92829 commit 39b3473
Show file tree
Hide file tree
Showing 18 changed files with 198 additions and 168 deletions.
7 changes: 6 additions & 1 deletion modules/nf-core/custom/tabulartogseacls/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::coreutils=8.30
- conda-forge::coreutils=9.5
- conda-forge::grep=3.11
- conda-forge::gzip=1.13
- conda-forge::lbzip2=2.5
- conda-forge::sed=4.8
- conda-forge::tar=1.34
22 changes: 12 additions & 10 deletions modules/nf-core/custom/tabulartogseacls/main.nf
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
process CUSTOM_TABULARTOGSEACLS {
tag "$meta.id"
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
'nf-core/ubuntu:20.04' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data'
: 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}"

input:
tuple val(meta), path(samples)

output:
tuple val(meta), path("*.cls"), emit: cls
path "versions.yml" , emit: versions
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: []
def prefix = task.ext.prefix ?: "${meta.id}"
def separator = args.separator ? "${args.separator}" : ( samples.getName().endsWith(".tsv") ? '\t': ',' )
separator = separator == '\t' ? '\\t': separator
def separator = args.separator ? "${args.separator}" : (samples.getName().endsWith(".tsv") ? '\t' : ',')
separator = separator == '\t' ? '\\t' : separator
def variable = args.variable
if ( !variable ) error "Supply a variable in the sample sheet from which to derive classes"
if (!variable) {
error("Supply a variable in the sample sheet from which to derive classes")
}
"""
cls_file=${prefix}.cls
column_number=\$(cat $samples | head -n 1 | tr '$separator' "\\n" | grep -En "^$variable\$" | awk -F':' '{print \$1}')
classes=\$(tail -n +2 $samples | awk -F'$separator' '{print \$'\$column_number'}' | sed 's/^\$/empty/g')
column_number=\$(cat ${samples} | head -n 1 | tr '${separator}' "\\n" | grep -En "^${variable}\$" | awk -F':' '{print \$1}')
classes=\$(tail -n +2 ${samples} | awk -F'${separator}' '{print \$'\$column_number'}' | sed 's/^\$/empty/g')
unique_classes=\$(echo -e "\$classes" | awk '!x[\$0]++')
echo -e "\$(echo -e \"\$classes\" | wc -l) \$(echo -e \"\$unique_classes\" | wc -l) 1" > \$cls_file
Expand Down
7 changes: 6 additions & 1 deletion modules/nf-core/custom/tabulartogseagct/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::coreutils=8.30
- conda-forge::coreutils=9.5
- conda-forge::grep=3.11
- conda-forge::gzip=1.13
- conda-forge::lbzip2=2.5
- conda-forge::sed=4.8
- conda-forge::tar=1.34
22 changes: 11 additions & 11 deletions modules/nf-core/custom/tabulartogseagct/main.nf
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
process CUSTOM_TABULARTOGSEAGCT {
tag "$meta.id"
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' :
'nf-core/ubuntu:20.04' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data'
: 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}"

input:
tuple val(meta), path(tabular)

output:
tuple val(meta), path("*.gct"), emit: gct
path "versions.yml" , emit: versions
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: []
def prefix = task.ext.prefix ?: "${meta.id}"
def separator = args.separator ? "${args.separator}" : ( tabular.getName().endsWith(".csv") ? ',': '\t' )
separator = separator == '\t' ? '\\t': separator
def separator = args.separator ? "${args.separator}" : (tabular.getName().endsWith(".csv") ? ',' : '\t')
separator = separator == '\t' ? '\\t' : separator

"""
n_columns=\$(head -n 1 $tabular | tr "$separator" "\\n" | wc -l)
n_lines=\$(wc -l < $tabular)
n_columns=\$(head -n 1 ${tabular} | tr "${separator}" "\\n" | wc -l)
n_lines=\$(wc -l < ${tabular})
gct_file=${prefix}.gct
echo -e "#1.2\$(printf '\\t%.0s' {1..\$n_columns})\\n\$((n_lines-1))\\t\$((n_columns-1))\$(printf '\\t%.0s' {1..\$((n_columns-1))})" > \$gct_file
echo -e "NAME\\tDESCRIPTION\\t\$(head -n 1 $tabular | cut -f1 -d\$'$separator' --complement | awk -F'$separator' 'BEGIN { OFS = "\\t"}; {\$1=\$1}1' )" >> \$gct_file
cat $tabular | tail -n +2 | awk -F'$separator' 'BEGIN { OFS = "\\t"} {\$1=\$1"\\tNA"}1' >> \$gct_file
echo -e "NAME\\tDESCRIPTION\\t\$(head -n 1 ${tabular} | cut -f1 -d\$'${separator}' --complement | awk -F'${separator}' 'BEGIN { OFS = "\\t"}; {\$1=\$1}1' )" >> \$gct_file
cat ${tabular} | tail -n +2 | awk -F'${separator}' 'BEGIN { OFS = "\\t"} {\$1=\$1"\\tNA"}1' >> \$gct_file
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
3 changes: 3 additions & 0 deletions modules/nf-core/gunzip/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::coreutils=9.5
- conda-forge::grep=3.11
- conda-forge::gzip=1.13
- conda-forge::lbzip2=2.5
- conda-forge::sed=4.8
- conda-forge::tar=1.34
40 changes: 20 additions & 20 deletions modules/nf-core/gunzip/main.nf
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
process GUNZIP {
tag "$archive"
tag "${archive}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ubuntu:22.04' :
'nf-core/ubuntu:22.04' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data'
: 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}"

input:
tuple val(meta), path(archive)

output:
tuple val(meta), path("$gunzip"), emit: gunzip
path "versions.yml" , emit: versions
tuple val(meta), path("${gunzip}"), emit: gunzip
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1]
def name = archive.toString() - '.gz' - ".$extension"
def prefix = task.ext.prefix ?: name
gunzip = prefix + ".$extension"
def args = task.ext.args ?: ''
def extension = (archive.toString() - '.gz').tokenize('.')[-1]
def name = archive.toString() - '.gz' - ".${extension}"
def prefix = task.ext.prefix ?: name
gunzip = prefix + ".${extension}"
"""
# Not calling gunzip itself because it creates files
# with the original group ownership rather than the
# default one for that user / the work directory
gzip \\
-cd \\
$args \\
$archive \\
> $gunzip
${args} \\
${archive} \\
> ${gunzip}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -40,13 +40,13 @@ process GUNZIP {
"""

stub:
def args = task.ext.args ?: ''
def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1]
def name = archive.toString() - '.gz' - ".$extension"
def prefix = task.ext.prefix ?: name
gunzip = prefix + ".$extension"
def args = task.ext.args ?: ''
def extension = (archive.toString() - '.gz').tokenize('.')[-1]
def name = archive.toString() - '.gz' - ".${extension}"
def prefix = task.ext.prefix ?: name
gunzip = prefix + ".${extension}"
"""
touch $gunzip
touch ${gunzip}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//')
Expand Down
40 changes: 20 additions & 20 deletions modules/nf-core/gunzip/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
],
"1": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
],
"gunzip": [
[
Expand All @@ -22,15 +22,15 @@
]
],
"versions": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-06-25T11:35:10.861293"
"timestamp": "2024-12-13T11:48:22.080222697"
},
"Should run without failures - stub": {
"content": [
Expand All @@ -44,7 +44,7 @@
]
],
"1": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
],
"gunzip": [
[
Expand All @@ -55,15 +55,15 @@
]
],
"versions": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-06-25T11:35:05.857145"
"timestamp": "2024-12-13T11:48:14.593020264"
},
"Should run without failures": {
"content": [
Expand All @@ -77,7 +77,7 @@
]
],
"1": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
],
"gunzip": [
[
Expand All @@ -88,15 +88,15 @@
]
],
"versions": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2023-10-17T15:35:37.690477896"
"timestamp": "2024-12-13T11:48:01.295397925"
},
"Should run without failures - prefix": {
"content": [
Expand All @@ -110,7 +110,7 @@
]
],
"1": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
],
"gunzip": [
[
Expand All @@ -121,14 +121,14 @@
]
],
"versions": [
"versions.yml:md5,54376d32aca20e937a4ec26dac228e84"
"versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-06-25T11:33:32.921739"
"timestamp": "2024-12-13T11:48:07.414271387"
}
}
3 changes: 3 additions & 0 deletions modules/nf-core/igv/js/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::coreutils=9.5
- conda-forge::grep=3.11
- conda-forge::gzip=1.13
- conda-forge::lbzip2=2.5
- conda-forge::sed=4.8
- conda-forge::tar=1.34
27 changes: 13 additions & 14 deletions modules/nf-core/igv/js/main.nf
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@

process IGV_JS {
tag "$meta.id"
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ubuntu:22.04' :
'nf-core/ubuntu:22.04' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data'
: 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}"

input:
tuple val(meta), path(alignment), path(index)

output:
tuple val(meta), path("*_genome-browser.html") , emit: browser
tuple val(meta), path(alignment) , emit: align_files
tuple val(meta), path(index) , emit: index_files
path "versions.yml" , emit: versions
tuple val(meta), path("*_genome-browser.html"), emit: browser
tuple val(meta), path(alignment), emit: align_files
tuple val(meta), path(index), emit: index_files
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -37,13 +36,13 @@ process IGV_JS {
var igvDiv = document.getElementById("igv-div");
var options =
{
$browser_args,
${browser_args},
tracks: [
{
"name": "$prefix",
"url": "$alignment",
"indexURL": "$index",
$track_args
"name": "${prefix}",
"url": "${alignment}",
"indexURL": "${index}",
${track_args}
}
]
};
Expand Down
Loading

0 comments on commit 39b3473

Please sign in to comment.