Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jorisvansteenbrugge
Copy link

@Jorisvansteenbrugge Jorisvansteenbrugge commented Oct 1, 2024

PR checklist

Closes #5976

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • nf-core modules test <MODULE> --profile docker

This PR implements pypgx/createinputvcf, which creates a vcf file from a bam file, specifically for pharmacogenomics genes

@Jorisvansteenbrugge Jorisvansteenbrugge requested a review from a team as a code owner October 1, 2024 13:30
@Jorisvansteenbrugge Jorisvansteenbrugge requested review from koenbossers and removed request for a team October 1, 2024 13:30
Copy link
Contributor

@nvnieuwk nvnieuwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi looking good, but here are some comments to stay consistent with the guidelines


script:
def args = task.ext.args ?: ''
def assembly = task.ext.assembly_version ?: "GRCh38"
Copy link
Contributor

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

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(' ')}" ?: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for pgx_genes

${args} \\
${pgx_genes} \\
--assembly ${assembly} \\
${prefix}_variants.vcf.gz \\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${prefix}_variants.vcf.gz \\
${prefix}.vcf.gz \\

This is to maintain the flexibility of prefix you can add _variants there if you want to add this to the file name

Comment on lines +48 to +49
touch ${prefix}_variants.vcf.gz
touch ${prefix}_variants.vcf.gz.tbi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
touch ${prefix}_variants.vcf.gz
touch ${prefix}_variants.vcf.gz.tbi
echo "" | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

nf-test has throws an error with gzipped files that are not actually gzipped

licence: ["MIT"]
identifier: ""
input:
- - "meta":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- - "meta":
- - meta:

assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.vcf[0][1]).name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test this a little better? You can use the nft-vcf nf-test plugin to easily test VCF files. This plugin is already enabled in this repository so you can immediately start using these methods

Comment on lines +65 to +67
{ assert snapshot(
file(process.out.vcf[0][1]).name,
process.out.versions).match() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ assert snapshot(
file(process.out.vcf[0][1]).name,
process.out.versions).match() }
{ assert snapshot(process.out).match() }

Stub tests don't need to be limited as they are empty files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new module: pypgx/createinputvcf
2 participants