-
Notifications
You must be signed in to change notification settings - Fork 0
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
indel matching on rsid #65
Merged
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
…d with genomic coordinates
alkaZeltser
requested review from
sorelfitzgibbon,
dan-knight and
forbiddenpersimmon
September 6, 2024 00:44
forbiddenpersimmon
approved these changes
Sep 7, 2024
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.
LGTM!
dan-knight
reviewed
Sep 11, 2024
|
||
# keep coordinates from VCF data for matched SNPs with coordinate mismatch | ||
merged.vcf.with.missing.pgs.data[!is.na(merged.vcf.with.missing.pgs.data$REF), 'CHROM'] <- merged.vcf.with.missing.pgs.data[!is.na(merged.vcf.with.missing.pgs.data$REF), 'CHROM.vcf']; | ||
merged.vcf.with.missing.pgs.data[!is.na(merged.vcf.with.missing.pgs.data$REF), 'POS'] <- merged.vcf.with.missing.pgs.data[!is.na(merged.vcf.with.missing.pgs.data$REF), 'POS.vcf']; |
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.
I wonder if this can be done all at once, without calling is.na(merged.vcf.with.missing.pgs.data$REF)
multiple times.
dan-knight
reviewed
Sep 11, 2024
dan-knight
reviewed
Sep 11, 2024
dan-knight
approved these changes
Sep 11, 2024
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.
I encountered a systematic issue with PGS Catalog harmonized coordinate data. Harmonized (GRCh37 to GRCh38) INDEL coordinates are almost always off by one base pair from genotype data that is called against the GRCh38 GENCODE reference with GATK HaplotypeCaller. Not sure if this happens with other aligners/variant callers/references, but since this is a pretty common workflow, it is worth accounting for. Note that this problem persists even when normalizing indels against the GRCh38 ENSEMBL reference (which is cited as the source of harmonization by the PGS Catalog).
By default, PGS data is matched to VCF data by genomic coordinate (CHROM, POS). I have added a secondary merge operation that only operates on SNPs missed from the primary merge. This merge attempts to match SNPs by rsID. Since rsID is not a consistent label, it is not recommended as a primary matching mechanism, however for the case of inconsistently harmonized INDEL coordinates, this works as a reasonable backup. rsID is also not a required column for PGS Catalog registration, so this method is conditional on availability of the rsID in PGS data.
In this PR:
combine.vcf.with.pgs()
for rsID based secondary matchingapply.polygenic.score()
missing genotype handling methods to account for a difference in coordinates between the PGS and VCF data of rsID-matched SNPsimport.pgs.weight.file
Note:
data.table
is now potentially a more sophisticated dependency, does anyone know if a full import is needed to manipulate data tables? @dan-knight ?I have read the code review guidelines and the code review best practice on GitHub check-list.
The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)-[brief_description_of_branch].
I have set up or verified the branch protection rule following the github standards before opening this pull request.
I have added the changes included in this pull request to
NEWS
under the next release version or unreleased, and updated the date.I have updated the version number in
metadata.yaml
andDESCRIPTION
.Both
R CMD build
andR CMD check
run successfully.Testing Results
All unit tests PASS