To be added...
We load the Startrac package and other packages for visualization.
library("Startrac") library("tictoc") library("ggpubr") library("ggplot2") library("ComplexHeatmap") library("RColorBrewer") library("circlize")
Then we read in the example data. The input to Startrac should be a data.frame for which the columns 'clone.id', 'patient', 'majorCluster' and 'loc' are required.
dat.file <- system.file("extdata/example.cloneDat.Zhang2018.txt", package = "Startrac") in.dat <- read.table(dat.file,stringsAsFactors = F,head=T) head(in.dat)
Run the pipeline using below command to obtain the indices of the entire data set and data from each patient.
tic("Startrac.run") out <- Startrac.run(in.dat, proj="CRC",verbose=F) toc()
plot(out,index.type="cluster.all",byPatient=F)
plot(out,index.type="cluster.all",byPatient=T)
migration index between two locations
plot(out,index.type="pairwise.migr",byPatient=F)
transition index between two major clusters
plot(out,index.type="pairwise.tran",byPatient=T)
Construct the Startrac object using the example data. The input data and some derived information are stored in slots, for exmaple cell.data
for the original input data, clonotype.dist.cluster
for the distribution of clone along major clusters, clonotype.dist.loc
for the distribution of clone along locations. The parameter aid
is used to identify the dataset, it can be the project name or patient id.
dat.file <- system.file("extdata/example.cloneDat.Zhang2018.txt", package = "Startrac") in.dat <- read.table(dat.file,stringsAsFactors = F,head=T) obj <- new("Startrac",in.dat,aid="CRC")
We can examine these information
obj@clonotype.dist.cluster[1:3,1:4] obj@clonotype.dist.loc[1:3,]
Calculate the cluster level index. The cluster level indices are stored in slot cluster.data
.
obj <- calIndex(obj) head(obj@cluster.data)
Calculate the pairwise index.
tic("pIndex") obj <- pIndex(obj) toc()
These indices are stored in slot pIndex.migr
and pIndex.tran
.
head(obj@pIndex.migr) obj@pIndex.tran[1:3,1:6]
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.