buildTreeFromGenePanel: Build and plot dendrogram from gene panel

View source: R/mfishMapping.r

buildTreeFromGenePanelR Documentation

Build and plot dendrogram from gene panel

Description

Build and plot a dendrogram using correlation-based average linkage hierarchical clustering and only using a specified set of genes. The output is the expected accuracy of mapping to each node in the tree, which gives an idea of the best-case expected results for mFISH analysis.

Usage

buildTreeFromGenePanel(
  dend = NA,
  refDat = NA,
  mapDat = refDat,
  medianDat = NA,
  requiredGenes = 2,
  clusters = NA,
  mappedAsReference = FALSE,
  genesToMap = rownames(mapDat),
  plotdendro = TRUE,
  returndendro = TRUE,
  mar = c(12, 5, 5, 5),
  main = NULL,
  ylab = NULL,
  use = "p",
  ...
)

Arguments

dend

dendrogram for mapping. Ignored if medianDat is passed

refDat

normalized data of the REFERENCE data set. Ignored if medianDat is passed

mapDat

normalized data of the MAPPING data set. Default is to map the data onto itself.

medianDat

representative value for each leaf and node. If not entered, it is calculated

requiredGenes

minimum number of genes required to be expressed in a cluster (column of medianDat) for the cluster to be included (default=2)

clusters

cluster calls for each cell

mappedAsReference

if TRUE, returns the fraction of cells mapped to a node which are were orginally clustered from that node; if FALSE (default) returns the fraction of cells clustered under a node which are mapped to the correct node.

genesToMap

which genes to include in the correlation mapping

plotdendro

should the dendrogram be plotted (default = TRUE)

mar

margins (for use with par)

main, ylab

add title and labels to plot (default is NULL)

use, ...

additional parameters for cor

returnDendro

should the dendrogram be returned (default = TRUE)

Value

a list where the first entry is the resulting tree and the second entry is the fraction of cells correctly mapping to each node using the inputted gene panel.


AllenInstitute/mfishtools documentation built on July 5, 2023, 4:20 p.m.