1
2
3
4
5
6
7
8
9
10
|
# adata = scvi.data.heart_cell_atlas_subsampled(save_path=save_dir.name)
adata = sc.read(os.path.join(save_dir, "hca_subsampled_20k.h5ad"))
remove = ["doublets", "NotAssigned"]
keep = [c not in remove for c in adata.obs.cell_type.values]
adata = adata[keep, :].copy()
adata
# AnnData object with n_obs × n_vars = 18641 × 26662
# obs: 'NRP', 'age_group', 'cell_source', 'cell_type', 'donor', 'gender', 'n_counts', 'n_genes', 'percent_mito', 'percent_ribo', 'region', 'sample', 'scrublet_score', 'source', 'type', 'version', 'cell_states', 'Used'
# var: 'gene_ids-Harvard-Nuclei', 'feature_types-Harvard-Nuclei', 'gene_ids-Sanger-Nuclei', 'feature_types-Sanger-Nuclei', 'gene_ids-Sanger-Cells', 'feature_types-Sanger-Cells', 'gene_ids-Sanger-CD45', 'feature_types-Sanger-CD45', 'n_counts'
# uns: 'cell_type_colors'
|