Description Usage Arguments Details Value Examples
View source: R/superPC_modifiedSVD.R
Center and compute the SVD of a matrix
1 |
mat |
A matrix of data frame in "tall" format (p \times n). |
method |
What function should be used to extract the left- and right-
singular vectors and singular values? Any function that returns the values
as a list with components |
n.components |
How many singular values / vectors to return? Must be an
integer less than min(p, n). Best performance increase is for values
much less than min(p, n). Defaults to |
The mysvd
function takes in a tall -Omics data matrix,
extracts the feature means, centers the matrix on this mean vector, and
calculates the Singular Value Decomposition (SVD) of the centered data
matrix. Currently, the SVD is calculated via the
fast.svd
function from corpcor
package.
However, this function calculates all the singular vectors, even when
n.components
is non-NULL
. We should experiment with other SVD
functions, such as the rsvd
function from the
rsvd
package. ENHANCEMENT.
A list containing:
u
: The first n.components
left singular vectors of
mat
.
d
: The largest n.component
singular values of
mat
.
v
: The first n.components
right singular vectors of
mat
.
feature.means
: A named vector of the feature means of
mat
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # DO NOT CALL THIS FUNCTION DIRECTLY.
# Use SuperPCA_pVals() instead
## Not run:
data("colon_pathwayCollection")
data("colonSurv_df")
colon_OmicsSurv <- CreateOmics(
assayData_df = colonSurv_df[,-(2:3)],
pathwayCollection_ls = colon_pathwayCollection,
response = colonSurv_df[, 1:3],
respType = "surv"
)
asthmaGenes_char <-
getTrimPathwayCollection(colon_OmicsSurv)[["KEGG_ASTHMA"]]$IDs
mysvd(t(getAssay(colon_OmicsSurv))[asthmaGenes_char, ])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.