Skip to content

Conversation

@jhaberbe
Copy link

@jhaberbe jhaberbe commented Aug 1, 2025

I ran into a problem that occurs due to the naming scheme changes between older and newer versions of "var": meta.features / meta.data. I just added the following code to seurat2anndata

Someone else had this before (#82), and it seems like a quick fix that worked for me.

var <- .regularise_df(
  if (slotExists(Seurat::GetAssay(obj, assay), "meta.features")) {
    Seurat::GetAssay(obj, assay)@meta.features
  } else if (slotExists(Seurat::GetAssay(obj, assay), "meta.data")) {
    Seurat::GetAssay(obj, assay)@meta.data
  } else {
    stop("No meta.features or meta.data found on assay.")
  },
  drop_single_values = drop_single_values
)
rownames(var) <- rownames(Seurat::GetAssay(obj, assay = assay)@features@.Data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant