Description Usage Arguments Value Examples
View source: R/MWAS_assoc_models.R
This function allows filtering the output matrix from "MWAS_stats()", by p-value and/or coefficient of variation (CV).
1 | MWAS_filter(MWAS_matrix, type = "pvalue", alpha_th = 0.05, CV_th = 0.30, sort = FALSE)
|
MWAS_matrix |
numeric matrix generated by the function "MWAS_stats()". |
type |
character constant indicating the filtering criteria. If type = "pvalue", only metabolic variables with p-value below alpha_th will be retained in the MWAS_matrix. If type = "CV", only metabolic variables with CV below CV_th will be retained. If type = "all", only metabolic variables with CV below CV_th and p-value below alpha_th will be retained. |
alpha_th |
numeric value indicating the significance threshold. |
CV_th |
numeric value indicating the CV threshold. |
sort |
logical constant indicating whether the filter MWAS_matrix will be sorted based on p-values. |
A numeric matrix corresponding to the filtered MWAS_matrix. The matrix has an additional column, which indicates the index of each metabolic variable in the original MWAS_matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Load data
data(targetMetabo_SE)
## Test for association between diabetes and target_metabolites
T2D_model <- MWAS_stats (targetMetabo_SE, disease_id = "T2D",
assoc_method = "logistic")
## Filter T2D_model by p-value
MWAS_filter(T2D_model, type = "pvalue", alpha_th = 0.001, sort = TRUE)
## Subset targetMetabo_SE based on pvalue_filter
pvalue_filter <- MWAS_filter(T2D_model, type = "pvalue", alpha_th = 0.001)
index_features <- pvalue_filter[, 4]
targetMetabo_SE[index_features, ]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.