Compiled on: July, 23 2017.
My example.
%config InlineBackend.figure_formats = ['png2x'] # for vector graphics quality, set to svg
import numpy as np
import scanpy.api as sc
sc.settings.verbosity = 3 # show some output
sc.settings.set_dpi(80) # low pixel number yields small inline figures
sc.logging.print_version_and_date()
Running Scanpy version 0.1+139.g2c509d7.dirty on 2017-07-23 11:49.
Get help.
# help(sc.read)
Read and annotate data.
# read data from any path on your system
path_to_data = './data/myexample/'
adata = sc.read(path_to_data + 'myexample.csv')
# other data reading examples
# adata = sc.read(path_to_data + 'myexample.csv')
# adata = sc.read(path_to_data + 'myexample.h5', sheet='countmatrix')
# adata = sc.read(path_to_data + 'myexample.xlsx', sheet='countmatrix')
# adata = sc.read(path_to_data + 'myexample.txt')
# in the data matrix adata.X, rows should correspond to samples and columns to genes
# to match this convention, transpose your data if necessary
# adata = adata.transpose()
# set group names (as strings)
adata.smp['my_groups'] = np.genfromtxt(path_to_data + 'mygroups.csv', dtype=str)
# set root cell
adata.add['iroot'] = 336
For single-cell RNA-seq, consider running a preprocessing recipe.
sc.pp.recipe_zheng17(adata)
Run and plot a tool.
sc.tl.dpt(adata)
sc.pl.dpt(adata)