Can't fetch pathways by entrez id?
0
0
Entering edit mode
6.4 years ago
Tania ▴ 180

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 • 2.6k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

There are some "NA" like this:

"GPR64",3.191748875,0.03820239287,"GPR64",NA
"LOC116437",3.039359194,0.03583075549,"LOC116437",NA
ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
na.rm=T
ADD REPLY
0
Entering edit mode

How to use that? I tried :

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

but still the cols have NA.

ADD REPLY
1
Entering edit mode

You can use like this :

Example :

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

or

library(tidyr)
res %>% drop_na(entrez)
ADD REPLY
0
Entering edit mode

Finally works ! Thank you all :)

ADD REPLY

Login before adding your answer.

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