subsetting: Subsetting a ProMetIS 'SummarizedExperiment',...

subsettingR Documentation

Subsetting a ProMetIS SummarizedExperiment, MultiAssayExperiment, ExpressionSet or MultiDataSet

Description

Subsetting ProMetIS datasets according to genes, sex and tissues, and filtering out features with too many NAs, too low variance, or too many imputed values (proteomics datasets only)

Usage

subsetting(
  x,
  set.c = NULL,
  genes.vc = "all",
  sex.vc = "all",
  tissues.vc = "all",
  common_samples.l = FALSE,
  na_thresh.n = 0.2,
  var_thresh.n = .Machine$double.eps,
  imputed_thresh.n = 0.2
)

## S4 method for signature 'MultiAssayExperiment'
subsetting(
  x,
  set.c = NULL,
  genes.vc = "all",
  sex.vc = "all",
  tissues.vc = "all",
  common_samples.l = FALSE,
  na_thresh.n = 0.2,
  var_thresh.n = .Machine$double.eps,
  imputed_thresh.n = 0.2
)

## S4 method for signature 'SummarizedExperiment'
subsetting(
  x,
  set.c = NULL,
  genes.vc = "all",
  sex.vc = "all",
  tissues.vc = NULL,
  common_samples.l = NULL,
  na_thresh.n = 0.2,
  var_thresh.n = .Machine$double.eps,
  imputed_thresh.n = 0.2
)

## S4 method for signature 'MultiDataSet'
subsetting(
  x,
  set.c = NULL,
  genes.vc = "all",
  sex.vc = "all",
  tissues.vc = "all",
  common_samples.l = FALSE,
  na_thresh.n = 0.2,
  var_thresh.n = .Machine$double.eps,
  imputed_thresh.n = 0.2
)

## S4 method for signature 'ExpressionSet'
subsetting(
  x,
  set.c = NULL,
  genes.vc = "all",
  sex.vc = "all",
  tissues.vc = NULL,
  common_samples.l = NULL,
  na_thresh.n = 0.2,
  var_thresh.n = .Machine$double.eps,
  imputed_thresh.n = 0.2
)

Arguments

x

An S4 object of class SummarizedExperiment, MultiAssayExperiment, ExpressionSet or MultiDataSet

set.c

Character: name of the data set

genes.vc

Character vector: with elements in 'LAT', 'MX2', and 'WT'; when set to 'all', the 'c('WT', 'LAT', 'MX2')' vector will be used

sex.vc

Character vector: with elements in 'M' and 'F'; when set to 'all', the 'c('M', 'F')' vector will be used

tissues.vc

Character vector: with elements in 'liver' and 'plasma'; when set to 'all', the 'c('liver', 'plasma')' vector will be used

common_samples.l

Logical: should the datasets be restricted to common samples?

na_thresh.n

Numeric: maximal proportion of NAs for a feature to be kept

var_thresh.n

Numteric: minimal variance for a feature to be kept

imputed_thresh.n

Numeric: for proteomics datasets, the features with a too high proportion of imputed values in all conditions to be compared will be discarded

Value

ExpressionSet or MultiDataSet with the selected sets, samples, and features (after filtering for the proportion of NAs, the minimum of variance, and the proportion of imputed values for proteomics datasets)

Examples

# MultiAssayExperiment
prometis.mae <- phenomis::reading(ProMetIS::post_processed_dir.c(),
                                report.c = "none")
prometis.mae <- prometis.mae[, , ProMetIS::sets.vc()]
plasma_mx2.mae <- ProMetIS::subsetting(prometis.mae,
                                       genes.vc = c("WT", "MX2"),
                                       tissues.vc = "plasma")
# SummarizedExperiment
set.c <- "proteomics_liver"
proteo.mae <- phenomis::reading(ProMetIS::post_processed_dir.c(),
                                subsets.vc = set.c,
                                report.c = "none")
proteo.se <- proteo.mae[[set.c]]
## adding (common) sample metadata to the summarized experiment
sample_meta.DF <- SummarizedExperiment::colData(proteo.mae)
SummarizedExperiment::colData(proteo.se)[, "gene"] <- sample_meta.DF[colnames(proteo.se), "gene"]
SummarizedExperiment::colData(proteo.se)[, "sex"] <- sample_meta.DF[colnames(proteo.se), "sex"]
proteo_mx2.se <- ProMetIS::subsetting(proteo.se,
                                      set.c = set.c,
                                      genes.vc = c("WT", "MX2"))
# MultiDataSet
prometis.mds <- phenomis::reading(ProMetIS::post_processed_dir.c(),
                                output.c = "set",
                                report.c = "none")
prometis.mds <- prometis.mds[, ProMetIS::sets.vc()]
plasma_mx2.mds <- ProMetIS::subsetting(prometis.mds,
                                       genes.vc = c("WT", "MX2"),
                                       tissues.vc = "plasma")
# ExpressionSet
set.c <- "proteomics_liver"
proteo.mset <- phenomis::reading(ProMetIS::post_processed_dir.c(),
                                 subsets.vc = set.c,
                                 output.c = "set",
                                 report.c = "none")
proteo.set <- proteo.mset[[set.c]]
proteo_mx2.set <- ProMetIS::subsetting(proteo.set,
                                       set.c = set.c,
                                       genes.vc = c("WT", "MX2"))

IFB-ElixirFr/ProMetIS documentation built on May 21, 2024, 8:02 p.m.