Description Usage Arguments Details Value Examples
View source: R/utils_load_test_data_onto_PCs.R
Given a list of loading vectors from a training data set, calculate the PCs of the test data set.
1 | LoadOntoPCs(design_df, loadings_ls, sampleID = c("firstCol", "rowNames"))
|
design_df |
A test data frame with rows as samples and named features as columns |
loadings_ls |
A list of p \times d loading vectors or matrices as
returned by either the |
sampleID |
Are the sample IDs in the first column of |
This function takes in a list of loadings and a training-centered test data set, applies over the list of loadings, subsets the columns of the test data by the row names of the loading vectors, right-multiplies the test-data subset matrix by the loading vector / matrix, and returns a data frame of the test-data PCs for each loading vector.
A data frame with the PCs from each pathway concatenated by column.
If you have the tidyverse
loaded, this object will display as a
tibble
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ### Load the Data ###
data("colonSurv_df")
data("colon_pathwayCollection")
### Create -Omics Container ###
colon_Omics <- CreateOmics(
assayData_df = colonSurv_df[, -(2:3)],
pathwayCollection_ls = colon_pathwayCollection,
response = colonSurv_df[, 1:3],
respType = "survival"
)
### Extract AESPCs ###
colonSurv_aespc <- AESPCA_pVals(
object = colon_Omics,
numReps = 0,
parallel = TRUE,
numCores = 2,
adjustpValues = TRUE,
adjustment = c("Hoch", "SidakSD")
)
### Project Data onto Pathway First PCs ###
LoadOntoPCs(
design_df = colonSurv_df,
loadings_ls = colonSurv_aespc$loadings_ls
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.