getWordsOnDendro: getWordsOnDendro

View source: R/getWordsOnDendro.R

getWordsOnDendroR Documentation

getWordsOnDendro

Description

Get grobs to plot on the dendrogram with the position information

Usage

getWordsOnDendro(
  dhc,
  geneVec,
  geneNumLimit = 1000,
  geneVecType = "ENSEMBL",
  useWC = FALSE,
  useRandomColor = FALSE,
  numberOfWords = 25,
  showType = "ID",
  wcArgs = list(),
  highlight = NULL,
  textSize = 3.5,
  wcScale = 3,
  wrap = NULL,
  candidateNodes = NULL,
  takeIntersect = TRUE,
  useDf = NULL,
  bg.colour = NULL,
  type = "words",
  argList = list(),
  useFunc = NULL,
  useggfx = NULL,
  normalizeByClusterNum = TRUE,
  autoSize = TRUE
)

Arguments

dhc

dendrogram

geneVec

gene-named vector of node names in dendrogram

geneNumLimit

when the gene number is above this threshold, pyramid plots are not produced

geneVecType

type of the name of geneVec (default: ENSEMBL)

useWC

use wordcloud

useRandomColor

use random colors on wordclouds

numberOfWords

the number of words to plot (default: 25)

showType

when "enrich", which labels to show

wcArgs

argument list for ggwordcloud

highlight

words to highlight

textSize

text size in pyramid plots

wcScale

max_size of wordcloud

wrap

wrap the strings

candidateNodes

if NULL, all nodes are investigated

takeIntersect

take intersection or frequent words

useDf

data.frame to subset when manual function is specified

bg.colour

background color for wordcloud

type

"words" or "enrich"

argList

passed to refseq

useFunc

function to summarize text

useggfx

use ggfx on resulting plot

normalizeByClusterNum

normalize frequency by ID numbers or not

autoSize

size the text based on grob width

Details

The function accepts the dendrogram and named vector of genes with associated clusters and returns the list of plots with the positional information. Used internally in 'plotEigengeneNetworksWithWords'.

Value

list of pyramid plot grobs and its positions

Examples

mod <- returnExample()
result <- hclust(dist(t(mod$MEs)))
dhc <- result |>
    as.dendrogram() |>
    dendextend::hang.dendrogram()
geneVec <- paste0("ME", mod$colors)
names(geneVec) <- names(mod$colors)
getWordsOnDendro(dhc, geneVec, numberOfWords = 2)

noriakis/wcGeneSummary documentation built on April 22, 2024, 7:12 a.m.