| plot,coseqResults,ANY-method {coseq} | R Documentation |
Plot a coseqResults object.
## S4 method for signature 'coseqResults,ANY'
plot(x, y_profiles = NULL, K = NULL,
threshold = 0.8, conds = NULL, average_over_conds = FALSE,
graphs = c("logLike", "ICL", "profiles", "boxplots", "probapost_boxplots",
"probapost_barplots", "probapost_histogram"), order = FALSE,
profiles_order = NULL, n_row = NULL, n_col = NULL, ...)
coseqGlobalPlots(object, graphs = c("logLike", "ICL"), ...)
coseqModelPlots(probaPost, y_profiles, K = NULL, threshold = 0.8,
conds = NULL, average_over_conds = FALSE, graphs = c("profiles",
"boxplots", "probapost_boxplots", "probapost_barplots",
"probapost_histogram"), order = FALSE, profiles_order = NULL,
n_row = NULL, n_col = NULL, ...)
x |
An object of class |
y_profiles |
y (n x q) matrix of observed profiles for n
observations and q variables to be used for graphing results (optional for
|
K |
If desired, the specific model to use for plotting (or the specific cluster number(s)
to use for plotting in the case of |
threshold |
Threshold used for maximum conditional probability; only observations with maximum conditional probability greater than this threshold are visualized |
conds |
Condition labels, if desired |
average_over_conds |
If |
graphs |
Graphs to be produced, one (or more) of the following:
|
order |
If |
profiles_order |
If |
n_row |
Number of rows for plotting layout of line plots and boxplots of profiles.
Note that if |
n_col |
Number of columns for plotting layout of line plots and boxplots of profiles.
Note that if |
... |
Additional optional plotting arguments (e.g., xlab, ylab, use_sample_names, facet_labels) |
object |
An object of class |
probaPost |
Matrix or data.frame of dimension (n x K) containing the conditional probilities of cluster membership for n genes in K clusters arising from a mixture model |
Named list of plots of the coseqResults object.
Andrea Rau, Cathy Maugis-Rabusseau
## Simulate toy data, n = 300 observations
set.seed(12345)
countmat <- matrix(runif(300*4, min=0, max=500), nrow=300, ncol=4)
countmat <- countmat[which(rowSums(countmat) > 0),]
conds <- rep(c("A","B","C","D"), each=2)
## Run the Normal mixture model for K = 2,3,4
run_arcsin <- coseq(object=countmat, K=2:4, iter=5, transformation="arcsin",
model="Normal")
run_arcsin
## Plot and summarize results
plot(run_arcsin)
summary(run_arcsin)
## Compare ARI values for all models (no plot generated here)
ARI <- compareARI(run_arcsin, plot=FALSE)
## Compare ICL values for models with arcsin and logit transformations
run_logit <- coseq(object=countmat, K=2:4, iter=5, transformation="logit",
model="Normal")
compareICL(list(run_arcsin, run_logit))
## Use accessor functions to explore results
clusters(run_arcsin)
likelihood(run_arcsin)
nbCluster(run_arcsin)
ICL(run_arcsin)
## Examine transformed counts and profiles used for graphing
tcounts(run_arcsin)
profiles(run_arcsin)
## Run the K-means algorithm for logclr profiles for K = 2,..., 20
run_kmeans <- coseq(object=countmat, K=2:20, transformation="logclr",
model="kmeans")
run_kmeans