error running fgsea
0
0
Entering edit mode
2.4 years ago
Chironex ▴ 50

I was trying to do gene set enrichment analysis on genes using fgsea

library(msigdbr)
library(fgsea)

geneSets <- msigdbr(species = "Mus musculus", category = "C5", subcategory = "BP")
geneSets$gene_symbol <- toupper(geneSets$gene_symbol)
geneSets <- geneSets[geneSets$gene_symbol %in% names(trade_obj_condition),]
m_list <- geneSets %>% split(x = .$gene_symbol, f = .$gs_name)
stats <- assocRes$waldStat_lineage1_conditionWT
names(stats) <- rownames(assocRes)
eaRes <- fgsea(pathways = m_list, stats = stats, nperm = 5e4, minSize = 10)

but I get the following error:

error in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam,  : 
  Not all stats values are finite numbers

Any idea to solve this?

>stats
       Spink1        Ctla2a           Ttr          Rbp4          Myl3         Hba-x           Dcc        Dppa5a         Acta1          Dqx1         Tagln 
 1.731774e+02  2.034629e+01  2.191111e+01  2.020563e+01  4.305591e+02  1.695716e+00  1.667912e+02  0.000000e+00  3.231235e+02  0.000000e+00  6.934187e+02 
          Trh         Actc1         Postn          Flt1        Hba-a1         Kcnh7         Cldn5           Pyy         Rhox5         Adam2        Ankrd1 
 1.830701e+02  2.125486e+03  1.942966e+02  8.704570e+00            NA  2.572836e+02            NA  1.560577e+02  3.586355e-01  3.994400e+00  2.834636e+01 
       Col1a2          Myh6        Col3a1          Dlg2          Myl7          Myh7         Ptcra         Tnnt2         Apela         Nrxn3           Sst 
 2.790170e+02  1.688836e+03  5.115189e+02  1.815414e+02  4.212569e+03  1.406209e+03  4.014118e+00  2.320943e+03  5.262045e+01  9.482058e+01  6.477689e+00 
       Col1a1           Ttn        Hapln1          Tdo2          Myl1 4930445E18Rik         Rspo2           Cck          Cdh5        S100a6          Myl2 
 7.761603e+02  3.586401e+03  4.371536e+01  2.601059e+01  1.297247e+01  4.527971e+00            NA  8.315099e+01            NA  4.034738e+01  2.728818e+01 
         Myl4         Ramp2        Ctnna2        Slc8a1          Pnmt          Ccl2          Pkp1          Tac2         Hpse2         Pcdh9          Ctsh 
 3.112504e+03  4.595012e+01            NA  1.989356e+03  6.170063e+01            NA            NA  3.782578e+01  1.645022e+01  7.450837e+01  1.141692e-03 
        Plvap          Car4         Epcam         Gfod2       Gm32916         Csmd3           Tnc        Igfbp3         Tdgf1           Lum         Erbb4 
 2.143969e+01  4.409012e+02  1.307938e+03  3.907799e-01  9.920453e-02  1.807980e+02  7.450541e+01  8.641306e+01  6.550384e+02  1.867955e+02  5.431297e+01 
         Reln          Spp1           Dcn          Dlk1         Pmp22        Sh3bgr         Pgam2 5430431A17Rik          Rfx4         Cped1         Xlr5a 
 2.886761e+01  1.235584e+01  5.226432e+00  3.065704e+02  3.223237e+01  1.502181e+03  7.471301e+02  8.126171e+02  2.423789e-01  4.923818e+02  0.000000e+00 
      Hbb-bh1       Kirrel3          Nnat         Casp8          Ddb2          Nav3          Wnt1          Ebf1         Slit2        Col6a3         Fkbp6 
 1.846295e+00            NA  7.804629e+01  2.390873e+01  0.000000e+00  6.040221e+01  2.928268e+01  7.793435e+01  6.988499e+02  2.360845e+00            NA 
gene onthology fgsea • 1.5k views
ADD COMMENT
0
Entering edit mode

Not all stats values are finite numbers

What is unclear? I see NAs in your data, these are not finite, and that's what the error tells you. What is the tool that returns the ranking metric? You need to rank by something that is continuous and has no missing or infinite values.

ADD REPLY
0
Entering edit mode

ok, I know the problem but I was trying to understand if make sense to remove directly genes with NA values

ADD REPLY
0
Entering edit mode

The question is why there are NAs.

What is the tool that returns the ranking metric?

ADD REPLY

Login before adding your answer.

Traffic: 1755 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