change a signature vector into a dataframe to be saved into OmicSignature object updated 10/2024

signatureVecToDF(input, bi_directional = FALSE)

Arguments

input

a character vector of the significant feature names, or a numeric vector which names are feature names and values are scores.

bi_directional

logical.

Value

signature dataframe with columns "feature_name", along with "score" and "direction" if applicable

Examples

signatures <- c("gene1", "gene2", "gene3")
signatureVecToDF(signatures)
#>   probe_id feature_name
#> 1        1        gene1
#> 2        2        gene2
#> 3        3        gene3

signatures <- c(0.45, -3.21, 2.44)
names(signatures) <- c("gene1", "gene2", "gene3")
signatureVecToDF(signatures, bi_directional = TRUE)
#>   probe_id feature_name score direction
#> 1        1        gene1  0.45         +
#> 2        2        gene2 -3.21         -
#> 3        3        gene3  2.44         +