plotClusters {Repitools} | R Documentation

## Plot Scores of Cluster Regions

### Description

Given an annotation of gene positions that has a score column, the function will make a series of bar chart plots, one for each cluster.

### Usage

      ## S4 method for signature 'data.frame'
    plotClusters(x, s.col = NULL, non.cl = NULL, ...)
      ## S4 method for signature 'GRanges'
    plotClusters(x, s.col = NULL, non.cl = NULL, ...)

### Arguments

`x` | A summary of genes and their statistical score, and the cluster that they belong to. Either a `data.frame` or a `GRanges`. If a `data.frame`, then (at least) columns `chr`, `start`, `end`, `strand`, `name` and `cluster`. Also a score column, with the column name describing what type of score it is. If a `GRanges`, then the `elementMetadata` should have a `DataFrame` with a score column, and columns named `"cluster"` and `"name"`.
`s.col` | The column number of the `data.frame` when `data` is a `data.frame`, or the column number of the `DataFrame` when `data` is a `GRanges` object. The name of this column is used as the y-axis label in the plot.
`non.cl` | The value in the cluster column that represents genes that are not in any cluster
`...` | Further parameters to be passed onto `plot`.

### Value

A plot for each cluster is made. Therefore, the PDF device should be opened before this function is called.

### Author(s)

Dario Strbenac

### Examples

      library(GenomicRanges)
      g.summary <- GRanges("chr1",
                           IRanges(seq(1000, 10000, 1000), width = 100),
                           rep(c('+', '-'), 5),
                           `t-statistic` = rnorm(10, 8, 2),
                           cluster = c(0, 0, 0, 0, 0, 1, 1, 1, 1, 0),
                           name = paste("Gene", 1:10))
      plotClusters(g.summary, 1, 0, ylim = c(4, 12), lwd = 5)

[Package Repitools version 1.34.0 Index]