Skip to content

Commit

Permalink
Merge branch 'nf-core:master' into parabricks-sbwf
Browse files Browse the repository at this point in the history
  • Loading branch information
famosab authored Jan 31, 2025
2 parents 2a7d739 + 94ca1fd commit 656fca3
Show file tree
Hide file tree
Showing 47 changed files with 1,590 additions and 569 deletions.
13 changes: 7 additions & 6 deletions .github/actions/get-shards/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ outputs:
total_shards:
description: "Total number of shards"
value: ${{ steps.shards.outputs.total_shards }}

runs:
using: "composite"
steps:
Expand All @@ -26,22 +25,24 @@ runs:
with:
version: ${{ env.NFT_VER }}
install-pdiff: true

- name: Get number of shards
id: shards
shell: bash
run: |
# Prepare tag parameter if tags are provided
TAGS=$([ -n "${{ inputs.tags }}" ] && echo "--tag ${{ inputs.tags }}" || echo "")
# Run nf-test with dynamic tag parameter
# Run nf-test with dynamic parameter
nftest_output=$(nf-test test \
--dry-run \
--profile docker \
${TAGS} \
--filter process,workflow \
${{ inputs.paths }})
${{ inputs.paths }}) || {
echo "nf-test command failed with exit code $?"
echo "Full output: $nftest_output"
exit 1
}
echo "nf-test dry-run output: $nftest_output"
# Default values for shard and total_shards
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/nf-test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4
with:
distribution: "temurin"
java-version: "17"
Expand All @@ -28,7 +28,7 @@ runs:
version: "${{ env.NXF_VERSION }}"

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.11"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: ""
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
sudo rm -rf ./.* || true
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.11"

Expand All @@ -128,7 +128,7 @@ jobs:
- name: Install pip
run: python -m pip install --upgrade pip

- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,11 @@ jobs:
echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"
echo "DEBUG: needs.nf-test.outputs.filtered_paths = ${{ needs.nf-test.outputs.filtered_paths }}"
echo "::endgroup::"
- name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
if: always()
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
4 changes: 2 additions & 2 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.11"

Expand All @@ -258,7 +258,7 @@ jobs:
- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow cryptography

- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,11 @@ ads <- do.call(anota2seqDataSetFromMatrix, anota2seqDataSetFromMatrix_args)
# Run anota2seqRun

contrast_matrix <- matrix(
nrow=2,
ncol=1,
dimnames=list(c(opt\$reference_level, opt\$target_level),c()),
c(-1,1)
c(-1, 1),
nrow = 2,
dimnames = list(sort(c(opt\$reference_level, opt\$target_level)), NULL)
)

ads <- anota2seqRun(
ads,
contrasts = contrast_matrix,
Expand Down
82 changes: 41 additions & 41 deletions modules/nf-core/antismash/antismashlite/main.nf
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
process ANTISMASH_ANTISMASHLITE {
tag "$meta.id"
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0' :
'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0'
: 'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0'}"

containerOptions {
workflow.containerEngine == 'singularity' ?
"-B $antismash_dir:/usr/local/lib/python3.10/site-packages/antismash" :
workflow.containerEngine == 'docker' ?
"-v \$PWD/$antismash_dir:/usr/local/lib/python3.10/site-packages/antismash" :
''
}
['singularity', 'apptainer'].contains(workflow.containerEngine)
? "-B ${antismash_dir}:/usr/local/lib/python3.10/site-packages/antismash"
: workflow.containerEngine == 'docker'
? "-v \$PWD/${antismash_dir}:/usr/local/lib/python3.10/site-packages/antismash"
: ''
}

input:
tuple val(meta), path(sequence_input)
path(databases)
path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml).
path(gff)
path databases
path antismash_dir
// Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml).
path gff

