Skip to content

Commit

Permalink
Merge branch 'master' into dev-csvtk
Browse files Browse the repository at this point in the history
  • Loading branch information
dialvarezs authored Jan 7, 2025
2 parents ae77bed + 7053802 commit e27d21f
Show file tree
Hide file tree
Showing 18 changed files with 679 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .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@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Install pip
run: python -m pip install --upgrade pip

- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow cryptography

- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: "temurin"
java-version: "17"
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
with:
name: logs-${{ matrix.profile }}-${{ steps.parsed.outputs.result }}
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Find conda differences
id: conda-diff
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
with:
json: true
escape_json: false
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Find Dockerfile differences
id: docker-diff
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
with:
json: true
escape_json: false
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/bbmap/repair/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::bbmap=39.13"
57 changes: 57 additions & 0 deletions modules/nf-core/bbmap/repair/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
process BBMAP_REPAIR {
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/bbmap:39.13--he5f24ec_1':
'biocontainers/bbmap:39.13--he5f24ec_1' }"

input:
tuple val(meta), path(reads)
val(interleave)

output:
tuple val(meta), path("*_repaired.fastq.gz") , emit: repaired
tuple val(meta), path("${prefix}_singleton.fastq.gz"), emit: singleton
path "versions.yml" , emit: versions
path "*.log" , emit: log

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
in_reads = ( interleave ) ? "in=${reads[0]}" : "in=${reads[0]} in2=${reads[1]}"
out_reads = ( interleave ) ? "out=${prefix}_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
: "out=${prefix}_1_repaired.fastq.gz out2=${prefix}_2_repaired.fastq.gz outs=${prefix}_singleton.fastq.gz"
"""
maxmem=\$(echo \"$task.memory\"| sed 's/ GB/g/g')
repair.sh \\
-Xmx\$maxmem \\
$in_reads \\
$out_reads \\
threads=${task.cpus}
${args} \\
&> ${prefix}.repair.sh.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
repair.sh: \$(repair.sh --version |& sed '2!d ; s/BBMap version //')
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
echo "" | gzip > ${prefix}_1_repaired.fastq.gz
echo "" | gzip > ${prefix}_2_repaired.fastq.gz
echo "" | gzip > ${prefix}_singleton.fastq.gz
touch ${prefix}.repair.sh.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
repair.sh: \$(repair.sh --version |& sed '2!d ; s/BBMap version //')
END_VERSIONS
"""
}
67 changes: 67 additions & 0 deletions modules/nf-core/bbmap/repair/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "bbmap_repair"
description: Re-pairs reads that became disordered or had some mates eliminated.
keywords:
- paired reads re-pairing
- fastq
- preprocessing
tools:
- repair:
description: Repair.sh is a tool that re-pairs reads that became disordered or had some mates eliminated
tools.
homepage: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/
documentation: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/
licence: ["UC-LBL license (see package)"]
identifier: biotools:bbmap

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- reads:
type: file
description: |
List of input paired end fastq files
pattern: "*.{fastq,fq}.gz"
- - interleave:
type: boolean
description: |
Indicates whether the input paired reads are interleaved or not
output:
- repaired:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*_repaired.fastq.gz":
type: file
description: re-paired reads
pattern: "*_repaired.fastq.gz"
- singleton:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "${prefix}_singleton.fastq.gz":
type: file
description: singleton reads
pattern: "*singleton.fastq.gz"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
- log:
- "*.log":
type: file
description: log file containing stdout and stderr from repair.sh
pattern: "*.log"
authors:
- "@mazzalab"
maintainers:
- "@mazzalab"
- "@tm4zza"
115 changes: 115 additions & 0 deletions modules/nf-core/bbmap/repair/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
nextflow_process {

name "Test Process BBMAP_REPAIR"
script "../main.nf"
process "BBMAP_REPAIR"

tag "modules"
tag "modules_nfcore"
tag "bbmap"
tag "bbmap/repair"

test("sarscov2_illumina_paired - fastq_gz") {
config "./nextflow.config"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)]
]
input[1] = false
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() }
)
}
}

test("sarscov2_illumina_interleaved - fastq_gz") {
config "./nextflow.config"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true)]
]
input[1] = true
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() }
)
}
}

test("sarscov2_illumina_paired - fastq_gz - stub") {
config "./nextflow.config"
options "-stub"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)]
]
input[1] = false
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("sarscov2_illumina_interleaved - fastq_gz - stub") {
config "./nextflow.config"
options "-stub"

when {
params {
module_args = 'qin=33'
}
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true)]
]
input[1] = true
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
Loading

0 comments on commit e27d21f

Please sign in to comment.