Description Usage Arguments Details Value Examples
Recognizes a variety of R objects/classes and extracts expression matrices from them then converts that to a normalized but not-log transformed matrix appropriate for input into M3Drop functions.
1 | M3DropConvertData(input, is.log=FALSE, is.counts=FALSE, pseudocount=1)
|
input |
a matrix, data.frame or object |
is.log |
has the data been log-transformed? (assumes log-base 2 with pseudocount of 1) |
is.counts |
is the data raw unnormalized counts? (raw counts will be CPM normalized) |
pseudocount |
pseudocount added before log-transformation |
You must have loaded the respective packages (in parentheses) into your namespace before running this function on the respective objects. Note that to maintain scalability sparse matrices will remain as such.
Supported classes/objects:
uses "exprs" or if unavailable then "counts"
uses "normcounts" if available, then "logcounts", which is assumed to be log-normalized, then "counts"
uses "exprs", specify log/counts using arguments
uses "exprs", specify log/counts using arguments
uses "raw.data" as counts.
Matrix/Dataframe classes :
specify log/counts using arguments
specify log/counts using arguments
specify log/counts using arguments
specify log/counts using arguments
specify log/counts using arguments
specify log/counts using arguments
specify log/counts using arguments
A normalized but not log-transformed matrix appropriate for input into M3Drop functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Simulated raw count matrix:
set.seed(42)
counts <- matrix(rpois(200, lambda=3), ncol=10)
expr_mat <- M3DropConvertData(counts, is.counts=TRUE)
# log normalized data frame
lognorm <-log2( t(t(counts)/colSums(counts)*100)+1 )
lognorm <- as.data.frame(lognorm)
expr_mat <- M3DropConvertData(lognorm)
# Sparse matrix
require("Matrix")
counts <- Matrix(counts, sparse=TRUE)
expr_mat <- M3DropConvertData(counts, is.counts=TRUE)
# SingleCellExperiment Object
require("SingleCellExperiment")
SCE <- SingleCellExperiment(assays=list(counts=counts))
expr_mat <- M3DropConvertData(SCE)
# monocle Object
require("monocle")
obj <- suppressWarnings(newCellDataSet(as.matrix(lognorm)))
expr_mat <- M3DropConvertData(obj, is.log=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.