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

X and var not available #29

Open
weshorton opened this issue Aug 9, 2024 · 0 comments
Open

X and var not available #29

weshorton opened this issue Aug 9, 2024 · 0 comments

Comments

@weshorton
Copy link

Unable to access X or var in the object.

Download pbmc_1k_protein_v3_processed.h5ad from here into ~/Downloads folder.

Example in R

library(anndata)
test_data <- read_h5ad("~/Downloads/pbmc_1k_protein_v3_processed.h5ad")
test_data

Screenshot 2024-08-09 at 11 58 05 AM

names_v <- names(test_data)
names_v

Screenshot 2024-08-09 at 11 58 32 AM

Test all object elements except the two problem ones:

objs_ls <- list()
badNames_v <- c("var", "X")
for (i in 1:length(names_v)) {
  
  currName_v <- names_v[i]
  cat(currName_v, "\n")
  if (currName_v %in% badNames_v) next
  
  objs_ls[[currName_v]] <- test_data[[currName_v]]
  
}

Test var:

test_data$var

Screenshot 2024-08-09 at 12 00 39 PM
Test X:

test_data$X

Screenshot 2024-08-09 at 12 01 23 PM

Example in Python

import anndata as ad
test_path = "/Users/hortowe/Downloads/pbmc_1k_protein_v3_processed.h5ad"
test_data = ad.read_h5ad(test_path)
print(test_data)

Screenshot 2024-08-09 at 12 06 12 PM

print(test_data.var)

Screenshot 2024-08-09 at 12 07 13 PM

print(test_data.X)

Screenshot 2024-08-09 at 12 06 42 PM

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

No branches or pull requests

1 participant