Setup Seurat Object

#Read in log-space expression matrix. Has been pre-computed and normalized (see manuscript for exact details)
#The data was run in three batches (zf1, zf2, zf3), which is denoted in the column name
zfish.data=read.table("~/seurat_files/zdata.matrix.txt",sep="\t",header=TRUE)

#Due to the high dynamic range in RNA-seq, transform data to log-space. Not required for Seurat, but highly recommended
zfish.log=log(zfish.data+1)

#Create and setup the Seurat object. Include all genes detected in > 3 cells (expression >0.01), and all cells with > 2k genes
#Cells will be initially assigned to an identity class (grouping) based on the first field (underscore-delimited)
zf.all=new("seurat",raw.data=zfish.log)
zf.all=setup(zf.all,project="zfish",min.cells = 3,min.genes = 2000,is.expr=0.01,names.field = 1,names.delim = "_")

zf.all
## An object of class seurat in project zfish
##  10945 genes across 945 samples.

Basic exploration of data

#View the expression of genes and basic metrics across samples
vlnPlot(zf.all,c("ACTB2","VENT","CHD","nGene"))