Skip to content

Commit

Permalink
Merge branch 'master' into nf-test_phispy
Browse files Browse the repository at this point in the history
* master:
  Added contrast limited adaptive histogram equalization module (nf-core#5268)
  Leviosam2 index (nf-core#5316)
  Add subworkflow mapAD (nf-core#5239)
  Remove AMRFinderPlus DB update on each invocation (nf-core#5232)
  Revert "add paths in output directive in cellranger cout module" (nf-core#5306)
  Revert "update kallistobustools count output list" (nf-core#5307)
  Igv reports (nf-core#5263)
  Remove unnecessary .view() in subworkflows/nf-core/vcf_phase_shapeit5 & tests/modules/nf-core/shapeit5/ligate/main.nf (nf-core#5280)
  Add wittyer as module (nf-core#5171)
  Bamstats (nf-core#4474)
  gatk4_asereadcounter add updated meta and nf-tests (nf-core#5164)
  4557 new module kaijumergeoutputs + stub Kraken2/Kraken2 (nf-core#5249)
  add cram/index support to bwamem2 (nf-core#5248)
  Add README to modules build with Docker (nf-core#4935)
  update paths for VEP (nf-core#5281)
  nf-test bases2fastq (nf-core#5272)
  Add module seqfu/stats (nf-core#5275)
  Added gt/gff3validator (nf-core#4718)
  Added liftoff (nf-core#5209)
  • Loading branch information
jvfe committed Mar 20, 2024
2 parents 80d127d + 7b29d1b commit 294a9c0
Show file tree
Hide file tree
Showing 107 changed files with 3,645 additions and 256 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ jobs:
tags: merquryfk/merquryfk
- profile: conda
tags: merquryfk/ploidyplot
- profile: conda
tags: molkartgarage/clahe
- profile: conda
tags: quartonotebook
- profile: conda
Expand All @@ -585,6 +587,8 @@ jobs:
tags: subworkflows/vcf_annotate_ensemblvep
- profile: singularity
tags: bases2fastq
- profile: conda
tags: wittyer
env:
NXF_ANSI_LOG: false
SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }}
Expand Down
2 changes: 0 additions & 2 deletions modules/nf-core/bakta/bakta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ process BAKTA_BAKTA {
def proteins_opt = proteins ? "--proteins ${proteins[0]}" : ""
def prodigal_tf = prodigal_tf ? "--prodigal-tf ${prodigal_tf[0]}" : ""
"""
amrfinder_update --force_update --database $db/amrfinderplus-db
bakta \\
$fasta \\
$args \\
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/bamstats/generalstats/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "bamstats_generalstats"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::bamstats=0.3.5"
51 changes: 51 additions & 0 deletions modules/nf-core/bamstats/generalstats/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
process BAMSTATS_GENERALSTATS {
tag "$meta.id"
label 'process_single'
conda "bioconda::bamstats=0.3.5"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bamstats:0.3.5--he881be0_0':
'biocontainers/bamstats:0.3.5--he881be0_0' }"

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

output:
tuple val(meta), path("*.json"), emit: json
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}"
// Several ARGS are available.
// -a is a helpfu; one where you can add a BED file
// -u, --uniq outputs genomic coverage statistics for uniqely mapped reads
"""
bamstats \\
-i $bam \\
$args \\
-c $task.cpus \\
-o ${prefix}.json
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bamstats: \$(echo \$(bamstats --version 2>&1) | sed 's/^.*bamstats == version://; s/Using.*\$//' | sed 's/built.*//' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.json
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bamstats: \$(echo \$(bamstats --version 2>&1) | sed 's/^.*bamstats == version://; s/Using.*\$//' | sed 's/built.*//' )
END_VERSIONS
"""
}

46 changes: 46 additions & 0 deletions modules/nf-core/bamstats/generalstats/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "bamstats_generalstats"
description: write your description here
keywords:
- bam
- statistics
- genomics
tools:
- "bamstats":
description: "A command line tool to compute mapping statistics from a BAM file"
homepage: "https://github.com/guigolab/bamstats/"
documentation: "https://github.com/guigolab/bamstats/"
tool_dev_url: "https://github.com/guigolab"
licence: ["BSD-3-clause"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- bam:
type: file
description: Sorted BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- json:
type: file
description: json containing bam statistics
pattern: "*.json"

authors:
- "@johnoooh"
60 changes: 60 additions & 0 deletions modules/nf-core/bamstats/generalstats/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bamstats"
tag "bamstats/generalstats"

test("sarscov2 - bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.json.get(0)[1]).exists() },
{ assert snapshot(process.out.versions).match("versions") }
)
}

}

test("sarscov2 - bam - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.json.get(0)[1]).exists() },
{ assert snapshot(process.out.versions).match("versions_stub") }
)
}

}

}
26 changes: 26 additions & 0 deletions modules/nf-core/bamstats/generalstats/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/bamstats/generalstats/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bamstats/generalstats:
- "modules/nf-core/bamstats/generalstats/**"
17 changes: 17 additions & 0 deletions modules/nf-core/bases2fastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,21 @@ process BASES2FASTQ {
bases2fastq: \$(bases2fastq --version | sed -e "s/bases2fastq version //g")
END_VERSIONS
"""

stub:
"""
mkdir output
mkdir output/Samples
mkdir output/Samples/DefaultSample
touch output/Metrics.csv
touch output/RunManifest.json
touch output/UnassignedSequences.csv
echo | gzip > output/Samples/DefaultSample/DefaultSample_R1.fastq.gz
echo | gzip > output/Samples/DefaultSample/DefaultSample_R2.fastq.gz
touch output/Bases2Fastq-Sim_QC.html
touch output/RunStats.json
touch output/Samples/DefaultSample/DefaultSample_stats.json
touch versions.yml
"""
}
78 changes: 78 additions & 0 deletions modules/nf-core/bases2fastq/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bases2fastq"
tag "untar"

setup {
run("UNTAR") {
script "modules/nf-core/untar/main.nf"
process {
"""
input[0] = Channel.of([ [id: "sim-data", samplesheet: file("https://raw.githubusercontent.com/nf-core/test-datasets/demultiplex/testdata/sim-data/RunManifest.csv", checkIfExists: true)], file("https://github.com/nf-core/test-datasets/raw/demultiplex/testdata/sim-data/sim-data.tar.gz", checkIfExists: true) ])
"""
}
}
}

test("sim-data.tar.gz - bcl") {
when {
process {
"""
input[0]= UNTAR.out.untar.map{meta, untar -> [meta, meta.samplesheet, untar]}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.metrics,
process.out.generated_run_manifest,
process.out.unassigned,
process.out.sample_fastq,
file(process.out.qc_report[0][1]).name,
file(process.out.run_stats[0][1]).name,
file(process.out.sample_json[0][1]).name
).match()
}
)
}

}

test("sim-data.tar.gz - bcl -stub") {
options "-stub"
when {
process {
"""
input[0]= UNTAR.out.untar.map{meta, untar -> [meta, meta.samplesheet, untar]}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.metrics,
process.out.generated_run_manifest,
process.out.unassigned,
process.out.sample_fastq,
file(process.out.qc_report[0][1]).name,
file(process.out.run_stats[0][1]).name,
file(process.out.sample_json[0][1]).name
).match()
}
)
}
}
}
Loading

0 comments on commit 294a9c0

Please sign in to comment.