Question: Can't fetch pathways by entrez id?
0
gravatar for Tania
15 months 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 • 870 views
ADD COMMENTlink modified 15 months ago • written 15 months ago by Tania120

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

ADD REPLYlink modified 15 months ago • written 15 months ago by genomax65k

There are some "NA" like this:

"GPR64",3.191748875,0.03820239287,"GPR64",NA
"LOC116437",3.039359194,0.03583075549,"LOC116437",NA
ADD REPLYlink written 15 months 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 15 months ago • written 15 months ago by genomax65k

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

ADD REPLYlink modified 15 months ago • written 15 months ago by Tania120
1
na.rm=T
ADD REPLYlink written 15 months ago by cpad011211k

How to use that? I tried :

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

but still the cols have NA.

ADD REPLYlink written 15 months 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 15 months ago by Ram130
1
 res[complete.cases(res), ]

or

library(tidyr)
res %>% drop_na(entrez)
ADD REPLYlink modified 15 months ago • written 15 months ago by cpad011211k

Finally works ! Thank you all :)

ADD REPLYlink written 15 months 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: 642 users visited in the last hour