# subset `example_data` for speed
# all SeqIds from 2000 -> 2999
seqs <- grep("^seq\\.2[0-9]{3}", names(example_data), value = TRUE)
ex_data_small <- head(example_data[, c(getMeta(example_data), seqs)], 10L)
dim(ex_data_small)
ex_data_small$seq.2991.9
# Math Generics:
# -------------
# log-transformation
a <- log(ex_data_small)
a$seq.2991.9
b <- log10(ex_data_small)
b$seq.2991.9
isTRUE(all.equal(b, log(ex_data_small, base = 10)))
# floor
c <- floor(ex_data_small)
c$seq.2991.9
# square-root
d <- sqrt(ex_data_small)
d$seq.2991.9
# rounding
e <- round(ex_data_small)
e$seq.2991.9
# inverse log
antilog(1:4)
alog <- antilog(b)
all.equal(ex_data_small, alog) # return `b` -> linear space
# Ops Generics:
# -------------
plus1 <- ex_data_small + 1
times2 <- ex_data_small * 2
sq <- ex_data_small^2
all.equal(sqrt(sq), ex_data_small)
gt100k <- ex_data_small > 100000
gt100k
ex_data_small == ex_data_small # invokes diffAdats()
# Summary Generics:
# -------------
sum(ex_data_small)
any(ex_data_small < 100) # low RFU analytes
sum(ex_data_small < 100) # how many
min(ex_data_small)
min(ex_data_small, 0)
max(ex_data_small)
max(ex_data_small, 1e+7)
range(ex_data_small)
Run the code above in your browser using DataLab