Those are useful parameters. Thanks!
I can query GEO eUtils by accession number and get back some relevant XML, e.g.
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gds&term=GSE57214%5bGEO%20Accession
But what I really want is the full record, which comes from the first ID listed in the above query's returned XML:
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gds&id=200057214
My question is: where does this ID (200057214), come from, and how can I programmatically get it from the accession number (GSE57214). In particular, I'd like to be able to get it from the website (http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE57214 ).
Any help is appreciated.
2 answers
I think you also want to limit the search by "entry type", as it seems the same accession number can be used for datasets, series and samples.
Using the development version of rentrez to demonstrate (though, of course, you can do this with any package). First find what search terms are aviable for GDS:
library(rentrez)
terms <- entrez_db_searchable(db="gds")
as.data.frame(terms)[c("ACCN", "ETYP"),]
#ACCN accession for GDS (DataSet), GPL (Platform), GSM (Sample), GSE (Series)
#ETYP Entry type (DataSet or Series)
Then make your search/fetch your summary:
gds_search <- entrez_search(db="gds", term="GSE57214[ACCN] AND gse[ETYP])")
gds_search$ids
# [1] "200057214"
#get the record summary as a list:
entrez_summary(db="gds", id=gds_search$ids)
You could possibly restrict the retmax to 1 and retmode to JSON on esearch, then pickup the ID returned, then pass it to esummary. Not sure if you can jump from search to details and skip the results step in between.
Log in to answer this question.