c_list: A graph-based k-partitioning method with scaling

View source: R/c_list.R

c_listR Documentation

A graph-based k-partitioning method with scaling

Description

This function uses the network modularity optimazation cluster methods to cluster or partite the cells. It returns the list of indices and name of cells after clustering.

Usage

c_list(dat, l, method,auto_scaling)

Arguments

dat

matrix or data frame

l

Number of clusters

method

Cluster method. Default: fast_greedy

Value

A list of indices of data and a list of names of data.

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, sep="\t");
## check row.names
sum(row.names(tsne)==row.names(clu))==nrow(clu);
## sample index of CD4 T cells in the cluster matrix
s.i    <- which(clu[,23] 
## some single cells of CD4 T cells 
dat    <- tsne[s.i,];

out           <- c_list(dat, 40);
out.index     <- out[[1]];
out.cellname  <- out[[2]];


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