Wajid Jawaid 2017-07-09
Reconstructing ordered ontogenic trajectories provides methods for:
The main goal of roots is to infer plausible developmental journeys guided by the user.
library(devtools)
install_github("wjawaid/roots")
Here I take the mouse adult haematopoietic data from Nestorowa et al.. Data is downloaded and processed using the goggles() function as below.
library(roots)
## Load data
<- read.table("http://blood.stemcells.cam.ac.uk/data/norm_counts_nestorowa_data.txt",
blood sep = " ")
<- read.table("http://blood.stemcells.cam.ac.uk/data/cell_names_nestorowa_data.txt",
cellNames sep = " ", stringsAsFactors = FALSE)[,1]
rownames(blood) <- gsub("LT\\.", "LT-", cellNames)
<- read.table("http://blood.stemcells.cam.ac.uk/data/gene_names_nestorowa_data.txt",
geneNames sep = " ", stringsAsFactors = FALSE)[,1]
colnames(blood) <- geneNames
<- as.matrix(blood)
blood rm(cellNames, geneNames)
## Load metadata
<- read.csv("http://blood.stemcells.cam.ac.uk/data/wj_out_jd.csv")
meta colnames(meta) <- c("cellType", "index", "name")
rownames(meta) <- meta$name
$col <- bglab::ggCol(meta$cellType)
meta<- data.frame(col=rep("#00000011", nrow(blood)), stringsAsFactors = FALSE,
nmeta row.names = rownames(blood))
rownames(meta),"col"] <- meta$col
nmeta[<- data.frame(cell=as.character(unique(meta$cellType)),
leg col=as.character(unique(meta$col)), stringsAsFactors = FALSE)
<- c(5, 8, 6, 7, 1, 4, 2, 3)
legOrd
## Analyse
<- goggles(blood)
xx
## Plot
plot(xx$l, pch=16, col = nmeta[rownames(xx$l), "col"])
legend("topright", legend = leg$cell[legOrd], fill=leg$col[legOrd], inset=0.02)