Skip to content

Commit

Permalink
Replace ubuntu for all modules using it - meta PR (#7215)
Browse files Browse the repository at this point in the history
* update cat/fastq

* update environment.yml, containers declaration and snapshots

* bump Nextflow version

* fix linting

* update test name in snapshot

* fix name for stub test

* useMamba

* update conda setup

* fix conda setup

* fix typo

* split gunzip out

* forgot 1 file

* split untar out
  • Loading branch information
maxulysse authored Dec 13, 2024
1 parent 99ea33b commit a57fc22
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 120 deletions.
5 changes: 5 additions & 0 deletions modules/nf-core/cat/fastq/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ channels:
- 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
22 changes: 12 additions & 10 deletions modules/nf-core/cat/fastq/main.nf
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
process CAT_FASTQ {
tag "$meta.id"
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/c2/c262fc09eca59edb5a724080eeceb00fb06396f510aefb229c2d2c6897e63975/data' :
'community.wave.seqera.io/library/coreutils:9.5--ae99c88a9b28c264' }"
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(reads, stageAs: "input*/*")

output:
tuple val(meta), path("*.merged.fastq.gz"), emit: reads
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 readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()]
def readList = reads instanceof List ? reads.collect { it.toString() } : [reads.toString()]
if (meta.single_end) {
if (readList.size >= 1) {
"""
Expand All @@ -32,11 +32,12 @@ process CAT_FASTQ {
END_VERSIONS
"""
}
} else {
}
else {
if (readList.size >= 2) {
def read1 = []
def read2 = []
readList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v }
readList.eachWithIndex { v, ix -> (ix & 1 ? read2 : read1) << v }
"""
cat ${read1.join(' ')} > ${prefix}_1.merged.fastq.gz
cat ${read2.join(' ')} > ${prefix}_2.merged.fastq.gz
Expand All @@ -51,7 +52,7 @@ process CAT_FASTQ {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()]
def readList = reads instanceof List ? reads.collect { it.toString() } : [reads.toString()]
if (meta.single_end) {
if (readList.size >= 1) {
"""
Expand All @@ -63,7 +64,8 @@ process CAT_FASTQ {
END_VERSIONS
"""
}
} else {
}
else {
if (readList.size >= 2) {
"""
echo '' | gzip > ${prefix}_1.merged.fastq.gz
Expand Down
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/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
20 changes: 10 additions & 10 deletions modules/nf-core/igv/js/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
],
"3": [
"versions.yml:md5,5adf8988fa1079ca8921a8103910ce3d"
"versions.yml:md5,25c78c49dc1223ecf93c6fc9bd069cac"
],
"align_files": [
[
Expand Down Expand Up @@ -60,15 +60,15 @@
]
],
"versions": [
"versions.yml:md5,5adf8988fa1079ca8921a8103910ce3d"
"versions.yml:md5,25c78c49dc1223ecf93c6fc9bd069cac"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-09-02T14:13:20.460734"
"timestamp": "2024-12-13T11:48:39.41332795"
},
"test-igv-js": {
"content": [
Expand Down Expand Up @@ -101,7 +101,7 @@
]
],
"3": [
"versions.yml:md5,5adf8988fa1079ca8921a8103910ce3d"
"versions.yml:md5,25c78c49dc1223ecf93c6fc9bd069cac"
],
"align_files": [
[
Expand Down Expand Up @@ -131,14 +131,14 @@
]
],
"versions": [
"versions.yml:md5,5adf8988fa1079ca8921a8103910ce3d"
"versions.yml:md5,25c78c49dc1223ecf93c6fc9bd069cac"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-09-02T14:13:15.009833"
"timestamp": "2024-12-13T11:48:31.033398759"
}
}
7 changes: 6 additions & 1 deletion modules/nf-core/md5sum/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
Loading

0 comments on commit a57fc22

Please sign in to comment.