Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result of gsva is all NA #168

Open
YihengJiang0912 opened this issue May 7, 2024 · 1 comment · Fixed by #169
Open

Result of gsva is all NA #168

YihengJiang0912 opened this issue May 7, 2024 · 1 comment · Fixed by #169
Assignees

Comments

@YihengJiang0912
Copy link

Dear authors, I am now using ssgsea method in gsva to evaluate the samples' enrichment score in a dataset, but the result is all NA, I would be very grateful if you could give me some guidance on that.

Belowing please kindly find the result:
`> dim(expr_m)
[1] 20502 10122

ssGSEA_matrix <- gsva(expr = expr_m,
gset.idx.list = my_signature,
method = 'ssgsea',
kcdf = "Gaussian",
min.sz > 1,
abs.ranking = TRUE)
Estimating ssGSEA scores for 14 gene sets.
[1] "Calculating ranks..."
[1] "Calculating absolute values from ranks..."
|=========================================================================================================| 100%

[1] "Normalizing..."
Warning messages:
1: In .filterFeatures(expr, method) :
4180 genes with constant expression values throuhgout the samples.
2: In .gsva(expr, mapped.gset.idx.list, method, kcdf, rnaseq, abs.ranking, :
Some gene sets have size one. Consider setting 'min.sz > 1'.

ssGSEA_matrix[1:5,1:5]
TCGA-OR-A5J1-01 TCGA-OR-A5J2-01 TCGA-OR-A5J3-01 TCGA-OR-A5J5-01 TCGA-OR-A5J6-01
Immune.enrichment.score NA NA NA NA NA
Immune.cell.subsets NA NA NA NA NA
Immune.signaling.molecules NA NA NA NA NA
X13.T.cell.signature NA NA NA NA NA
T.cells NA NA NA NA NA
`

However, if I only use part of my dataset, I can get the results:

`> ssGSEA_matrix <- gsva(expr = expr_m[,1:100],
gset.idx.list = my_signature,
method = 'ssgsea',
kcdf = "Gaussian",
min.sz > 1,
abs.ranking = TRUE)
Estimating ssGSEA scores for 14 gene sets.
[1] "Calculating ranks..."
[1] "Calculating absolute values from ranks..."
|=========================================================================================================| 100%

[1] "Normalizing..."
Warning messages:
1: In .filterFeatures(expr, method) :
571 genes with constant expression values throuhgout the samples.
2: In .gsva(expr, mapped.gset.idx.list, method, kcdf, rnaseq, abs.ranking, :
Some gene sets have size one. Consider setting 'min.sz > 1'.

ssGSEA_matrix[1:5,1:5]
TCGA-OR-A5J1-01 TCGA-OR-A5J2-01 TCGA-OR-A5J3-01 TCGA-OR-A5J5-01 TCGA-OR-A5J6-01
Immune.enrichment.score 0.07036719 0.04767565 -0.001057149 0.00694892 0.13481281
Immune.cell.subsets -0.24078220 -0.22031222 -0.299557598 -0.29809871 -0.18673913
Immune.signaling.molecules -0.25096208 -0.19650415 -0.319315871 -0.30783535 -0.18980250
X13.T.cell.signature -0.06467369 -0.03327788 -0.166935307 -0.18018616 0.02333241
T.cells
`

@axelklenk axelklenk self-assigned this May 8, 2024
@axelklenk
Copy link
Collaborator

Dear Yiheng Jiang,

the easiest way to solve your problem probably is to upgrade to the latest version, i.e. R-4.4.0, Bioconductor 3.19 and GSVA 1.52.0 (or later), brandnew and available since last week.

In that latest version, the old API for GSVA that you are currently using is defunct and you would have to change your code to use e.g.:

sp <- ssgseaParam(exprData=expr_m, geneSets=my_signature, minSize=10)
ssGSEA_matrix <- gsva(sp)

In addition, please note that

  • arguments kcdf and absRanking apply only to method GSVA and have no effect when using ssGSEA.
  • argument min.sz, now renamed to minSize, must be a numerical value specifying the minimum size for gene sets to use; in the example above I have set it to 10. (I realize that the sentence Consider setting 'min.sz > 1'., as used by the warning message, is misleading and we should change it.)

However, even going back to the latest version accepting your code ( R-4.3.3, Bioconductor 3.18, GSVA 1.50.5) I have tried and could not reproduce your problem using test data -- are there NA values in your data in expr_m[, 101:10122] ? What does e.g. any(is.na(expr_m)) say?

If upgrading doesn't solve your problem and it is not caused by NA values in your data, please let me know and do not forget to include the output of sessionInfo().

@axelklenk axelklenk linked a pull request May 8, 2024 that will close this issue
@axelklenk axelklenk reopened this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants