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

add strand flip check #67

Merged
merged 41 commits into from
Dec 2, 2024
Merged

add strand flip check #67

merged 41 commits into from
Dec 2, 2024

Conversation

alkaZeltser
Copy link
Collaborator

@alkaZeltser alkaZeltser commented Oct 31, 2024

This PR adds allele match checking and strand flip correction functionality.

For some background on strand flipping, check out my new discussion post:
#68

@RoniHaas I would appreciate your review of the key strand flip function (assess.pgs.vcf.allele.match)

Closes #63

  • Add DNA flip function (flips alleles to reverse complement)
  • Add allele match check function (checks for various mismatch cases including strand flip, and corrects strand flips)
  • Incorporate strand flip checking into the main apply.polygenic.score function
  • Add tests for above
  • Update all documentation (README, manual, vignette)
  • Export all relevant new functions through NAMESPACE
  • Update NEWS with new feature

This is a template for UCLA-CDS R package developers to create a github pull request template. Things should be adjusted for individual pipeline including:

  1. additional checklist items specific to the package
  2. a description of how testing is expected to be done
  3. a template list or table for testing results
  4. additional notes wrapped in <!--- ---> (or <!-- --> for inline comments) that help PR submitters to fill in.
  5. delete this block of instructional text.
  • 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 and DESCRIPTION.

  • Both R CMD build and R CMD check run successfully.

Testing Results

All unit tests pass

@alkaZeltser alkaZeltser marked this pull request as draft October 31, 2024 01:01
@alkaZeltser alkaZeltser marked this pull request as ready for review November 25, 2024 22:02
@alkaZeltser
Copy link
Collaborator Author

For those who are interested, check out the rendered manual:
ApplyPolygenicScore_2.0.0.pdf

And the rendered User Guide vignette:
UserGuide.pdf

@@ -21,7 +21,7 @@ validate.vcf.input <- function(vcf.data) {

}

validate.pgs.data.input <- function(pgs.weight.data, use.external.effect.allele.frequency) {
validate.pgs.data.input <- function(pgs.weight.data, use.external.effect.allele.frequency, correct.strand.flips, remove.ambiguous.allele.matches, remove.mismatched.indels) {
Copy link
Contributor

@dan-knight dan-knight Nov 27, 2024

Choose a reason for hiding this comment

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

These boolean flag arguments are a good opportunity to add clarity and establish default functionality. Just adding TRUE or FALSE defaults might go a long way here to implying the primary use case(s).

EDIT: Nevermind. Seems like you do that on the higher-level function. That's ideal. Sorry!!

Copy link

@forbiddenpersimmon forbiddenpersimmon left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@RoniHaas RoniHaas left a comment

Choose a reason for hiding this comment

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

Looks good, I think all possible cases have been addressed!

@alkaZeltser
Copy link
Collaborator Author

Thanks everyone! @forbiddenpersimmon @dan-knight next PR will be coming soon, and it's gonna be a release PR for new version and checks for next CRAN submission

@alkaZeltser alkaZeltser merged commit c3d48af into main Dec 2, 2024
6 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 strand-flip handling
4 participants