Runs the main function
fitExtractVarPartModel of the package
variancePartition: Fits a linear (mixed) model to estimate contribution of multiple sources of variation while simultaneously correcting for all other variables for the features in a GRN object (TFs, peaks, and genes) given particular metadata. The function reports the fraction of variance attributable to each metadata variable.
Note: The results are not added to
GRN@connections$all.filtered, rerun the function
getGRNConnections and set
TRUE to do so.
The results object is stored in
GRN@stats$variancePartition and can be used for the various diagnostic and plotting functions from
add_featureVariation( GRN, formula = "auto", metadata = c("all"), features = "all_filtered", nCores = 1, forceRerun = FALSE, ... )
Object of class
auto or a manually defined formula to be used for the model fitting. Default
auto. Must include only terms that are part of the metadata as specified with the
metadata parameter. If set to
auto, the formula will be build automatically based on all metadata variables as specified with the
metadata parameter. By default, numerical variables will be modeled as fixed effects, while variables that are defined as factors or can be converted to factors (characters and logical variables) are modeled as random effects as recommended by the
Character vector. Default
all. Vector of column names from the metadata data frame that was provided when using the function
addData. Must either contain the special keyword
all to denote that all (!) metadata columns from
GRN@data$metadata are taken
or if not, a subset of the column names from
GRN@data$metadatato include in the model fitting for
variancePartition only be run for the features (TFs, peaks and genes) from the filtered set of connections (the result of
filterGRNAndConnectGenes) or for all genes that are defined in the object? If set to
all, the running time is greatly increased.
Integer >0. Default 1. Number of cores to use.
A value >1 requires the
BiocParallel package (as it is listed under
Suggests, it may not be installed yet).
FALSE. Force execution, even if the GRN object already contains the result. Overwrites the old results.
Additional parameters passed on to
data. See the function help for more information
GRN object, with additional information added from this function to
GRN@stats$variancePartition as well as the elements
As noted above, the results are not added to
GRN@connections$all.filtered; rerun the function
getGRNConnections and set
TRUE to include the results in the eGRN output table.
The normalized count matrices are used as input for
# See the Workflow vignette on the GRaNIE website for examples # GRN = loadExampleObject() # GRN = add_featureVariation(GRN, metadata = c("mt_frac"), forceRerun = TRUE)