subsetSamples {MOFA} | R Documentation |
Method to subset (or sort) samples.
This function can remove samples from the model. For example,
you might want to observe the effect of Factor 1 on a subset of samples.
You can create a new MOFAmodel
excluding some samples
and then visualise the effect of Factor 1 on the remaining ones, for instance via
plotDataHeatmap
or plotFactorScatter
.
This functionality is only for exploratory purposes.
In the case of outliers, we strongly recommend removing them before training the model.
subsetSamples(object, samples)
object |
a |
samples |
character vector with the sample names, numeric vector with the sample indices or logical vector with the samples to be kept as TRUE. |
MOFAmodel
object with a subset of samples
# Using an existing trained model on the CLL data filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata") MOFA_CLL <- loadModel(filepath) # Subset samples via character vector MOFA_CLL_small <- subsetSamples(MOFA_CLL, samples=c("H045","H109","H024","H056")) MOFA_CLL_small # Subset samples via numeric vector MOFA_CLL_small <- subsetSamples(MOFA_CLL, samples=1:10) MOFA_CLL_small