Introduction

To be added...

Quick start

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()

Visualization

cluster level index of all data

plot(out,index.type="cluster.all",byPatient=F)

cluster level index by patients.

plot(out,index.type="cluster.all",byPatient=T)

pairwise index of all data

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)

Step by Step

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]

Session info {.unnumbered}

sessionInfo()


Japrin/STARTRAC documentation built on Dec. 4, 2023, 1:35 a.m.