bplot: Karlin B plot

Description Usage Arguments Value Examples

Description

Plot distances of each gene's CU frequency to specified gene (sub)sets (given by x and y).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Bplot(x, y, data, annotations = character(), ribosomal = FALSE,
  reference = list(), size = 1, alpha = 0.5)

## S4 method for signature 'character,character,matrix'
Bplot(x, y, data,
  annotations = character(), ribosomal = FALSE, reference = list(),
  size = 1, alpha = 0.5)

## S4 method for signature 'numeric,numeric,missing'
Bplot(x, y, data,
  annotations = character(), ribosomal = FALSE, reference = list(),
  size = 1, alpha = 0.5)

Arguments

x, y

Character, both must be in colnames(data), or numeric vectors of CU statistic values for two subsets of genes. If numeric, the vectors must be of the same length.

data

A matrix with CU statistic values for subsets of genes in columns.

annotations

A character vector giving KO annotations for sequences for which the CU values were calculated, must be of length nrow(data).

ribosomal

Logical, whether to indicate ribosomal genes in the plot. Default is FALSE, if set to TRUE, then annotation must be given.

reference

A named list of length 1, containing either a logical vector of nrow(data) of reference genes to be indicated on the plot, or a character vector (of any length) of the reference genes' anotations. If latter is the case, then annotation must be given.

size

Numeric, indicating points' size

alpha

Numeric, between 0 and 1, indicating points' transparency (default is 0.1).

Value

A ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(ggplot2)

# calculate MILC distance to the average CU of the example DNA sequences,
# and to the average CU of ribosomal genes among the example DNA sequences
milc <- MILC(LD94, self = TRUE, ribosomal = TRUE)

Bplot(x = "ribosomal", y = "self", data = milc,
      ribosomal = TRUE, annotations = getKO(LD94),
      size = 3) +
    labs(x = "MILC distance to ribosomal genes",
         y = "MILC distance to genes' average CU")

BioinfoHR/coRdon documentation built on May 6, 2019, 8:35 p.m.