Suggestion for FGSEA and GSEA creation for C57BL/6J Mice
1
0
Entering edit mode
Gordon • 0
@083bbd83
Last seen 3 hours ago
United States

Hi all,

I am trying to create GSEA and FGSEA for C57BL/6J Mice species. I had created a code for human species, and thought to switch out all human input as mice. However, I ran into some issues,

res <- res %>%
  mutate(rank = rank(log2FoldChange, ties.method = "random")) 
ens2symbol <- AnnotationDbi::select(org.Mm.eg.db,
                                    key=res$row, 
                                    columns="SYMBOL",
                                    keytype="ENTREZID")

Error in .testForValidKeys(x, keys, keytype, fks) : 'keys' must be a character vector

The input of column row is ENSMUSG* gmt pathway is mh.all.v2024.1.Mm.symbols.gmt

Any suggestions?

gsea mice org.Mm.eg.db • 291 views
ADD COMMENT
0
Entering edit mode

what is the class and values of res$row ?

ADD REPLY
0
Entering edit mode

It appeared as "NULL"

Res input is: "row","baseMean","log2FoldChange","lfcSE","stat","pvalue","padj" Data shows 7 variables with row as first column.

ENSMUSG00000101249 23365.54446 1.411235 0.3365968 4.192657 2.757065e-05 1.026079e-02

ADD REPLY
0
Entering edit mode

If you get NULL for something in R, it means it's not there. You don't show the head of res, but instead one row, so my guess would be the column is actually named something different like 'Row', or maybe those are the rownames rather than a column.

ADD REPLY
0
Entering edit mode

As an example,

> d.f <- data.frame(Row = letters, values = 1:26)
> d.f$row
NULL
ADD REPLY
0
Entering edit mode
> head(res)
# A tibble: 6 × 9

row                baseMean log2FoldChange lfcSE  stat        pvalue      padj  rank SYMBOL
  <chr>                 <dbl>          <dbl> <dbl> <dbl>         <dbl>     <dbl> <int> <chr> 
1 ENSMUSG00000101249   23366.           1.41 0.337  4.19 0.0000276     0.0103      123 NA    
2 ENSMUSG00000024610   12719.          -1.96 0.506 -3.87 0.000109      0.0262       91 Cd74  
3 ENSMUSG00000069516    7123.          -2.22 0.374 -5.94 0.00000000281 0.0000115    77 Lyz2  
4 ENSMUSG00000076617    7631.          -1.94 0.355 -5.48 0.0000000437  0.0000813    92 Ighm  
5 ENSMUSG00000076609    7438.          -2.31 0.406 -5.68 0.0000000135  0.0000459    68 Igkc  
6 ENSMUSG00000060586    5376.          -1.86 0.473 -3.92 0.0000871     0.0217       96 H2-Eb1

This was the depiction using as head(res)

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 28 minutes ago
United States

Oh. You used 'key' as the argument name when it's actually 'keys'. Also, those are Ensembl IDs, so you need to use 'ENSEMBL', not "ENTREZID".

Login before adding your answer.

Traffic: 540 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6