Skip to content

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

@joonlee3

Description

@joonlee3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions