knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Initializing VATEntity object

scVAT can build VATEntity object from Single-Cell RNA-seq data from a csv, sparse mtx or h5 file. Firstly, loading scVAT package

library(scVAT)

Loading raw data from CSV File, then initializing VATEntity object

#loading expression matrix from CSV, The csv file should contain genes in the row and cells in the columns. 
BHSC.data <- loadCSVData("BHSC.csv")
#initializing VATEntity object using loaded data
BHSC <- initVATEntity(BHSC.data, title="BHSC")
#print BHSC
BHSC

Doing analysis

Running the base pipline, including PCA, t-SNE, and Cluster

#do PCA, pc.num = 50
BHSC <- doPCA(BHSC, pc.num = 50)
#Plot PC standard deviation
plotPCASDev(BHSC)
#do tSNE, using PC1~50
BHSC <- doTSNE(BHSC, dims = 2, use.col = 50)

Loading external analysis results

scVAT can integrate the third party anlaysis results, and visualizing them. For the demo, Loading PHATE result(via)

#specifying data file, dimensions and key value (important, the key will be used later)
BHSC <- loadAnalysisFromCSV(BHSC, "BHSC_PHATE.csv", ndims =3, key="PHATE")

Visualizing one gene expression

#plot one gene expression based on t-SNE
plotGene(BHSC, genes="Cdc20", dims = c(1,2))
#plot one gene expression based on t-SNE, no gradient, and different colors
plotGene(BHSC, genes="Cdc20", gradient= FALSE, dims = c(1,2), colors=c("grey","red"))
#plot one gene expression based on PHATE
plotGene(BHSC, genes="Cdc20", dims = c(1,2), key="PHATE")
#plot one gene expression based on PHATE (3D),parameters size and sizes set point size for 3D maps
plotGene(BHSC, genes="Cdc20", dims = c(1,2,3), key="PHATE",size=1,sizes=c(1,5))

Visualizing two or three gene expressions

#plot two genes based on tSNE
plotTwoGenes(BHSC, gene1 = "Cdc20",gene2 = "Gata1")
#plot two genes based on tSNE, and use different colors
plotTwoGenes(BHSC, gene1 = "Cdc20",gene2 = "Gata1",colors=c("grey","blue","red","black"))
#plot two genes based on PHATE, and use different colors
plotTwoGenes(BHSC, gene1 = "Cdc20", gene2 = "Gata1", dims=c(1,2,3),key = "PHATE", size=1, sizes=c(1,5))
#plot three genes based on PHATE
plotThreeGenes(BHSC, gene1 = "Cdc20", gene2 = "Gata1", gene3 = "Klf1", dims=c(1:3),key="PHATE", size =1, sizes = c(1,5))

Visualizing many gene expressions in one map at the sametime

#Plot many genes at the sametime, nrows sets row number
plotGenes(BHSC, genes = c("Cdc20","Gata1","Klf1","Ube2c"), nrows=2)

Start Web GUI

#start Web GUI for visualization, clustering manually, and differential analysis
startVATGUI("BHSC")


HuobinTan/scVAT documentation built on May 31, 2019, 2:20 p.m.