getRobustWeightsMulti {SmCCNet} | R Documentation |
Run Sparse multiple Canonical Correlation Analysis and Obtain Canonical Weights (with Subsampling)
Description
SmCCNet algorithm with multi-omics data and quantitative phenotype. Calculate the canonical weights for SmCCA.
Usage
getRobustWeightsMulti(
X,
Trait,
Lambda,
s = NULL,
NoTrait = FALSE,
SubsamplingNum = 1000,
CCcoef = NULL,
trace = FALSE,
TraitWeight = FALSE
)
Arguments
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 |
Value
A canonical correlation weight matrix with rows, where
is the number of features for the
th omics. Each
column is the canonical correlation weights based on subsampled features. The number of columns is
SubsamplingNum
.
Examples
## 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)