Skip to content

Conversation

@jarbet
Copy link
Contributor

@jarbet jarbet commented Jun 6, 2025

Previously estimate.subtypes() with subtype.model = 'PAMR' would error if any samples had >50% missing CpGs or any CpGs had >80% missing values (these are the default cutoffs used by impute::impute.knn for imputing missing values). This has been fixed such that now error handling for high missingness in CpGs is strictly handled by argument prop.missing.cutoff and validate.subtype.model.cpgs(). Further, if any CpGs or samples have >50% missing values, a warning will be printed to alert the user that the subtype assignment may be inaccurate.

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.

Closes #32

Testing Results

Case 1

input code
output

Case 2

input code
output

@jarbet jarbet changed the title Jarbet pamr impute knn dont stop print warning Change how PAMR handles missing values Jun 6, 2025
@jarbet jarbet requested a review from Copilot June 6, 2025 23:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request revises the handling of missing values when using the PAMR subtype model by updating error messaging and adding additional warnings for both CpGs and sample missingness.

  • Updated error message text for PAMR when prop.missing.cutoff is set to 1.
  • Added a new check and warning for samples with >50% missing values in validate.subtype.model.cpgs.R.
  • Updated tests, NEWS, and DESCRIPTION to reflect these changes.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/testthat/test-estimate.subtypes.R Added tests for updated error handling and missing data warnings for PAMR.
R/validate.subtype.model.cpgs.R Introduced a new sample missingness check and corresponding warning message.
R/estimate.subtypes.R Revised the error message for prop.missing.cutoff and updated the impute.knn call parameters.
NEWS.md Documented the bug fix for handling missing values with PAMR.
DESCRIPTION Updated version and release date.

jarbet and others added 3 commits June 6, 2025 16:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit a74dcca.
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.

PAMR imputation

2 participants