8000 Convert to `TRUE`/`FALSE` mapping arguments by lazappi · Pull Request #274 · scverse/anndataR · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Convert to TRUE/FALSE mapping arguments #274

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lazappi
Copy link
Collaborator
@lazappi lazappi commented May 27, 2025

Update mapping arguments to use TRUE/FALSE instead of NULL/c()

  • TRUE uses the default guessed mapping
  • FALSE maps nothing for that slot
  • Vectors let users define what is mapped

Fixes #268

@lazappi lazappi requested review from LouiseDck, rcannood and Copilot May 27, 2025 11:05
Copy link
@Copilot 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 PR transitions conversion mapping arguments from NULL/empty lists to explicit TRUE/FALSE flags, where TRUE triggers default guessing and FALSE disables that slot. It updates core conversion functions, introduces a get_mapping helper, and refreshes vignettes, tests, and man pages to reflect the new API.

  • Refactor: conversion functions now use get_mapping(mapping, guesser, ...) with boolean defaults.
  • Documentation: vignettes and Rd files updated to show TRUE/FALSE usage.
  • Tests: replaced legacy from_Seurat calls with as_AnnData and adjusted mapping arguments.

Reviewed Changes

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

Show a summary per file
File Description
vignettes/usage_singlecellexperiment.Rmd Examples updated to use as_SingleCellExperiment and boolean mappings
vignettes/singlecellexperiment_mapping.Rmd Revised narrative and examples for FALSE mapping; adjusted bullet points
vignettes/seurat_mapping.Rmd Updated Seurat conversion examples to use FALSE mappings
tests/testthat/test-Seurat.R Switched from from_Seurat to as_AnnData in tests
man/as_SingleCellExperiment.Rd Changed default mapping args from NULL to TRUE
man/as_Seurat.Rd Changed default mapping args from NULL to TRUE
man/as_AnnData.Rd Changed default mapping args from NULL to TRUE
man/AbstractAnnData.Rd Updated default mapping args and usage examples
R/utils.R Added get_mapping() helper and its documentation
R/as.R Refreshed commented examples to use boolean defaults
R/SingleCellExperiment.R Refactored mapping logic to use get_mapping(); replaced simple with dataframe mapping
R/Seurat.R Refactored mapping logic to use get_mapping()
R/AnnData.R Updated generics and methods to use boolean defaults; changed signatures
R/AbstractAnnData.R Updated R6 methods to default mapping args to TRUE
Comments suppressed due to low confidence (1)

R/AnnData.R:247

  • The assay_name parameter in as_AnnData.SingleCellExperiment was changed to default TRUE, but it should remain NULL (or a character) to properly select which assay to map. Please revert it to NULL.
assay_name = TRUE,

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Do not copy items if mapping is empty vector c()
1 participant
0