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

Ensure chrX and X are treated equally #135

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

fellen31
Copy link
Contributor

@fellen31 fellen31 commented Sep 24, 2024

Description

Closes #132.

Adds a VCF file with chr prefix, and a test to check that models are equal between both files. I don't know that much python/pytest so let me know if the code can be improved.

Added

Changed

Fixed

  • Fixed wrong models when chromosome X was named chrX and not X.

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_[TOOL]-t [TOOL] -b [THIS-BRANCH-NAME] -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@fellen31 fellen31 force-pushed the fix-chr branch 7 times, most recently from 7f802ed to 7d1e341 Compare September 24, 2024 11:35
@fellen31 fellen31 force-pushed the fix-chr branch 2 times, most recently from 6677c92 to 9b143ef Compare October 1, 2024 12:57
@fellen31 fellen31 marked this pull request as ready for review October 1, 2024 13:05
@fellen31 fellen31 requested review from dnil and torbjorgen October 1, 2024 13:05
Copy link
Contributor

@torbjorgen torbjorgen left a comment

Choose a reason for hiding this comment

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

Suggestion in code to reduce code duplication, rest looks great. 👍

variant: Dict[str, str] = get_variant_dict(line, header.header)
variant['info_dict'] = get_info_dict(variant['INFO'])
yield variant

Copy link
Contributor

Choose a reason for hiding this comment

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

One suggestion would be to move the variant generation methods into a fixture in the functionality module, so that we reduce duplicate code, related fellen31@bc15a2f

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @torbjorgen, I'll look into moving it into a fixture, and just ping you afterwards so you can make sure it looks ok.

@fellen31
Copy link
Contributor Author

fellen31 commented Oct 8, 2024

I don't think I have enough experience with pytest yet @torbjorgen to fully understand how to best solve this. I don't want to make the codebase worse, but I also know this project is not a priority.

Is moving the common functions to a test_utils.py an okay middle way to reduce code duplication without dealing with pytest fixtures?

Copy link
Contributor

@torbjorgen torbjorgen left a comment

Choose a reason for hiding this comment

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

Yes excellent solution. Let's not overdo it 👍

@fellen31 fellen31 merged commit 5bee959 into Clinical-Genomics:master Oct 8, 2024
1 check passed
@fellen31 fellen31 deleted the fix-chr branch October 8, 2024 11:22
@dnil dnil mentioned this pull request Oct 24, 2024
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model discrepancy when chrX has chr prefix (GRCh38)
2 participants