filterBinMSnSet {pRoloc} | R Documentation |
Removes columns or rows that have a certain proportion or absolute number of 0 values.
filterBinMSnSet(object, MARGIN = 2, t, q, verbose = TRUE)
object |
An |
MARGIN |
1 or 2. Default is 2. |
t |
Rows/columns that have |
q |
If a row has a higher quantile than defined by |
verbose |
A |
A filtered MSnSet
.
Laurent Gatto
zerosInBinMSnSet
,
filterZeroCols
, filterZeroRows
.
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))