<p>You could take a look at the <code>rentrez</code> package for R. You can use the <code>entrez_search</code> function to get the GEO IDs for the studies related to your query, and then the <code>entrez_summary</code> function for the results. So, for example:</p>

<pre><code>x &lt;- rentrez::entrez_search(db="gds", term=paste0("tolvaptan AND gse[ETYP]"),
                            use_history = T)
res &lt;- rentrez::entrez_summary(db="gds", id=x$ids)
str(res)
</code></pre>

<p>Where <code>res</code> will be a list containing objects of the <code>esummary</code> class. Then, you can use the following line to get the GSE accession numbers related to tolvaptan:</p>

<pre><code>lapply(res, `[[`, "gse")    
</code></pre>

<p>So you could put this function in a loop replacing "tolvaptan" with your drugs:</p>

<pre><code>drugs &lt;- c("drugA", "drugB", "drugC")
for(drug in drugs){
    x &lt;- rentrez::entrez_search(db="gds", term=paste0(drug, " AND gse[ETYP]"))
    res &lt;- rentrez::entrez_summary(db="gds", id=x$ids)
    lapply(res, `[[`, "gse")     
} 
</code></pre>

<p>Take a look at the <a href="https://cran.r-project.org/web/packages/rentrez/vignettes/rentrez_tutorial.html" rel="nofollow noreferrer"><code>rentrez</code> documentation</a> for more details.</p>

CC BY-SA 4.0
2018-09-24T15:51:34.850Z
2018-09-24T17:22:05.357Z
2018-09-24T17:22:05.357Z
pedrostrusso
<p>One of the problems I've found with GEO and even ArrayExpress is that it seems like there are tons of false positives that come up in the search. Additionally, there may be a ton of results that you miss because you didn't include the synonym of the drug. </p>

<p>In order to make sure I have all the information relating to name, etc, you can write a script which downloads the result of a search in PubChem (this can be done with drugbank as well I think) and then parse the search result, extracting important information such as synonyms of drug name.</p>

<p>Finally, take those synonyms and use them in an Entrez (EUtils) search for the experiments. Then try to filter the results to keep only what you're actually looking for. One bad way to do this is just by making sure the experiment summary contains the term your looking for. Another way to potentially do this, for example if there is a large experiment which tests serveral different factors is to programmatically search through associated files to ensure they contain a desired keyword. </p>

<p>You'll get different experiment types and so the files associated with the results will depend on the type of experiment in the search result.</p>

<p>When you get have a list of IDs of the experiments you want, you can feed them through to GEOquery in Bioconductor.</p>

CC BY-SA 3.0
2017-06-15T19:10:23.020Z
2017-06-15T19:10:23.020Z
jaslibra
<p>I would recommend using GEOmetadb from Bioconductor. GEOmetadb is a simple wrapper that will download an up-to-date SQLite database with the metadata for all entities in GEO. You can then use your favorite SQL client to query the database quickly, since it's offline, refining your search as you go.</p>

CC BY-SA 4.0
2018-09-22T10:48:44.683Z
Welcome to the site. Although the recommendation is useful how does GEOmetadb could be used to download GEO data associated with a drug?
llrs
CC BY-SA 4.0
2018-09-25T02:05:26.890Z
GEOmetadb will allow you to do fast full text search searches so you could search all GSEs for specific drug names or drug ids.
Breck
CC BY-SA 4.0
2018-09-22T00:39:03.073Z
2018-09-22T00:39:03.073Z
Breck
<p>I want to find all experiments in GEO that are associated with a drug (for example tolvaptan). Is there any quick and scalable way to to this? I want to query more than 100 drugs.</p>

<p>I tried to use bioDBnet to map Drug Bank ID to look up data sets, but I don't know what output format should I select.</p>

