-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New module jvarkit/wgscoverageplotter #6633
Merged
lindenb
merged 10 commits into
nf-core:master
from
lindenb:pl_jvarkit_wgscoverageplotter
Sep 13, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e1abcc4
wgscoverageplotter
lindenb 9d32f6e
Merge branch 'master' into pl_jvarkit_wgscoverageplotter
lindenb 4f63bc5
Apply suggestions from code review
lindenb 987d785
fix meta
lindenb 2b318c1
change snap
lindenb 115169f
Merge branch 'master' into pl_jvarkit_wgscoverageplotter
lindenb 2be00f3
fix tags
lindenb 2156b4d
fix env.yml
lindenb 2f55733
Merge branch 'master' into pl_jvarkit_wgscoverageplotter
lindenb e06733b
Apply suggestions from code review
lindenb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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::jvarkit=2024.08.25" |
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 JVARKIT_WGSCOVERAGEPLOTTER { | ||
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/jvarkit:2024.08.25--hdfd78af_1': | ||
'biocontainers/jvarkit:2024.08.25--hdfd78af_1' }" | ||
|
||
input: | ||
tuple val(meta), path(bam), path(bai) | ||
tuple val(meta2), path(fasta) | ||
tuple val(meta3), path(fai) | ||
tuple val(meta4), path(dict) | ||
output: | ||
tuple val(meta), path("*.svg"), emit: output | ||
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}" | ||
""" | ||
mkdir -p TMP | ||
|
||
jvarkit -Xmx${task.memory.giga}g -XX:-UsePerfData -Djava.io.tmpdir=TMP wgscoverageplotter \\ | ||
-R ${fasta} \\ | ||
${args} \\ | ||
${bam} > "${prefix}.svg" | ||
|
||
rm -rf TMP | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
jvarkit: \$(jvarkit -v) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch "${prefix}.svg" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
jvarkit: \$(jvarkit -v) | ||
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,79 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "jvarkit_wgscoverageplotter" | ||
description: Plot whole genome coverage from BAM/CRAM file as SVG | ||
keywords: | ||
- bam | ||
- cram | ||
- depth | ||
- coverage | ||
- xml | ||
- svg | ||
- visualization | ||
tools: | ||
- "jvarkit": | ||
description: "Java utilities for Bioinformatics." | ||
homepage: "https://github.com/lindenb/jvarkit" | ||
documentation: "https://jvarkit.readthedocs.io/" | ||
tool_dev_url: "https://github.com/lindenb/jvarkit" | ||
doi: "10.6084/m9.figshare.1425030" | ||
licence: ["MIT License"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test' ] | ||
- bam: | ||
type: file | ||
description: BAM/CRAM file from alignment | ||
pattern: "*.{bam,cram}" | ||
- bai: | ||
type: file | ||
description: BAI/CRAI file from alignment | ||
pattern: "*.{bai,crai}" | ||
- meta2: | ||
type: map | ||
description: | | ||
Groovy Map containing reference information | ||
e.g. [ id:'test_reference' ] | ||
- fasta: | ||
type: file | ||
description: The reference fasta file | ||
pattern: "*.fasta" | ||
- meta3: | ||
type: map | ||
description: | | ||
Groovy Map containing reference fai information | ||
e.g. [ id:'test_reference' ] | ||
- fai: | ||
type: file | ||
description: Index of reference fasta file | ||
pattern: "fasta.fai" | ||
- meta4: | ||
type: map | ||
description: | | ||
Groovy Map containing reference dict information | ||
e.g. [ id:'test_reference' ] | ||
- dict: | ||
type: file | ||
description: GATK sequence dictionary | ||
pattern: "*.dict" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing Sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- output: | ||
type: file | ||
description: Output SVG file | ||
pattern: "*.svg" | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@lindenb" | ||
maintainers: | ||
- "@lindenb" |
71 changes: 71 additions & 0 deletions
71
modules/nf-core/jvarkit/wgscoverageplotter/tests/main.nf.test
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,71 @@ | ||
// nf-core modules test jvarkit/wgscoverageplotter | ||
nextflow_process { | ||
|
||
name "Test Process JVARKIT_WGSCOVERAGEPLOTTER" | ||
script "../main.nf" | ||
process "JVARKIT_WGSCOVERAGEPLOTTER" | ||
config "./nextflow.config" | ||
|
||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "jvarkit" | ||
tag "jvarkit/wgscoverageplotter" | ||
|
||
test("sarscov2 - bam") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) | ||
] | ||
input[1] = [ [:] , file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] | ||
input[2] = [ [:] , file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] | ||
input[3] = [ [:] , file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true) ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert file(process.out.output[0][1]).exists() }, | ||
{ assert snapshot(process.out.versions).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
test("sarscov2 - bam - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] =[ | ||
[id:"test"], | ||
[], | ||
[] | ||
] | ||
input[1] = [ [] , [] ] | ||
input[2] = [ [] , [] ] | ||
input[3] = [ [] , [] ] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert file(process.out.output[0][1]).exists() }, | ||
{ assert snapshot(process.out.versions).match() } | ||
) | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
modules/nf-core/jvarkit/wgscoverageplotter/tests/main.nf.test.snap
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,28 @@ | ||
{ | ||
"sarscov2 - bam": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,b0860cf56f5babf5590a1fed61e8792f" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-09-03T14:00:13.118369362" | ||
}, | ||
|
||
"sarscov2 - bam - stub": { | ||
"content": [ | ||
[ | ||
"versions.yml:md5,b0860cf56f5babf5590a1fed61e8792f" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-09-03T14:00:13.118369362" | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
modules/nf-core/jvarkit/wgscoverageplotter/tests/nextflow.config
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,7 @@ | ||
process { | ||
|
||
withName: JVARKIT_WGSCOVERAGEPLOTTER { | ||
ext.args1 =" --max-depth 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,2 @@ | ||
jvarkit/wgscoverageplotter: | ||
- "modules/nf-core/jvarkit/wgscoverageplotter/**" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.