enrichment of gene set with enrichR
1
0
Entering edit mode
6.4 years ago
bikash2510 ▴ 30

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.

enrichR RNA-Seq R • 7.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
5
Entering edit mode
6.4 years ago
egeulgen ★ 1.3k

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

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

How do you currently have your gene names?

ADD REPLY
0
Entering edit mode

I have in excel file.

ADD REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
3
Entering edit mode
  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 REPLY
0
Entering edit mode

Getting an error

enriched <- enrichr(my_genes, dbs)
Uploading data to Enrichr... Error in `[.data.frame`(genes, , 2) : undefined columns selected
ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

what is the output of head(my_genes) ?

ADD REPLY
0
Entering edit mode
1                AA878126
2                LUZP2
3                RRAD
4                BM547196
5                GFRA1
6                A_24_P230195
ADD REPLY
2
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
4
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
3
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
5
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

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