This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can't fetch pathways by entrez id?

Hello Everyone

I have some expression results from GeneChip Human Genome U133 Plus 2.0 Array. They are already generated, I need to read them and do some pathway analysis using gage and path view.

I am stuck at these errors in my code is below,

'select()' returned 1:1 mapping between keys and columns Error in

names(foldchanges) = res$entrez : attempt to set an attribute on NULL

data <- read.csv(file="affy.csv", header=TRUE, sep=",", row.names =1)
res <- as.data.frame(data)

res$symbol <- mapIds(org.Hs.eg.db,
                     keys=row.names(res),
                     column="SYMBOL",
                     keytype="SYMBOL",
                     multiVals="first")
res$entrez <- mapIds(org.Hs.eg.db,
                     keys=row.names(res),
                     column="ENTREZID",
                     keytype="SYMBOL",
                     multiVals="first")

If I print res it will look like this now:

                 logfc        adjpv       symbol    entrez
HLA-DRB4      5.196415 0.0237606990     HLA-DRB4      3126
SCGB1A1       4.269985 0.0186166347      SCGB1A1      7356

Thanks

gage pathways

Those mapping are correct. Do you have a blank cell in one of the columns in your file?

There are some "NA" like this:

"GPR64",3.191748875,0.03820239287,"GPR64",NA
"LOC116437",3.039359194,0.03583075549,"LOC116437",NA

Those NA seem to be causing the error you are seeing. Are you able to filter those out? Are there many of them?

They are 135 out of 700 ? I should take them off? And do you know how to take them off?

How to use that? I tried :

na.omit(res, cols="entrez")

but still the cols have NA.

You can use like this :

Example :

x <- c(1,2,3,4,NA,5)
na.omit(x)
x
>1 2 3 4 5
 res[complete.cases(res), ]

or

library(tidyr)
res %>% drop_na(entrez)

Finally works ! Thank you all :)

0 answers

No answers yet.

Log in to answer this question.