接着上文继续学习 Scanpy 的相关语法 ,参考网页
# Preprocessing and clustering
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| import scanpy as sc import anndata as ad
sc.settings.set_figure_params(dpi=50, facecolor="white")
samples = { "s1d1": "D:\\articleCode\\research\\s1d1_filtered_feature_bc_matrix.h5", "s1d3": "D:\\articleCode\\research\\s1d3_filtered_feature_bc_matrix.h5", } adatas = {}
for sample_id, path in samples.items(): sample_adata = sc.read_10x_h5(path) sample_adata.var_names_make_unique() print(sample_adata) adatas[sample_id] = sample_adata
adata = ad.concat(adatas, label="sample") adata.obs_names_make_unique() print(adata.obs["sample"].value_counts()) print(adata)
|