output:
tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file
tuple val(meta), path("${prefix}/{css,images,js}") , emit: html_accessory_files
tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html") , optional: true, emit: knownclusterblast_html
tuple val(meta), path("${prefix}/knownclusterblast/") , optional: true, emit: knownclusterblast_dir
tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt") , optional: true, emit: knownclusterblast_txt
tuple val(meta), path("${prefix}/svg/clusterblast*.svg") , optional: true, emit: svg_files_clusterblast
tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg") , optional: true, emit: svg_files_knownclusterblast
tuple val(meta), path("${prefix}/*.gbk") , emit: gbk_input
tuple val(meta), path("${prefix}/*.json") , emit: json_results
tuple val(meta), path("${prefix}/*.log") , emit: log
tuple val(meta), path("${prefix}/*.zip") , emit: zip
tuple val(meta), path("${prefix}/*region*.gbk") , optional: true, emit: gbk_results
tuple val(meta), path("${prefix}/clusterblastoutput.txt") , optional: true, emit: clusterblastoutput
tuple val(meta), path("${prefix}/index.html") , emit: html
tuple val(meta), path("${prefix}/knownclusterblastoutput.txt") , optional: true, emit: knownclusterblastoutput
tuple val(meta), path("${prefix}/regions.js") , emit: json_sideloading
path "versions.yml" , emit: versions
tuple val(meta), path("${prefix}/clusterblast/*_c*.txt"), optional: true, emit: clusterblast_file
tuple val(meta), path("${prefix}/{css,images,js}"), emit: html_accessory_files
tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html"), optional: true, emit: knownclusterblast_html
tuple val(meta), path("${prefix}/knownclusterblast/"), optional: true, emit: knownclusterblast_dir
tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt"), optional: true, emit: knownclusterblast_txt
tuple val(meta), path("${prefix}/svg/clusterblast*.svg"), optional: true, emit: svg_files_clusterblast
tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg"), optional: true, emit: svg_files_knownclusterblast
tuple val(meta), path("${prefix}/*.gbk"), emit: gbk_input
tuple val(meta), path("${prefix}/*.json"), emit: json_results
tuple val(meta), path("${prefix}/*.log"), emit: log
tuple val(meta), path("${prefix}/*.zip"), emit: zip
tuple val(meta), path("${prefix}/*region*.gbk"), optional: true, emit: gbk_results
tuple val(meta), path("${prefix}/clusterblastoutput.txt"), optional: true, emit: clusterblastoutput
tuple val(meta), path("${prefix}/index.html"), emit: html
tuple val(meta), path("${prefix}/knownclusterblastoutput.txt"), optional: true, emit: knownclusterblastoutput
tuple val(meta), path("${prefix}/regions.js"), emit: json_sideloading
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -53,25 +54,24 @@ process ANTISMASH_ANTISMASHLITE {
## this should be run as a separate module for versioning purposes
antismash \\
$args \\
$gff_flag \\
-c $task.cpus \\
--output-dir $prefix \\
--output-basename $prefix \\
${args} \\
${gff_flag} \\
-c ${task.cpus} \\
--output-dir ${prefix} \\
--output-basename ${prefix} \\
--genefinding-tool none \\
--logfile $prefix/${prefix}.log \\
--databases $databases \\
$sequence_input
--logfile ${prefix}/${prefix}.log \\
--databases ${databases} \\
${sequence_input}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //')
antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g')
END_VERSIONS
"""

stub:
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
def VERSION = '7.1.0' // WARN: Version information not provided by tool during stub run. Please update this string when bumping container versions.
"""
mkdir -p ${prefix}/css
mkdir ${prefix}/images
Expand All @@ -91,7 +91,7 @@ process ANTISMASH_ANTISMASHLITE {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
antismash-lite: $VERSION
antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g')
END_VERSIONS
"""
}
12 changes: 10 additions & 2 deletions modules/nf-core/antismash/antismashlite/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nextflow_process {
name "Test Process ANTISMASH_ANTISMASHLITE"
script "../main.nf"
process "ANTISMASH_ANTISMASHLITE"
config './nextflow.config'

tag "modules"
tag "modules_nfcore"
Expand Down Expand Up @@ -96,7 +97,11 @@ nextflow_process {
{ assert path(process.out.html.get(0).get(1)).text.contains("https://antismash.secondarymetabolites.org/") },
{ assert path(process.out.json_sideloading.get(0).get(1)).text.contains("\"seq_id\": \"NZ_CP069563.1\"") },
{ assert path(process.out.log.get(0).get(1)).text.contains("antiSMASH status: SUCCESS") },
{ assert snapshot(process.out.versions).match("versions") }
{ assert snapshot(
path(process.out.versions[0]).yaml,
file(process.out.versions[0]).name,
).match("versions")
}
)
}
}
Expand All @@ -119,7 +124,10 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(
file(process.out.versions[0]).name,
).match("versions_stub")
}
)
}
}
Expand Down
Loading

0 comments on commit 656fca3

Please sign in to comment.