Extracts the proteins retained by the sparse model. The output is a plain character vector, directly usable as protein.subset in heatmap.counts or as gene list of an over-representation analysis.
get.sPLSDA.proteins(
DEprot.sPLSDA.object,
component = NULL,
mode = "union",
direction = "both",
top.n = NULL
)An object of class DEprot.sPLSDA.
Numeric value (or vector) indicating the component(s) to use. Default: NULL (all the components).
String indicating how the components are combined. One among: 'union', 'intersect', 'list' (one vector per component). Default: "union".
String indicating which side of the component to keep. One among: 'both', 'positive' (proteins higher in the reference group), 'negative'. Default: "both".
Numeric value indicating how many best-ranked proteins of each component should be returned. Default: NULL (all the selected proteins).
A character vector, or a named list when mode = "list".
splsda <- perform.sPLSDA(DEprot.object = DEprot::test.toolbox$dpo.imp,
group.column = "condition",
keepX = 5,
validate = FALSE)
#> Warning: The number of 'folds' (5) is larger than the smallest class (4 samples): 'folds' has been set to 4.
# All the selected proteins
get.sPLSDA.proteins(DEprot.sPLSDA.object = splsda)
#> [1] "protein.2" "protein.48" "protein.17" "protein.27" "protein.30"
#> [6] "protein.31" "protein.47" "protein.4" "protein.16" "protein.20"
#> [11] "protein.24" "protein.21" "protein.32" "protein.6"
# Top 3 proteins of the first component, higher in the reference group
get.sPLSDA.proteins(DEprot.sPLSDA.object = splsda,
component = 1,
direction = "positive",
top.n = 3)
#> [1] "protein.2" "protein.30"