modelPlot: Model plot

Description Usage Arguments Value Examples

View source: R/modelPlot.R

Description

Model plots to show the overall differences between groups and over time

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
modelPlot(
  glmmResult,
  geneName,
  x1Label = "Timepoint",
  x2Label,
  xTitle = NULL,
  yTitle = "Gene Expression",
  title = NULL,
  logTransform = FALSE,
  shapes = 21,
  colours = c("blue"),
  x2Offset = 6,
  lineWidth = 1,
  markerSize = 5,
  fontSize = NULL,
  overlap = TRUE,
  addErrorbars = TRUE,
  graphics = "ggplot",
  ...
)

Arguments

glmmResult

A glmmSeq object created by glmmSeq::glmmSeq()..

geneName

Gene/row name to plot

x1Label

The name of the first (inner) x parameter

x2Label

The name of the second (outer) x parameter

xTitle

Title for the x axis

yTitle

Title for the y axis

title

Plot title. If NULL gene name is used.

logTransform

Whether to perform a log10 transform on the y axis

shapes

The marker shapes, default=21

colours

The marker colours, default=c('blue')

x2Offset

Vertical adjustment to secondary x-axis (default=6)

lineWidth

Plot line size (default=1)

markerSize

Size of markers (default=5)

fontSize

Plot font size (default=10)

overlap

Logical whether x2Label fits should be plotted overlapping one another (default=TRUE).

addErrorbars

Logical whether to add error bars.

graphics

Which graphic system to use (options = "base" or "ggplot")

...

Other parameters to pass to graphics::plot() or ggplot2::theme().

Value

Returns a plot with the glmm fit for a given gene/row

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(PEAC_minimal_load)
disp <- apply(tpm, 1, function(x){
(var(x, na.rm=TRUE)-mean(x, na.rm=TRUE))/(mean(x, na.rm=TRUE)**2)
})
Fit <- glmmSeq(~ Timepoint * EULAR_6m + (1 | PATID),
                     id = 'PATID',
                     countdata = tpm['ADAM12', ],
                     metadata = metadata,
                     dispersion = disp,
                     verbose=FALSE)
modelPlot(Fit,
          "ADAM12",
          x1Label="Timepoint",
          x2Label="EULAR_6m",
          colours = c('skyblue', 'goldenrod1', 'mediumvioletred'),
          xTitle="Time",
          markerSize=3,
          graphics="base")

glmmSeq documentation built on March 30, 2021, 5:12 p.m.