plotTopElements {esetVis} | R Documentation

## create `geom_text` object with top genes/sample/pathways

### Description

create `geom_text` object with top genes/sample/pathways

### Usage

    plotTopElements(top, type = c("gene", "sample", "geneSets"),
      var = character(), cex = 1, just = c(0.5, 0.5), color = "black",
      dataPlotGenes = data.frame(), dataPlotSamples = data.frame(),
      esetUsed, geneSets = list(), geneSetsVar = character(),
      geneSetsMaxNChar = numeric(), returnTopElements = FALSE,
      packageTextLabel = c("ggrepel", "ggplot2"))

### Arguments

`top` | numeric, number of top elements
`type` | type of elements to plot, either 'gene', 'sample', or 'geneSets'
`var` | variable used to annotate the elements, only used for 'gene' and 'sample'
`cex` | cex of text in the plot
`just` | justification of elements in the plot, only use if `packageTextLabel` is 'ggplot2'
`color` | color for the elements in the plot
`dataPlotGenes` | data.frame with two columns 'X' and 'Y' with coordinates for the genes
`dataPlotSamples` | data.frame with two columns 'X' and 'Y' with coordinates for the samples
`esetUsed` | expressionSet (or SummarizedExperiment) object with data
`geneSets` | list of gene sets, e.g. gene pathways, output from the 'getGeneSets' function in MLP the genes IDs must correspond to the sampleNames in the eset. If several gene sets have the same name, they will be combine to extract the top gene sets.
`geneSetsVar` | variable of the featureData used to match the genes contained in geneSets, most probably ENTREZID, if not specified the featureNames of the eSet are used
`geneSetsMaxNChar` | maximum number of characters for pathway names, by default keep entire names
`returnTopElements` | logical if TRUE (FALSE by default) return the outlying elements
`packageTextLabel` | package used to label the outlying genes/samples/gene sets, either 'ggrepel' (by default, only used if package `ggrepel` is available), or 'ggplot2'

### Value

- if the `elements` are present in the data: if `returnTopElements` is:

  - TRUE: return a list with two arguments:

    - topElements: string with top elements labelled in the plot

    - geomText: output of `geom_text`

  - FALSE: only return the output of `geom_text`

- if not, return `NULL`

### Author(s)

Laure Cougnaud

[Package esetVis version 1.12.0 Index]