Spaghetti plot for Specific Gene Set
Usage
spaghettiPlot1GS(
gs_index,
gmt,
expr_mat,
design,
var_time,
var_indiv,
sampleIdColname,
var_group = NULL,
var_subgroup = NULL,
plotChoice = c("Medians", "Individual"),
loess_span = 0.75
)
Arguments
- gs_index
index of the specific gene set in
gmt
.- gmt
a
list
of elements:geneset
,geneset.name
andgeneset.description
(seeGSA.read.gmt
).- expr_mat
a
data.frame
with numerics of sizeG x n
contraining the raw RNA-seq counts fromn
samples forG
genes.- design
a
data.frame
orDFrame
containing the information of each sample (SampleID).- var_time
the
time
orvisit
variable contained indesign
.- var_indiv
the patient variable contained in
design
data.- sampleIdColname
a character string indicating the name of the sample ID variable in
design
to be matched with thecolnames
ofexpr_mat
- var_group
a group variable in
design
data to divide into two facets. Default isNULL
.- var_subgroup
a subgroup variable in
design
data to add 2 curves on plot for each subgroup. Default isNULL
.- plotChoice
to choose which type of plot (either
"Medians"
,"Individual"
or both). Default isc("Medians", "Individual")
.- loess_span
smoothing span. Default is
0.75
.
Examples
data(baduel_5gs)
design$Indiv <- design$Population:design$Replicate
design$Vern <- ifelse(design$Vernalized, "Vernalized", "Non-vernalized")
library(ggplot2)
spaghettiPlot1GS(gs_index = 3, gmt = baduel_gmt, expr_mat = log2(expr_norm_corr+1),
design = design, var_time = AgeWeeks, var_indiv = Indiv,
sampleIdColname = "sample", var_group=Vern, var_subgroup=Population,
plotChoice = "Medians", loess_span= 1.5) +
xlab("Age (weeks)") + guides(color= "none")