View source: R/select_method.R
| select_method | R Documentation |
Filters an integrated signature score matrix to retain results from a specified method (PCA, ssGSEA, or zscore) and strips method suffixes from column names.
select_method(data, method = c("ssGSEA", "PCA", "zscore"))
data |
Data frame or matrix. Integrated signature score matrix. |
method |
Character. One of "PCA", "ssGSEA", or "zscore" (case-insensitive). Default is "ssGSEA". |
Matrix or data frame containing only the selected method's scores.
Dongqiang Zeng
# Simulate data with multiple method columns
set.seed(123)
sim_res <- data.frame(
ID = paste0("Sample", 1:10),
Sig1_PCA = rnorm(10),
Sig1_ssGSEA = rnorm(10),
Sig1_zscore = rnorm(10),
Sig2_PCA = rnorm(10),
Sig2_ssGSEA = rnorm(10),
Sig2_zscore = rnorm(10)
)
# Select PCA method columns only
pca_res <- select_method(sim_res, method = "PCA")
print(colnames(pca_res))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.