Before running these functions (those starting with zf.), or loading the rgl library, please make sure an X11 client (i.e. XQuartz) is installed
#load previous data object, enables you to start tutorial from Part 4.
library(rgl)
load("~/seurat_files/output_part3.Robj")
Draw inferred in situ patterns for a few known genes
zf.insitu.lateral(zf, "GSC",label=FALSE)
zf.insitu.lateral(zf, "SOX3",label=FALSE)
zf.insitu.lateral(zf, "VED",label=FALSE)
Draw inferred in situ patterns for a few new genes
zf.insitu.lateral(zf, "RIPPLY1",label=FALSE)
zf.insitu.lateral(zf, "DUSP4",label=FALSE)
zf.insitu.lateral(zf, "ETS2",label=FALSE)
Focused analysis of cells near the margin
zf.centroids=get.centroids(zf); colnames(zf.centroids)=c("bin.tier","bin.dv")
margin.cells=rownames(subset(zf.centroids,bin.tier>5))
zf.margin=subsetData(zf,cells.use = margin.cells)
#note, could replace the last three lines with: zf.margin=subsetData(zf,subset.name = "bin.tier",accept.low = 5)
zf.margin=pca(zf.margin,do.print = FALSE)
zf.margin <- jackStraw(zf.margin, num.replicate=1000, prop.freq=0.025)
zf.margin=project.pca(zf.margin,pcs.print = 3,genes.print = 8,do.center=FALSE)
## [1] "PC1"
## [1] "ID1" "SOX3" "CXCR4B" "SOX19A"
## [1] ""
## [1] "OSR1" "GATA5" "FSCN1A" "SNAI1A" "APLNRB"
## [1] ""
## [1] ""
## [1] "PC2"
## [1] "CHD" "FRZB" "GSC" "OTX1A"
## [1] ""
## [1] "VED" "HES6" "VOX" "EVE1" "BAMBIA"
## [1] ""
## [1] ""
## [1] "PC3"
## [1] "ARL4AB" "WNT11" "SEBOX" "GADD45BA"
## [1] ""
## [1] "SOX32" "CXCR4A" "MARCKSL1B" "RPL26" "FGFR4"
## [1] ""
## [1] ""
kmeans.genes=pca.sig.genes(zf.margin,pcs.use = 1:3,pval.cut = 1e-3)
zf.margin=doKMeans(zf.margin,genes.use = kmeans.genes,k.genes = 7,k.cells = 8,pc.row.order=3,pc.col.order=3,rev.pc.order = TRUE,cexRow=0.5,cexCol=0.5)