CC BY-SA 3.0
2017-06-15T13:23:33.833Z
I'd say the quickest way is simply to search GEO datasets at the NCBI with the drug name. Did you have some kind of programmatic pipeline in mind?
neilfws
CC BY-SA 3.0
2017-06-15T13:24:28.647Z
there are more than 100 drugs, so a faster method would help.
hhoomn
CC BY-SA 3.0
2017-06-15T13:26:58.283Z
Then I'd suggest programmatic search of GEO using the EUtils API. Happy to post an answer based on that if it would help? (will have to wait a few hours though)
neilfws
CC BY-SA 3.0
2017-06-15T17:52:47.210Z
@hhoomn Welcome to our community. I tried to add the scalability requirement to the question. Feel free to improve it. Generally we are trying to keep all questions precise, therefore do not hesitate to add further specifications directly into question instead of comments.
Kamil S Jaron
CC BY-SA 3.0
2017-06-15T21:04:03.287Z
It would also be useful to see some example input (presumably a list of DrugBank IDs?) and some idea of the desired output (GEO dataset IDs, or summaries?)
neilfws
<database><gene><drugs>
How to find GEO data sets using Drug Bank ID and bioDBnet
# How to find GEO data sets using Drug Bank ID and bioDBnet

(Asked by: username_0 on 2017-06-15)

I want to find all experiments in GEO that are associated with a drug (for example tolvaptan). Is there any quick and scalable way to to this? I want to query more than 100 drugs.

I tried to use bioDBnet to map Drug Bank ID to look up data sets, but I don't know what output format should I select.

**Tags:** database, gene, drugs
> **Comments:**
> **username_1**: I'd say the quickest way is simply to search GEO datasets at the NCBI with the drug name. Did you have some kind of programmatic pipeline in mind?  
> **username_0**: there are more than 100 drugs, so a faster method would help.  
> **username_1**: Then I'd suggest programmatic search of GEO using the EUtils API. Happy to post an answer based on that if it would help? (will have to wait a few hours though)  
> **username_2**: @hhoomn Welcome to our community. I tried to add the scalability requirement to the question. Feel free to improve it. Generally we are trying to keep all questions precise, therefore do not hesitate to add further specifications directly into question instead of comments.  
> **username_1**: It would also be useful to see some example input (presumably a list of DrugBank IDs?) and some idea of the desired output (GEO dataset IDs, or summaries?)  

---

## 3 answers

### Answer by username_3 on 2018-09-24. Score: 3

You could take a look at the rentrez package for R. You can use the entrez_search function to get the GEO IDs for the studies related to your query, and then the entrez_summary function for the results. So, for example:
x <- rentrez::entrez_search(db="gds", term=paste0("tolvaptan AND gse[ETYP]"),
                            use_history = T)
res <- rentrez::entrez_summary(db="gds", id=x$ids)
str(res)

Where res will be a list containing objects of the esummary class. Then, you can use the following line to get the GSE accession numbers related to tolvaptan:
lapply(res, `[[`, "gse")    

So you could put this function in a loop replacing "tolvaptan" with your drugs:
drugs <- c("drugA", "drugB", "drugC")
for(drug in drugs){
    x <- rentrez::entrez_search(db="gds", term=paste0(drug, " AND gse[ETYP]"))
    res <- rentrez::entrez_summary(db="gds", id=x$ids)
    lapply(res, `[[`, "gse")     
} 

Take a look at the rentrez documentation for more details.


---

### Answer by username_4 on 2017-06-15. Score: 2

One of the problems I've found with GEO and even ArrayExpress is that it seems like there are tons of false positives that come up in the search. Additionally, there may be a ton of results that you miss because you didn't include the synonym of the drug.

In order to make sure I have all the information relating to name, etc, you can write a script which downloads the result of a search in PubChem (this can be done with drugbank as well I think) and then parse the search result, extracting important information such as synonyms of drug name.

Finally, take those synonyms and use them in an Entrez (EUtils) search for the experiments. Then try to filter the results to keep only what you're actually looking for. One bad way to do this is just by making sure the experiment summary contains the term your looking for. Another way to potentially do this, for example if there is a large experiment which tests serveral different factors is to programmatically search through associated files to ensure they contain a desired keyword.

You'll get different experiment types and so the files associated with the results will depend on the type of experiment in the search result.

When you get have a list of IDs of the experiments you want, you can feed them through to GEOquery in Bioconductor.


---

### Answer by username_5 on 2018-09-22. Score: 0

I would recommend using GEOmetadb from Bioconductor. GEOmetadb is a simple wrapper that will download an up-to-date SQLite database with the metadata for all entities in GEO. You can then use your favorite SQL client to query the database quickly, since it's offline, refining your search as you go.

> **Comments:**
> **username_6**: Welcome to the site. Although the recommendation is useful how does GEOmetadb could be used to download GEO data associated with a drug?  
> **username_5**: GEOmetadb will allow you to do fast full text search searches so you could search all GSEs for specific drug names or drug ids.  

---

