-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: a new GenotypesPLINKTR
class for reading TRs from PGEN files
#222
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
also, add test for reading TRs in TestGenotypesPLINK
…KTR class of the test/test_data.py file, also I already added the __init__ function in the GenotypesPLINKTR class in genotype.py in the data file
…s(), check_biallelic(), and check_maf() for GenotypesPLINKTR
by using broadcasting across the number of variants
where there is an extra ALT allele that isn't used within any of the genotypes
also explain how to convert TR VCFs to PGEN
This reverts commit 02cbc72.
…ools into feat/genotypesplinktr
aryarm
changed the title
feat: a new
feat: a new Sep 15, 2023
GenotypesPlinkTR
class for reading TRs from PGEN filesGenotypesPLINKTR
class for reading TRs from PGEN files
mlamkin7
requested changes
Sep 16, 2023
mlamkin7
approved these changes
Sep 16, 2023
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.
All good.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #73 (comment)
This code was primarily authored by our summer high school student, @gonzalogc1, but he had to leave before we could finish it off. Thanks for all of the help this summer, Gonzalo!
Overview
This PR enables reading and writing multiallelic variants from a PGEN file. It also adds a new
GenotypesPLINKTR
class capable of reading TRs from PGEN files similar to theGenotypesTR
class.Note: A newer version of Pgenlib is required as a result of this change. The pyproject.toml file has been updated accordingly.
Usage and Documentation
The interface for the
GenotypesPLINK
class has not changed. It will work the same as before but will cease to raise an error for multiallelic variants. This functionality also carries over to thesimgenotype
command.The
GenotypesPLINKTR
class works as expected; it has the same methods as theGenotypesTR
andGenotypesPLINK
classes, but a few of them from theGenotypesPLINK
class have been disabled. Refer to the documentation for a full list of the disabled methods and a more thorough description of how to use the new class.Tests
We added new tests and a new test data file for the
GenotypesPLINK
andGenotypesPLINKTR
classes. Thetests/data/simple-tr.pgen
set of files are similar to thetests/data/simple_tr.pgen
set of files except that some alleles have been removed so that the VCF file passes the checks implemented byplink2
when converting from VCF to PGEN.Future work
dosage
command for storing TR motif counts in PGEN files #221GenotypesPLINKTR.read_variants()
. Those objects can then be reused byGenotypesPLINKTR.read()
. This will require a larger refactor that is out of scope for this PR.