Question: Can't fetch pathways by entrez id?
0
gravatar for Tania
2.2 years ago by
Tania120
Tania120 wrote:

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 • 1.2k views
ADD COMMENTlink modified 2.2 years ago • written 2.2 years ago by Tania120

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

ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by genomax78k

There are some "NA" like this:

"GPR64",3.191748875,0.03820239287,"GPR64",NA
"LOC116437",3.039359194,0.03583075549,"LOC116437",NA
ADD REPLYlink written 2.2 years ago by Tania120
1

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

ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by genomax78k

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

ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by Tania120
1
na.rm=T
ADD REPLYlink written 2.2 years ago by cpad011212k

How to use that? I tried :

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

but still the cols have NA.

ADD REPLYlink written 2.2 years ago by Tania120
1

You can use like this :

Example :

x <- c(1,2,3,4,NA,5)
na.omit(x)
x
>1 2 3 4 5
ADD REPLYlink written 2.2 years ago by Ram130
1
 res[complete.cases(res), ]

or

library(tidyr)
res %>% drop_na(entrez)
ADD REPLYlink modified 2.2 years ago • written 2.2 years ago by cpad011212k

Finally works ! Thank you all :)

ADD REPLYlink written 2.2 years ago by Tania120
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1518 users visited in the last hour