I have a signature composed of several genes, but not all the genes work in the same direction. In order to predict the outcome with my signature, some of them should be highly expressed while others should be lowly expressed. Generating a gsva as a summary of the expression seems dangerous to me, as you are not taking into account the directinality of the genes.
Chatgpt proposed an option, that while highly convenient, does not work. However, it gives a good idea of what I want to implement:
Imagine my signature is composed of three genes. GeneA should be High, geneB should be Low, geneC should be High:
# Solution proposed by chatgpt
my_gene_sets <- list(A = 1, B = -1, C = 1)
scores <- gsva(expr = tpm_expressionset,
gset = my_gene_sets,
method = "ssgsea",
verbose = FALSE)
This gives me the error.
Error in .mapGeneSetsToFeatures(gset.idx.list, rownames(expr)) :
No identifiers in the gene sets could be matched to the identifiers in the expression data.
However if I do:
my_gene_sets1 <- list("A", "B", "C")
scores <- gsva(expr = tpm_expressionset,
gset = my_gene_sets1,
method = "ssgsea",
verbose = FALSE)
This works perfectly fine, but we are obviously not assessing for directionality.
PS:
my_gene_sets <- list("A" = 1, "B" = -1, "C"= 1)
Gives the same result.