Description Usage Arguments Value Author(s) Examples
View source: R/general-functions.R
Function for primary code to perform co-expression analysis, with or without data transformation,
using mixture models. The output of coseqRun
is an S4 object of class coseqResults
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
y |
(n x q) matrix of observed counts for n observations (genes) and q variables (samples). In nearly all cases, n > q. |
K |
Number of clusters (a single value or a vector of values) |
conds |
Vector of length q defining the condition (treatment
group) for each variable (column) in |
normFactors |
The type of estimator to be used to normalize for differences in
library size: (“ |
model |
Type of mixture model to use (“ |
transformation |
Transformation type to be used: “ |
subset |
Optional vector providing the indices of a subset of
genes that should be used for the co-expression analysis (i.e., row indices
of the data matrix |
meanFilterCutoff |
Value used to filter low mean normalized counts if desired (by default, set to a value of 50) |
modelChoice |
Criterion used to select the best model. For Gaussian mixture models,
“ |
parallel |
If |
BPPARAM |
Optional parameter object passed internally to |
seed |
If desired, an integer defining the seed of the random number generator. If
|
... |
Additional optional parameters. |
An S4 object of class coseqResults
whose assays contain a SimpleList
object, where each element in the list corresponds to the conditional probabilities of cluster membership
for each gene in each model. Meta data (accessible via metatdata
include the model
used
(either Normal
or Poisson
), the transformation
used on the data, the
transformed data using to estimate model (tcounts
), the normalized profiles for use in plotting
(y_profiles
), and the normalization factors used in the analysis (normFactors
).
Andrea Rau
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Simulate toy data, n = 300 observations
set.seed(12345)
countmat <- matrix(runif(300*4, min=0, max=500), nrow=300, ncol=4)
countmat <- countmat[which(rowSums(countmat) > 0),]
conds <- rep(c("A","B","C","D"), each=2)
## Run the K-means for K = 2,3,4 with logCLR transformation
## The following are equivalent:
run <- coseqRun(y=countmat, K=2:15)
run <- coseq(object=countmat, K=2:15, transformation="logclr", model="kmeans")
## Run the Normal mixture model for K = 2,3,4 with arcsine transformation
## The following are equivalent:
run <- coseqRun(y=countmat, K=2:4, iter=5, transformation="arcsin", model="Normal")
run <- coseq(object=countmat, K=2:4, iter=5, transformation="arcsin", model="Normal")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.