filter_by_variance: Filter using the variance filter

View source: R/filter_by.R

filter_by_varianceR Documentation

Filter using the variance filter

Description

This function is used to improve the quality of the hits. It compute the variance among the hits and filter the one with a value greater than the threshold set

Usage

filter_by_variance(
  screenR_Object,
  genes,
  matrix_model,
  variance = 0.5,
  contrast
)

Arguments

screenR_Object

The ScreenR object obtained using the create_screenr_object

genes

The genes for which the variance as to be computed. Those genes are the result of the three statistical methods selection

matrix_model

a matrix created using model.matrix

variance

The maximum value of variance accepted

contrast

The variable to use as X for the linear model for the Treatment

Value

A data frame with the variance for the treatment and the control for each gene

Examples

object <- get0("object", envir = asNamespace("ScreenR"))
matrix_model <- model.matrix(~ slot(object, "groups"))
colnames(matrix_model) <- c("Control", "T1_T2", "Treated")
contrast <- limma::makeContrasts(Treated - Control, levels = matrix_model)

data <- filter_by_variance(
    screenR_Object = object, genes = c("Gene_42"),
    matrix_model = matrix_model, contrast = contrast
)
head(data)


EmanuelSoda/ScreenR documentation built on Sept. 29, 2023, 12:33 a.m.