filterBinMSnSet: Filter a binary MSnSet

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MSnSet.R

Description

Removes columns or rows that have a certain proportion or absolute number of 0 values.

Usage

1
filterBinMSnSet(object, MARGIN = 2, t, q, verbose = TRUE)

Arguments

object

An MSnSet

MARGIN

1 or 2. Default is 2.

t

Rows/columns that have t or less 1s, it will be filtered out. When t and q are missing, default is to use t = 1.

q

If a row has a higher quantile than defined by q, it will be filtered out.

verbose

A logical defining of a message is to be printed. Default is TRUE.

Value

A filtered MSnSet.

Author(s)

Laurent Gatto

See Also

zerosInBinMSnSet, filterZeroCols, filterZeroRows.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
set.seed(1)
m <- matrix(sample(0:1, 25, replace=TRUE), 5)
m[1, ] <- 0
m[, 1] <- 0
rownames(m) <- colnames(m) <- letters[1:5]
fd <- data.frame(row.names = letters[1:5])
x <- MSnSet(exprs = m, fData = fd, pData = fd)
exprs(x)
## Remove columns with no 1s
exprs(filterBinMSnSet(x, MARGIN = 2, t = 0))
## Remove columns with one 1 or less
exprs(filterBinMSnSet(x, MARGIN = 2, t = 1))
## Remove columns with two 1s or less
exprs(filterBinMSnSet(x, MARGIN = 2, t = 2))
## Remove columns with three 1s 
exprs(filterBinMSnSet(x, MARGIN = 2, t = 3))
## Remove columns that have half or less of 1s
exprs(filterBinMSnSet(x, MARGIN = 2, q = 0.5))

pRoloc documentation built on Nov. 8, 2020, 6:26 p.m.