Question: enrichment of gene set with enrichR
0
gravatar for bikash2510
6 months ago by
bikash251030
bikash251030 wrote:

How to add or input nearly 8000 genes for annotation in enrichR.

This is command below

library(enrichR)
dbs <- listEnrichrDbs()
dbs <- c("GO_Molecular_Function_2015", "GO_Cellular_Component_2015", "GO_Biological_Process_2015" , "ChEA_2016" ,"KEGG_2016")
enriched <- enrichr(c("Runx1", "Gfi1", "Gfi1b", "Spi1", "Gata1", "Kdr"), dbs)
printEnrich(enriched, "output.txt" , sep = "\t", columns = c(1:9))

bp <- enriched[["GO_Biological_Process_2015"]]

But I want to enter 8000 genes for enrichment, how to do that.

rna-seq R enrichr • 929 views
ADD COMMENTlink modified 6 months ago by WouterDeCoster32k • written 6 months ago by bikash251030

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLYlink written 6 months ago by WouterDeCoster32k

Actually, i am new to R, what you are saying I am not getting it. :(

ADD REPLYlink written 6 months ago by bikash251030

Wouter's statement has nothing to do with R. It's a short primer on how to format your post. You can read the posts under https://biostars.org/t/how-to to learn how to use the site better.

ADD REPLYlink written 6 months ago by Ram17k

Hello bikash2510!

We believe that this post does not fit the main topic of this site.

Issue Resolved.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

ADD REPLYlink written 6 months ago by bikash251030

There is no need to close a question if it's resolved, I reopened the thread.

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLYlink written 6 months ago by WouterDeCoster32k
4
gravatar for egeulgen
6 months ago by
egeulgen440
Istanbul
egeulgen440 wrote:

Put your genes in a vector: my_vec <- c("Gene1", "Gene2", ..., "Gene8000"). Then you can run enriched <- enrichr(my_vec, dbs)

ADD COMMENTlink written 6 months ago by egeulgen440

It will take very long time do this, any short method pls.

ADD REPLYlink written 6 months ago by bikash251030

How do you currently have your gene names?

ADD REPLYlink written 6 months ago by WouterDeCoster32k

I have in excel file.

ADD REPLYlink written 6 months ago by bikash251030
1

Save them as a delimited file (csv/tsv) and read the file in R using , create a vector from the dataframe.

Starting point: http://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html

ADD REPLYlink written 6 months ago by WouterDeCoster32k

I am new to R, please can you explain me stepwise how to do that. I have tried the given command but it gets an error.

read.csv(Gene, header = TRUE, sep = ",", quote = "\"", + dec = ".", fill = TRUE, comment.char = "", ...)

Error: '...' used in an incorrect context

ADD REPLYlink written 6 months ago by kalyanimeha20
3
  1. Save the excel file as a csv file on excel (e.g. as "my_file.csv")
  2. In R, read them into a vector with my_genes <- read.csv("my_file.csv")
  3. Run enriched <- enrichr(my_genes, dbs)
ADD REPLYlink written 6 months ago by egeulgen440

Getting an error

enriched <- enrichr(my_genes, dbs)
Uploading data to Enrichr... Error in `[.data.frame`(genes, , 2) : undefined columns selected
ADD REPLYlink modified 6 months ago by genomax55k • written 6 months ago by kalyanimeha20

try enriched <- enrichr(my_genes[, 1], dbs)

ADD REPLYlink written 6 months ago by egeulgen440

Getting new error

Warning message:

In enrichr(my_genes[, 1], dbs) :
  genes must be a vector of gene names or a dataframe with genes and score.
> printEnrich(enriched, "output.txt" , sep = "\t", columns = c(1:9))
Error in `[.data.frame`(data[[i]], 1:n, columns, drop = FALSE) : 
  undefined columns selected
ADD REPLYlink modified 6 months ago by genomax55k • written 6 months ago by kalyanimeha20

Plese, Reply..... it's a humble request from my side. I have to submit my assignment.

ADD REPLYlink written 6 months ago by kalyanimeha20
3

You'll learn a lot from that assignment by having someone else do your work.

ADD REPLYlink written 6 months ago by WouterDeCoster32k
1

Google Convert a column to character vector in R and follow results you will be able to convert your data to a character vector, then it works.

ADD REPLYlink written 6 months ago by venu5.6k

I had googled it, but I couldn't find any appropriate answer, each time I get an error.

ADD REPLYlink written 6 months ago by kalyanimeha20

what is the output of head(my_genes) ?

ADD REPLYlink written 6 months ago by venu5.6k
1                AA878126
2                LUZP2
3                RRAD
4                BM547196
5                GFRA1
6                A_24_P230195
ADD REPLYlink modified 6 months ago by WouterDeCoster32k • written 6 months ago by kalyanimeha20
2

Really? It shouldn't be like that in R. Did you run above command from R?

Okay, prepare a text file with one gene per line and read into R.

dat=read.delim("geneList.txt", header=FALSE)

my_genes=as.character(dat$V1)

# run enrichr ...
ADD REPLYlink modified 6 months ago • written 6 months ago by venu5.6k

Still getting an error.

> dat=read.delim("Up_Treated1.txt", header=FALSE)
> my_genes=as.character(dat$V1)
> enriched <- enrichr(dat, dbs)
Uploading data to Enrichr... Error in `[.data.frame`(genes, , 2) : undefined columns selected
> printEnrich(enriched, "output.txt" , sep = "\t", columns = c(1:9))
Error in printEnrich(enriched, "output.txt", sep = "\t", columns = c(1:9)) : 
  object 'enriched' not found
ADD REPLYlink modified 6 months ago by WouterDeCoster32k • written 6 months ago by kalyanimeha20
4

Don't get me wrong but pay attention to the code & error and which objects you are using as input for functions.

Here you should use my_genes with enrichr function. What did you think of the purpose behind my_genes=as.character(dat$V1) ? You are still using the dat object with enrichr function.

ADD REPLYlink written 6 months ago by venu5.6k

Thankx a lot for helping me..all..finally no errors.

ADD REPLYlink written 6 months ago by kalyanimeha20

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLYlink written 6 months ago by WouterDeCoster32k

If I had an Entrez id than how to convert into vector form in text format. In the above query i had used chrachter form but when i am using it in numeric form it showing error.

my_genes <- c("11171", "8243", "112464", "2194", "9318", "79026", "1654", "65003", "6240", "3476", "6238", "3836", "4176", "1017", "249")

Command-

dat=read.delim("EntrezID.txt", header=FALSE)

my_genes=as.numeric(dat$V1)

de <- names( my_genes)[abs( my_genes) > 1.5]

head(de)

NULL

ADD REPLYlink written 6 months ago by bikash251030
3

Do us all a favor (including yourself) and follow some R tutorials.

ADD REPLYlink written 6 months ago by WouterDeCoster32k

If I had enough time to search and learn various tutorial than I could have done it previously, anyone knows the answer then please tell me.

ADD REPLYlink written 6 months ago by bikash251030
5

If you're not willing to invest effort, bikash2510, no one else will be willing to help you. You do not seem to understand etiquette followed in open science forums. I'd recommend you put some time into learning and be careful with that attitude.

I will be monitoring your future posts for etiquette as well as evidence of effort invested.

ADD REPLYlink written 6 months ago by Ram17k

Thanks for your suggestion, I have found out the answer for following errors, self-effort matters some time :)

ADD REPLYlink written 6 months ago by bikash251030

Glad you found a solution. Effort matters all the time.

ADD REPLYlink modified 6 months ago • written 6 months ago by Ram17k
3

If I had enough time to search and learn various tutorial than I could have done it previously, anyone knows the answer then please tell me.

o_O

So you must be thinking people here have nothing important to do and just passing time. Good way to ask for help buddy!

ADD REPLYlink written 6 months ago by venu5.6k

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLYlink written 6 months ago by WouterDeCoster32k
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: 560 users visited in the last hour