d_list: Merging single cells with one coordinate by Density Method

View source: R/d_list.R

d_listR Documentation

Merging single cells with one coordinate by Density Method

Description

This function uses the density-based method to merge the cells. It returns the list of indices and name of cells after clustering.

Usage

c_list(coordinates, l)

Arguments

coordinates

An array of chosen coordinate of the data

l

Number of windows

Value

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

Examples

rm(list=ls());

library(scCorr);

## get data
## clusters of CD4 T cells
ct.c   <- c(6:10, 12:16, 19,20, 28:33); 
## 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");

## 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,];
dat  <- tsne[,1];
names(dat) <- row.names(tsne);

out <- d_list(dat, l=30)
out.index     <- out[[1]];
out.cellname  <- out[[2]];


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