Skip to content

Filter cell meta data in ReadPNA_Seurat#145

Open
ludvigla wants to merge 4 commits into
mainfrom
pna-2926
Open

Filter cell meta data in ReadPNA_Seurat#145
ludvigla wants to merge 4 commits into
mainfrom
pna-2926

Conversation

@ludvigla

@ludvigla ludvigla commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds a meta data filter to ReadPNA_Seurat to keep the meta.data slot clean. Full meta data can be obtained by setting detailed_meta_data = TRUE.

The columns to keep are defined in the CELL_META_COLS variable. Currently, these are:

CELL_META_COLS <- c(
  "n_umi", "n_edges", "n_antibodies", "isotype_fraction",
  "average_k_core", "reads_in_component", "tau", "tau_type",
  "n_umi1", "n_umi2", "sample"
)

Fixes: PNA-3078

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

How Has This Been Tested?

Added new test to tests/testthat/test-ReadPNA_Seurat.R

PR checklist:

  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have documented any significant changes to the code in CHANGELOG.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in mechanism to retain full per-cell metadata when loading PNA PXL files into Seurat, while defaulting to a curated subset of QC-relevant columns to keep meta.data smaller/cleaner (Fixes: PNA-2926).

Changes:

  • Added detailed_meta_data argument to ReadPNA_Seurat(); when FALSE it filters meta.data to CELL_META_COLS.
  • Introduced CELL_META_COLS as a central definition of which cell metadata columns are retained by default.
  • Updated documentation, changelog, and added a test to cover the new behavior.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
R/load_data_pna.R Adds detailed_meta_data parameter, validates it, and filters cell metadata by default.
R/aaa.R Defines CELL_META_COLS constant used for default metadata filtering.
tests/testthat/test-ReadPNA_Seurat.R Adds a test asserting detailed metadata loads more columns than the default.
man/ReadPNA_Seurat.Rd Documents the new detailed_meta_data argument.
CHANGELOG.md Notes the new default metadata filtering behavior and how to opt into detailed metadata.
Files not reviewed (1)
  • man/ReadPNA_Seurat.Rd: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/load_data_pna.R

@maxkarlsson maxkarlsson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should drop tau!

Comment thread R/aaa.R Outdated
Comment thread R/load_data_pna.R
@ludvigla ludvigla requested a review from maxkarlsson June 22, 2026 18:02

@maxkarlsson maxkarlsson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

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.

3 participants