subsetSamples: Subset samples

Description Usage Arguments Value Examples

View source: R/subset.R

Description

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.

Usage

1
subsetSamples(object, samples)

Arguments

object

a MOFAmodel object.

samples

character vector with the sample names, numeric vector with the sample indices or logical vector with the samples to be kept as TRUE.

Value

MOFAmodel object with a subset of samples

Examples

1
2
3
4
5
6
7
8
9
# 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

bioFAM/MOFA documentation built on Oct. 3, 2020, 12:53 a.m.