View source: R/MultiOmicsSmCCA.R
getRobustWeightsMulti | R Documentation |
SmCCNet algorithm with multi-omics data and quantitative phenotype. Calculate the canonical weights for SmCCA.
getRobustWeightsMulti(
X,
Trait,
Lambda,
s = NULL,
NoTrait = FALSE,
SubsamplingNum = 1000,
CCcoef = NULL,
trace = FALSE,
TraitWeight = FALSE
)
X |
A list of omics data each with n subjects. |
Trait |
An |
Lambda |
Lasso penalty vector with length equals to the number of omics data ( |
s |
A vector with length equals to the number of omics data ( |
NoTrait |
Logical, default is |
SubsamplingNum |
Number of feature subsamples. Default is 1000. Larger number leads to more accurate results, but at a higher computational cost. |
CCcoef |
Optional scaling factors for the SmCCA pairwise canonical
correlations. If |
trace |
Whether to display the CCA algorithm trace, default is set to |
TraitWeight |
Whether to return canonical weight for trait (phenotype), default is set to |
A canonical correlation weight matrix with p = \sum_{i} p_i
rows, where p_i
is the number of features for the i
th omics. Each
column is the canonical correlation weights based on subsampled features. The number of columns is SubsamplingNum
.
## For illustration, we only subsample 5 times.
set.seed(123)
X1 <- matrix(rnorm(600,0,1), nrow = 60)
X2 <- matrix(rnorm(600,0,1), nrow = 60)
Y <- matrix(rnorm(60,0,1), nrow = 60)
# Unweighted SmCCA
result <- getRobustWeightsMulti(X = list(X1, X2), Trait = Y, NoTrait = FALSE,
Lambda = c(0.5, 0.5),s = c(0.7, 0.7), SubsamplingNum = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.