polar_coords {volcano3D}R Documentation

Coordinates for Three Way Polar Plot

Description

This function creates a 'volc3d' object of S4 class for downstream plots containing the p-values from a three-way group comparison, expression data sample data and polar coordinates. For RNA-Seq count data, two functions deseq_polar or voom_polar can be used instead.

Usage

polar_coords(
  outcome,
  data,
  pvals = NULL,
  padj = pvals,
  pcutoff = 0.05,
  fc_cutoff = NULL,
  scheme = c("grey60", "red", "gold2", "green3", "cyan", "blue", "purple"),
  labs = NULL,
  ...
)

Arguments

outcome

Outcome vector with 3 groups, ideally as a factor. If it is not a factor, this will be coerced to a factor. This must have exactly 3 levels. NOTE: if pvals is given, the order of the levels in outcome must correspond to the order of columns in pvals.

data

Dataframe or matrix with variables in columns

pvals

Matrix or dataframe with p-values. The first column represents a test across all 3 categories such as one-way ANOVA or likelihood ratio test. Columns 2-4 represent pairwise tests comparing groups A vs B, A vs C and B vs C, where A, B, C represent levels 1, 2, 3 in outcome. Columns 2-4 must be provided in the correct order. If pvals is not given, it is calculated using the function calc_pvals.

padj

Matrix or dataframe with adjusted p-values. If not supplied, defaults to use nominal p-values from pvals.

pcutoff

Cut-off for p-value significance

fc_cutoff

Cut-off for fold change on radial axis

scheme

Vector of colours starting with non-significant variables

labs

Optional character vector for labelling groups. Default NULL leads to abbreviated labels based on levels in outcome using abbreviate(). A vector of length 3 with custom abbreviated names for the outcome levels can be supplied. Otherwise a vector length 7 is expected, of the form "ns", "B+", "B+C+", "C+", "A+C+", "A+", "A+B+", where "ns" means non-significant and A, B, C refer to levels 1, 2, 3 in outcome, and must be in the correct order.

...

Optional arguments passed to calc_pvals

Value

Returns an S4 'volc3d' object containing:

See Also

deseq_polar, voom_polar, calc_pvals

Examples

data(example_data)
syn_polar <- polar_coords(outcome = syn_example_meta$Pathotype,
                          data = t(syn_example_rld))


[Package volcano3D version 2.0.9 Index]