tjGCluster2: trajectory analysis

View source: R/tjGCluster2.R

tjGCluster2R Documentation

trajectory analysis

Description

trajectory analysis

Usage

  tjGCluster2(m, from=NULL, to=NULL, cutoff=25);

Arguments

m

data.frame or matrix or igraph object

from

start vetex

to

end vetex

cutoff

it will be a branch if vertex number > cutoff

Value

A list of trajectory analysis results.

Examples

rm(list=ls());

library(scCorr);

## get data
## 5 clusters of CD4 T cells
ct.c   <- c(6:10); 
## tsne result/output
tsnef  <- "https://github.com/CBIIT-CGBB/scCorr/raw/master/data/01/do_tsne30_2000.txt";
tsne   <- read.table(tsnef, header=T);

## cluster matrix
cluf   <- "https://github.com/CBIIT-CGBB/scCorr/raw/master/data/01/03clust_table.txt";
clu    <- read.table(cluf, header=T);

## make coordinate vector
## sample index of CD4 T cells in the cluster matrix
s.i    <- which(clu[,23] 
## CD4 T cells 
tsne <- tsne[s.i,];
## select nodes of start and end 
c1.i  <- which.min(tsne[,2]);
c2.i  <- which.max(tsne[,2]);
## do trajectory
out1  <- tjGCluster(tsne, from=c1.i, to=c2.i);
out2  <- tjGCluster2(tsne, from=c1.i, to=c2.i, cutoff=100);
out   <- list(out1=out1, out2=out2);


CBIIT-CGBB/scCorr documentation built on Dec. 11, 2023, 4 a.m.