plotCSRsummary | R Documentation |
The function plot the CSR summary from summariseCSR
. Remember to set factors for columns represented in the plots to alter the order of these labels on axes of the plot (see vignette & example below).
plotCSRsummary(csr_summary)
csr_summary |
data.frame, output of |
A ggplot2
plot object. You can further manipulate it, e.g. plot data from different subsets in separate panels (with facet_wrap()
in ggplot2
) etc.
## Not run:
# first set the order of the isotypes so that they reflect
# the actual physical order on the genome (hence the
# order possible in CSR)
csr_summary$startIsotype <- factor(csr_summary$startIsotype,
levels = c("IgM", "IgG3", "IgG1", "IgA1",
"IgG2", "IgG4", "IgE", "IgA2"),
labels = c("M", "G3", "G1", "A1", "G2",
"G4", "E", "A2"))
csr_summary$endIsotype <- factor(csr_summary$endIsotype,
levels = c("IgM", "IgG3", "IgG1", "IgA1",
"IgG2", "IgG4", "IgE", "IgA2"),
labels = c("M", "G3", "G1", "A1", "G2",
"G4", "E", "A2"))
# plot it; it uses ggplot2 so you can extend this with ggplot2 functions
# here separate into different panels using the column 'PatientID'
library(ggplot2)
plotCSRsummary( csr_summary ) + facet_wrap(~ PatientID)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.