% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/QC.R
\name{plot_factor_mean_cor}
\alias{plot_factor_mean_cor}
\title{Heatmap of factor correlation with mean feature values}
\usage{
plot_factor_mean_cor(object, split_by_groups = FALSE)
}
\arguments{
\item{object}{a trained \code{\linkS4class{MOFA}} object.}

\item{split_by_groups}{logical. If \code{FALSE} (default), groups are pooled
into a single heatmap; if \code{TRUE}, one panel per group.}
}
\value{
A \code{\link[ggplot2]{ggplot}} object: a heatmap of factors (rows) by views
(columns), faceted by group when \code{split_by_groups = TRUE}.
}
\description{
Plots (absolute) Pearson correlation between every factor and the per-sample mean feature
values, with correlations above 0.75 highlighted (red outline).
}
\details{
Highlighted factors often capture differences in the total 'levels' between
samples. Depending on the modality in question, this could be valid biological structure,
or a normalisation artifact of the data, e.g. from incomplete preprocessing.

To decide whether these factors are of interest, it may help to take a closer look
at what signal the highlighted view-factor combinations capture -
 e.g. with \code{\link{plot_factor}}, \code{\link{plot_top_weights}}
or \code{\link{plot_factors_vs_cov}} (in the case with covariates).

Correlations are computed with \code{use = "pairwise.complete.obs"} to
tolerate missing values. Pooled and per group scores are computed differently -
across all samples at once or split within each group.
}
\examples{
# Using an existing trained model on simulated data
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)

# Correlation of each factor with the mean feature values per view
plot_factor_mean_cor(model)

# Same, but computed within each group and shown as one panel per group
plot_factor_mean_cor(model, split_by_groups = TRUE)
}
\seealso{
\code{\link{plot_factor}}, \code{\link{plot_weights}},
  \code{\link{plot_top_weights}}, \code{\link{plot_factors_vs_cov}},
  \code{\link{plot_variance_explained}}, \code{\link{load_model}}
}
