Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-24T15:51:34.850Z
Answers.LastActivityDate: 2018-09-24T17:22:05.357Z
Answers.LastEditDate: 2018-09-24T17:22:05.357Z
Answers.UserDisplayName: pedrostrusso
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-15T19:10:23.020Z
Answers.LastActivityDate: 2017-06-15T19:10:23.020Z
Answers.UserDisplayName: jaslibra
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-22T10:48:44.683Z
Answers.Text: Welcome to the site. Although the recommendation is useful how does GEOmetadb could be used to download GEO data associated with a drug?
Answers.UserDisplayName: llrs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-25T02:05:26.890Z
Answers.Text: GEOmetadb will allow you to do fast full text search searches so you could search all GSEs for specific drug names or drug ids.
Answers.UserDisplayName: Breck
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-22T00:39:03.073Z
Answers.LastActivityDate: 2018-09-22T00:39:03.073Z
Answers.UserDisplayName: Breck
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-15T13:23:33.833Z
Comments.Text: 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?
Comments.UserDisplayName: neilfws
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-15T13:24:28.647Z
Comments.Text: there are more than 100 drugs, so a faster method would help.
Comments.UserDisplayName: hhoomn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-15T13:26:58.283Z
Comments.Text: 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)
Comments.UserDisplayName: neilfws
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-15T17:52:47.210Z
Comments.Text: @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.
Comments.UserDisplayName: Kamil S Jaron
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-15T21:04:03.287Z
Comments.Text: 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?)
Comments.UserDisplayName: neilfws
Tags: <database><gene><drugs>
Title: How to find GEO data sets using Drug Bank ID and bioDBnet
ThreadText: # 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**: @username_0 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](https://cran.r-project.org/web/packages/rentrez/vignettes/rentrez_tutorial.html) 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.  
  
  ---
  
  