<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Clustering the subsampled 1.3 M cells
The data consists in 20K Neurons, downsampled from 1.3 Million Brain Cells from E18 Mice and is freely available from 10x Genomics (here).
Step1:  Run standard preprocessing steps, see here.
Step2:  Now compare this with the reference clustering of PAGA preprint, Suppl. Fig. 12, available from here.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
import scanpy.api as sc
sc.settings.verbosity = 3  # verbosity: errors (0), warnings (1), info (2), hints (3)
sc.settings.set_figure_params(dpi=70)  # dots (pixels) per inch determine size of inline figures
sc.logging.print_versions()
adata = sc.read_10x_h5('./data/1M_neurons_neuron20k.h5')
adata.var_names_make_unique()
adata
Explanation: Clustering the subsampled 1.3 M cells
The data consists in 20K Neurons, downsampled from 1.3 Million Brain Cells from E18 Mice and is freely available from 10x Genomics (here).
End of explanation
sc.pp.recipe_zheng17(adata)
sc.tl.pca(adata)
sc.pp.neighbors(adata)
sc.tl.umap(adata)
sc.tl.louvain(adata)
sc.tl.paga(adata)
sc.pl.paga_compare(adata, edges=True, threshold=0.05)
Explanation: Run standard preprocessing steps, see here.
End of explanation
anno = pd.read_csv('/Users/alexwolf/Dropbox/1M/louvain.csv.gz', compression='gzip', header=None, index_col=0)
anno.columns = ['louvain_ref']
adata.obs['louvain_ref'] = anno.loc[adata.obs.index]['louvain_ref'].astype(str)
sc.pl.umap(adata, color=['louvain_ref'], legend_loc='on data')
adata.write('./write/subsampled.h5ad')
Explanation: Now compare this with the reference clustering of PAGA preprint, Suppl. Fig. 12, available from here.
End of explanation
<END_TASK>