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

Exclude samples #80

Merged
merged 4 commits into from
Sep 13, 2024
Merged

Exclude samples #80

merged 4 commits into from
Sep 13, 2024

Conversation

Will-Tyler
Copy link
Contributor

Overview

The bcftools view CLI allows users to exclude samples from the output with the ^ character. This pull request makes vcztools view do the same.

This pull request closes #74.

Testing

I had some unit and validation tests.

Discussion

bcftools view lets the user simultaneously include samples with -s and exclude samples with -S. I think the expected behavior in different cases (e.g. a sample that is both included and excluded) is not well-defined, so vcztools just throws an assertion error in this implementation. I can try to copy bcftools view's behavior if desired or open a separate issue to track this.

References

Copy link
Contributor

@tomwhite tomwhite left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @Will-Tyler.

bcftools view lets the user simultaneously include samples with -s and exclude samples with -S. I think the expected behavior in different cases (e.g. a sample that is both included and excluded) is not well-defined, so vcztools just throws an assertion error in this implementation. I can try to copy bcftools view's behavior if desired or open a separate issue to track this.

I think it is OK to raise an error in this case. If we want to match bcftools behaviour in the future then we can.

Can you add a test for this case please (failing if both -s and -S are specified)?

vcztools/cli.py Outdated Show resolved Hide resolved
tests/test_vcf_writer.py Outdated Show resolved Hide resolved
@tomwhite tomwhite merged commit 5904797 into sgkit-dev:main Sep 13, 2024
10 checks passed
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.

Add support to exclude samples
2 participants