selectGrps: Select by treatment groups (replicate block)

View source: R/filter.R

selectGrpsR Documentation

Select by treatment groups (replicate block)

Description

Select phosphosites that have been quantified in a given percentage of treatment groups (e.g. 0.75 as 3 out of 4 replicates) in n groups.

Usage

selectGrps(mat, grps, percent, n, assay)

Arguments

mat

a matrix (PhosphoExperiment object) with rows correspond to phosphosites and columns correspond to samples in replicates for different treatments.

grps

a string specifying the grouping (replicates).

percent

a percent from 0 to 1, specifying the percentage of quantified values in any treatment group.

n

an integer indicating n or more replicates pass the percentage filtering for a phosphosite to be included.

assay

an assay to be selected if mat is a PhosphoExperiment object.

Value

a filtered matrix (or a PhosphoExperiment Oject) with at least 'percent' quantification in one or more conditions. If an input mat is a SummarizedExperiment object, filtered SummarizedExperiment object will be returned.

Author(s)

Pengyi Yang, Taiyun Kim

Examples

data('phospho.cells.Ins.sample')
grps = gsub('_[0-9]{1}', '', colnames(phospho.cells.Ins))
phospho.cells.Ins.filtered <- selectGrps(phospho.cells.Ins, grps, 0.5, n=1)

# For PhosphoExperiment object
data('phospho.cells.Ins.pe')
grps = gsub('_[0-9]{1}', '', colnames(phospho.cells.Ins.pe))
phospho.cells.Ins.filtered <- selectGrps(phospho.cells.Ins.pe, grps, 0.5, n=1)


PYangLab/PhosR documentation built on Nov. 1, 2024, 1:47 p.m.