forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nf-test_phispy
* 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
Showing
107 changed files
with
3,645 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
""" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bamstats/generalstats: | ||
- "modules/nf-core/bamstats/generalstats/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.