scanpy.datasets.pbmc68k_reduced

scanpy.datasets.pbmc68k_reduced#

scanpy.datasets.pbmc68k_reduced()[source]#

Subsampled and processed 68k PBMCs.

PBMC 68k dataset from 10x Genomics.

The original PBMC 68k dataset was preprocessed with steps very similar to the following:

import scanpy as sc

adata = sc.read_10x_mtx(
    "./data/filtered/filtered_matrices_mex/hg19/",
    var_names="gene_symbols",
)
adata.var_names_make_unique()

sc.pp.filter_cells(adata, min_genes=200)
sc.pp.filter_genes(adata, min_counts=125)

sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
if sc.settings.preset == sc.Preset.ScanpyV2Preview:
    adata.layers["log_counts"] = adata.X.copy()
else:
    adata.raw = adata.copy()
    adata.raw.X.data = adata.raw.X.data.round(3)

sc.pp.highly_variable_genes(adata)
sc.pp.subsample(adata, n_obs=700)
sc.pp.scale(adata)

The .obs["bulk_labels"] were obtained as described in Zheng et al. [2017]. UMAP coordinates, louvain clustering and gene rankings were calculated based on the bulk_labels.

Return type:

AnnData

Returns:

Annotated data matrix.

Examples

>>> import scanpy as sc
>>> sc.datasets.pbmc68k_reduced()
AnnData object with n_obs × n_vars = 700 × 765
    obs: 'bulk_labels', 'n_genes', 'percent_mito', 'n_counts', 'S_score', 'G2M_score', 'phase', 'louvain'
    var: 'n_counts', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'
    uns: 'bulk_labels_colors', 'louvain', 'louvain_colors', 'neighbors', 'pca', 'rank_genes_groups'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'connectivities', 'distances'
    layers: 'counts', None (.X)