-
Notifications
You must be signed in to change notification settings - Fork 691
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
pypgx/createinputvcf #6720
base: master
Are you sure you want to change the base?
pypgx/createinputvcf #6720
Changes from all commits
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::pypgx=0.25.0 |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||||||
process PYPGX_CREATEINPUTVCF { | ||||||||||
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/pypgx:0.25.0--pyh7e72e81_0': | ||||||||||
'biocontainers/pypgx:0.25.0--pyh7e72e81_0' }" | ||||||||||
|
||||||||||
input: | ||||||||||
tuple val(meta), path(bam), path(bai) | ||||||||||
tuple val(meta2), path(fasta) | ||||||||||
|
||||||||||
|
||||||||||
output: | ||||||||||
tuple val(meta), path("*.vcf.gz"), emit: vcf | ||||||||||
tuple val(meta), path("*.vcf.gz.tbi"), emit: tbi | ||||||||||
path("versions.yml"), emit: versions | ||||||||||
|
||||||||||
when: | ||||||||||
task.ext.when == null || task.ext.when | ||||||||||
|
||||||||||
script: | ||||||||||
def args = task.ext.args ?: '' | ||||||||||
def assembly = task.ext.assembly_version ?: "GRCh38" | ||||||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||||||
def pgx_genes = "--genes ${task.ext.pgx_genes.join(' ')}" ?: '' | ||||||||||
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. Same for |
||||||||||
|
||||||||||
""" | ||||||||||
pypgx create-input-vcf \\ | ||||||||||
${args} \\ | ||||||||||
${pgx_genes} \\ | ||||||||||
--assembly ${assembly} \\ | ||||||||||
${prefix}_variants.vcf.gz \\ | ||||||||||
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.
Suggested change
This is to maintain the flexibility of |
||||||||||
${fasta} \\ | ||||||||||
$bam | ||||||||||
|
||||||||||
cat <<-END_VERSIONS > versions.yml | ||||||||||
"${task.process}": | ||||||||||
pypgx: \$(echo \$(pypgx -v 2>&1) | sed 's/.* //') | ||||||||||
END_VERSIONS | ||||||||||
""" | ||||||||||
|
||||||||||
stub: | ||||||||||
def args = task.ext.args ?: '' | ||||||||||
def prefix = task.ext.prefix ?: "${meta.id}" | ||||||||||
""" | ||||||||||
touch ${prefix}_variants.vcf.gz | ||||||||||
touch ${prefix}_variants.vcf.gz.tbi | ||||||||||
Comment on lines
+48
to
+49
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.
Suggested change
|
||||||||||
|
||||||||||
cat <<-END_VERSIONS > versions.yml | ||||||||||
"${task.process}": | ||||||||||
pypgx: \$(echo \$(pypgx -v 2>&1) | sed 's/.* //') | ||||||||||
END_VERSIONS | ||||||||||
""" | ||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,69 @@ | ||||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||||||
name: "pypgx_createinputvcf" | ||||||
description: Call SNVs/indels from BAM files for all target genes. | ||||||
keywords: | ||||||
- pypgx | ||||||
- Pharmacogenetics | ||||||
- variants | ||||||
tools: | ||||||
- "pypgx": | ||||||
description: "A Python package for pharmacogenomics research" | ||||||
homepage: "https://pypgx.readthedocs.io/en/latest/" | ||||||
documentation: "https://pypgx.readthedocs.io/en/latest/" | ||||||
tool_dev_url: "https://github.com/sbslee/pypgx" | ||||||
doi: "10.1371/journal.pone.0272129" | ||||||
licence: ["MIT"] | ||||||
identifier: "" | ||||||
input: | ||||||
- - "meta": | ||||||
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.
Suggested change
|
||||||
type: map | ||||||
description: | | ||||||
Groovy Map containing sample information | ||||||
e.g. [id: 'test'] | ||||||
- bam: | ||||||
type: file | ||||||
description: Input BAM file | ||||||
pattern: "*.{bam}" | ||||||
- bai: | ||||||
type: file | ||||||
description: Input BAM index file | ||||||
pattern: "*.{bam.bai}" | ||||||
- - meta2: | ||||||
type: map | ||||||
description: | | ||||||
Groovy Map containing sample information | ||||||
e.g. [id: 'test'] | ||||||
- fasta: | ||||||
type: file | ||||||
description: Reference genome file | ||||||
pattern: "*.{fasta,fa,fna,fasta.gz,fa.gz,fna.gz}" | ||||||
output: | ||||||
- vcf: | ||||||
- meta: | ||||||
type: map | ||||||
description: | | ||||||
Groovy Map containing sample information | ||||||
e.g. [id: 'test'] | ||||||
- "*.vcf.gz": | ||||||
type: file | ||||||
description: VCF file containing called SNVs/indels | ||||||
pattern: "*.vcf.gz" | ||||||
- tbi: | ||||||
- meta: | ||||||
type: map | ||||||
description: | | ||||||
Groovy Map containing sample information | ||||||
e.g. [id: 'test'] | ||||||
- "*.vcf.gz.tbi": | ||||||
type: file | ||||||
description: File containing the VCF tabix index | ||||||
pattern: "*.vcf.gz.tbi" | ||||||
- versions: | ||||||
- versions.yml: | ||||||
type: file | ||||||
description: File containing software versions | ||||||
pattern: "versions.yml" | ||||||
authors: | ||||||
- "@jorisvansteenbrugge" | ||||||
maintainers: | ||||||
- "@jorisvansteenbrugge" |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,71 @@ | ||||||||||
// nf-core modules test pypgx/createinputvcf | ||||||||||
nextflow_process { | ||||||||||
|
||||||||||
name "Test Process PYPGX_CREATEINPUTVCF" | ||||||||||
script "../main.nf" | ||||||||||
process "PYPGX_CREATEINPUTVCF" | ||||||||||
config "./nextflow.config" | ||||||||||
|
||||||||||
tag "modules" | ||||||||||
tag "modules_nfcore" | ||||||||||
tag "pypgx" | ||||||||||
tag "pypgx/createinputvcf" | ||||||||||
|
||||||||||
|
||||||||||
test("human paired end bam - genome.fa") { | ||||||||||
when { | ||||||||||
process { | ||||||||||
""" | ||||||||||
input[0] = [ | ||||||||||
[id: 'test'], | ||||||||||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam', checkIfExists: true), | ||||||||||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai', checkIfExists: true) | ||||||||||
] | ||||||||||
input[1] = [ | ||||||||||
[id: 'GRCh38'], | ||||||||||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) | ||||||||||
] | ||||||||||
""" | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
then { | ||||||||||
assertAll( | ||||||||||
{ assert process.success }, | ||||||||||
{ assert snapshot( | ||||||||||
file(process.out.vcf[0][1]).name, | ||||||||||
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 test this a little better? You can use the |
||||||||||
process.out.versions).match() } | ||||||||||
) | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
|
||||||||||
test("stub") { | ||||||||||
options "-stub" | ||||||||||
|
||||||||||
when { | ||||||||||
process { | ||||||||||
""" | ||||||||||
input[0] = [ | ||||||||||
[id: 'test'], | ||||||||||
[], | ||||||||||
[] | ||||||||||
] | ||||||||||
input[1] = [ | ||||||||||
[id: 'test_genome'], | ||||||||||
[] | ||||||||||
] | ||||||||||
""" | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
then { | ||||||||||
assertAll( | ||||||||||
{ assert process.success }, | ||||||||||
{ assert snapshot( | ||||||||||
file(process.out.vcf[0][1]).name, | ||||||||||
process.out.versions).match() } | ||||||||||
Comment on lines
+65
to
+67
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.
Suggested change
Stub tests don't need to be limited as they are empty files |
||||||||||
) | ||||||||||
} | ||||||||||
} | ||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"stub": { | ||
"content": [ | ||
"test_variants.vcf.gz", | ||
[ | ||
"versions.yml:md5,6afe5f69d9cb49f74eb1958a8ba2e990" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-10-01T14:20:26.587276" | ||
}, | ||
"human paired end bam - genome.fa": { | ||
"content": [ | ||
"test_variants.vcf.gz", | ||
[ | ||
"versions.yml:md5,6afe5f69d9cb49f74eb1958a8ba2e990" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-10-01T14:10:19.196392" | ||
} | ||
} |
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 file can be removed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
process { | ||
withName: "PYPGX_CREATEINPUTVCF" { | ||
|
||
ext.assembly_version = {"GRCh38"} | ||
ext.pgx_genes = {["GRIK1"]}} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pypgx/createinputvcf: | ||
- "modules/nf-core/pypgx/createinputvcf/**" |
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.
This should be a value input. We don't allow additional external arguments to keep everything consistent