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

Cannot retrieve matrix and metadata after reading a h5ad data with read_h5ad #30

Open
joonlee3 opened this issue Aug 19, 2024 · 0 comments

Comments

@joonlee3
Copy link

Hi,

I was trying to convert a h5ad file (anndata) to a Seurat object. It seems that read_h5ad read my h5ad file in R.

> COPD.anndata <- read_h5ad("COPD.h5ad")
> COPD.anndata

AnnData object with n_obs × n_vars = 918486 × 5101
    obs: 'cell_id', 'transcript_counts', 'control_probe_counts', 'genomic_control_counts', 'control_codeword_counts', 'unassigned_codeword_counts', 'deprecated_codeword_counts', 'total_counts', 'cell_area', 'nucleus_area', 'nucleus_count', 'z_level', 'cell_labels', 'nucleus_ratio', 'n_genes_by_counts', 'log1p_n_genes_by_counts', 'log1p_total_counts', 'pct_counts_in_top_10_genes', 'pct_counts_in_top_25_genes', 'pct_counts_in_top_50_genes', 'pct_counts_in_top_100_genes'
    var: 'gene_ids', 'feature_types', 'genome'
    uns: 'spatialdata_attrs'
    obsm: 'spatial'

However, when I retrieved matrix data and metadata in the object, I've got the following errors

> COPD.anndata$X

Error in as.integer(as_r_value(x$indices)) : `
  cannot coerce type 'environment' to vector of type 'integer'

> COPD.anndata$obs

Error in py_convert_pandas_df(x) : `
  INTEGER() can only be applied to a 'integer', not a 'environment'

Please let me know if there is any solution. Thank you.

Best,
Joon

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