plot_data_vs_cov  R Documentation 
Function to do a scatterplot of features against sample covariate values.
plot_data_vs_cov(
object,
covariate = 1,
warped = TRUE,
factor = 1,
view = 1,
groups = "all",
features = 10,
sign = "all",
color_by = "group",
legend = TRUE,
alpha = 1,
shape_by = NULL,
stroke = NULL,
dot_size = 2.5,
text_size = NULL,
add_lm = FALSE,
lm_per_group = FALSE,
imputed = FALSE,
return_data = FALSE
)
object 
a 
covariate 
string with the covariate name or a samples_metadata column, or an integer with the index of the covariate 
warped 
logical indicating whether to show the aligned covariate (default: TRUE), only relevant if warping has been used to align multiple sample groups 
factor 
string with the factor name, or an integer with the index of the factor to take top features from 
view 
string with the view name, or an integer with the index of the view. Default is the first view. 
groups 
groups to plot. Default is "all". 
features 
if an integer (default), the total number of features to plot (given by highest weights). If a character vector, a set of manuallydefined features. 
sign 
can be 'positive', 'negative' or 'all' (default) to show only features with highest positive, negative or all weights, respectively. 
color_by 
specifies groups or values (either discrete or continuous) used to color the dots (samples). This can be either:

legend 
logical indicating whether to add a legend 
alpha 
numeric indicating dot transparency (default is 1). 
shape_by 
specifies groups or values (only discrete) used to shape the dots (samples). This can be either:

stroke 
numeric indicating the stroke size (the black border around the dots, default is NULL, inferred automatically). 
dot_size 
numeric indicating dot size (default is 5). 
text_size 
numeric indicating text size (default is 5). 
add_lm 
logical indicating whether to add a linear regression line for each plot 
lm_per_group 
logical indicating whether to add a linear regression line separately for each group 
imputed 
logical indicating whether to include imputed measurements 
return_data 
logical indicating whether to return a data frame instead of a plot 
One of the first steps for the annotation of factors is to visualise the weights using plot_weights
or plot_top_weights
and inspect the relationshio of the factor to the covariate(s) using plot_factors_vs_cov
.
However, one might also be interested in visualising the direct relationship between features and covariate(s), rather than looking at "abstract" weights and
possibly look at the interpolated and extrapolated values by setting imputed to True.
Returns a ggplot2
object or the underlying dataframe if return_data is set to TRUE
.
# Using an existing trained model
file < system.file("extdata", "MEFISTO_model.hdf5", package = "MOFA2")
model < load_model(file)
plot_data_vs_cov(model, factor = 3, features = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.