Open nh-codem opened 4 days ago
here's the code:
adata = sc.read_h5ad("xxxxx") ctype = "XXXX" adata_subset = adata [adata .obs.ctype== ctype].copy() counts_data = pd.DataFrame(adata_subset.X.toarray() ,index= adata_subset.obs_names, columns = adata_subset.var_names).T.rename_axis('gene', inplace=False) metadata_sub = adata_subset.obs[["celltypes"]] eso = cellex.ESObject(data=counts_data, annotation=metadata_sub, verbose=False) eso.compute(verbose=False)
here's the code: