make_trees: Convert An Expression Matrix into Tree Format

View source: R/make_trees.R

make_treesR Documentation

Convert An Expression Matrix into Tree Format

Description

This function is used to convert the gene expression matrix into the tree format.

Usage

make_trees(
  ref_data,
  group = NULL,
  is_Newick = TRUE,
  is_parenthetic = FALSE,
  return_group = FALSE
)

Arguments

ref_data

A Matrix. The gene expression matrix where every row represents a cell and every column represents a gene.

group

A Vector. The group information of the cells in ref_data

is_Newick

If TRUE, return the Newick format.

is_parenthetic

If TRUE, return the parenthetic format.

return_group

Whether to return the group information of cells.

Value

A file of parenthetic format or Newick format

Examples

ref_data <- matrix(rpois(n = 2500, lambda = 2), nrow = 50)
rownames(ref_data) <- paste0("cell_", 1:ncol(ref_data))
colnames(ref_data) <- paste0("gene_", 1:nrow(ref_data))
group <- c(rep("A", 15), rep("B", 5), rep("C", 20), rep("D", 10))
tree_format <- make_trees(ref_data, group = group)

duohongrui/simutils documentation built on March 12, 2024, 8:40 p.m.