-
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: PERBASE #7457
new module: PERBASE #7457
Changes from all commits
ef44c51
6987875
b2b4b25
ae3dc8d
dab52a4
f6608c0
ad12a35
108ad36
f656b93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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::perbase=0.10.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
process PERBASE { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/perbase:0.10.2--h15397dd_0': | ||
'biocontainers/perbase:0.10.2--h15397dd_0' }" | ||
|
||
input: | ||
tuple val(meta), path(bam), path(index) | ||
tuple val(meta2), path(fasta), path(fai) | ||
|
||
output: | ||
tuple val(meta), path("*.tsv.gz"), emit: tsv | ||
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}" | ||
def reference = fasta ? "--ref-fasta ${fasta}" : "" | ||
""" | ||
perbase \\ | ||
base-depth \\ | ||
$bam \\ | ||
$args \\ | ||
$reference \\ | ||
--threads $task.cpus \\ | ||
--bgzip \\ | ||
--output ${prefix}.tsv.gz | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
perbase: \$(perbase --version |& sed '1!d ; s/perbase //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be applied in the module template upstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly, I need to discuss this with core There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I can look at opening a PR if needed. |
||
""" | ||
echo "" | gzip > ${prefix}.tsv.gz | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
perbase: \$(perbase --version |& sed '1!d ; s/perbase //') | ||
END_VERSIONS | ||
""" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "perbase" | ||
description: Per-base metrics on BAM/CRAM files. | ||
keywords: | ||
- bam | ||
- cram | ||
- depth | ||
tools: | ||
- "perbase": | ||
description: "Per-base metrics on BAM/CRAM files." | ||
homepage: "https://github.com/sstadick/perbase/blob/v0.10.2/README.md" | ||
documentation: "https://github.com/sstadick/perbase/blob/v0.10.2/README.md" | ||
tool_dev_url: "https://github.com/sstadick/perbase" | ||
licence: ["MIT"] | ||
identifier: biotools:perbase | ||
|
||
input: | ||
# Only when we have meta | ||
- - meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please confirm that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is from the nf-core module template, but I believe it's still relevant here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, thanks |
||
- bam: | ||
type: file | ||
description: Sorted BAM/CRAM file | ||
pattern: "*.{bam,cram}" | ||
ontologies: | ||
- edam: "http://edamontology.org/format_25722" | ||
- edam: "http://edamontology.org/format_3462" | ||
|
||
- index: | ||
type: file | ||
description: BAI/CRAI file | ||
pattern: "*.{bai,crai}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there no suitable index format on EDAM? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is for BAI: https://edamontology.github.io/edam-browser/#format_3327 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add the best fit for each entry? It will make life easier for some people There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added the ontology for BAI. The parent Data index format sounded the most appropriate, but has the |
||
ontologies: | ||
- edam: "http://edamontology.org/format_3327" | ||
- - meta2: | ||
type: map | ||
description: | | ||
Groovy Map containing reference information | ||
e.g. [ id:'genome' ] | ||
- fasta: | ||
type: file | ||
description: Reference fasta (optional) | ||
pattern: "*.{fasta,fa}" | ||
ontologies: | ||
- edam: "http://edamontology.org/format_1929" | ||
- fai: | ||
type: file | ||
description: FAI file (optional) | ||
pattern: "*.{fai}" | ||
output: | ||
- tsv: | ||
#Only when we have meta | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- "*.tsv.gz": | ||
type: file | ||
description: TSV file | ||
pattern: "*.{tsv.gz}" | ||
ontologies: | ||
- edam: "http://edamontology.org/format_3475" | ||
|
||
- versions: | ||
- "versions.yml": | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@camlloyd" | ||
maintainers: | ||
- "@camlloyd" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
nextflow_process { | ||
|
||
name "Test Process PERBASE" | ||
script "../main.nf" | ||
process "PERBASE" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "perbase" | ||
|
||
test("homo_sapiens - illumina - cram") { | ||
|
||
|
||
when { | ||
process { | ||
""" | ||
|
||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), | ||
] | ||
input[1] = [ | ||
[ id:'genome' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) | ||
|
||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("homo_sapiens - illumina - cram - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
|
||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true) | ||
] | ||
input[1] = [ | ||
[ id:'genome' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("homo_sapiens - illumina - bam") { | ||
|
||
|
||
when { | ||
process { | ||
""" | ||
|
||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) | ||
] | ||
input[1] = [[],[],[]] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("homo_sapiens - illumina - bam - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
|
||
input[0] = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) | ||
] | ||
input[1] = [[],[],[]] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
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.
Harshil alignment here would be great
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.
Should this be applied in the module template upstream?
https://github.com/nf-core/tools/blob/main/nf_core/module-template/main.nf