limit the number of efetch result
2
0
Entering edit mode
9 weeks ago

Dear all,

I am working around with recent EDirect (version 18.2). I had tried in order to limit the number of efetch result like following.

esearch -db pubmed -query "transcription regulation" | efetch -start 1 -stop 10 -format uid


I supposed this would have gave me 10 pmids but this code gave me millions of pmids.

Does someone know how to restrict the number of efetch results?

Thanks,

efetch EDirect. • 434 views
0
Entering edit mode
9 weeks ago

(I only know the web API) I usually use the parameter retmax for esearch . I think stop for efetch is for the start-end of the sequences.

0
Entering edit mode

As far as I understand, API works fine only if the number of result less than 10,000.
So following url give me error.

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=transcription[AND]regulation&retmax=10&retstart=10001


This is not very flexible. Do you know if there is any work around for API?
That's must be fine enough, using EDirtect is not mandatly.

Thanks.

0
Entering edit mode
9 weeks ago
GenoMax 125k

Start and Stop option works but you can use it only with one of the format options below for Pubmed records.

pubmed
abstract                    Abstract
bioc                        PubTator Central BioC XML
medline                     MEDLINE
native             asn.1    Pubmed-entry ASN.1
native             xml      PubmedArticleSet XML


You can get the UID first using

esearch -db pubmed -query "transcription" | efetch -format uid


and then fetch them in any batches that you want.

0
Entering edit mode

Since I was afraid that getting large number of IDs in one time affect server performance, I would like to get ids separately.

Taking advantage of your answer, I have tried following. This didn't restrict the number of result, neither.

esearch -db pubmed -query "transcription" | efetch -format medline -start 1 -stop 10 | grep "PMID- "


Do my understanding incorrect?