Efetch¶
entrezpy.efetch.efetcher.Efetcher
implements the E-Utility
EFetch [0]. Efetcher
queries return data from the Entrez History server.
Usage¶
import entrezpy.efetch.efetcher
e = entrezpy.efetch.efetcher.Efetcher(tool,
email,
apikey=None,
apikey_var=None,
threads=None,
qid=None)
analyzer = e.inquire({'db' : 'pubmed',
'id' : [17284678, 9997],
'retmode' : 'text',
'rettype' : 'abstract'})
print(analyzer.count, analyzer.retmax, analyzer.retstart, analyzer.uids)
Efetcher
¶
entrezpy.efetch.efetcher.Efetcher
param str tool: string with no internal spaces uniquely identifying the software producing the request, i.e. your tool/pipeline. param str email: a complete and valid e-mail address of the software developer and not that of a third-party end user. entrezpy
is this is a library, not a tool.param str apikey: NCBI API key param str apikey_var: NCBI API key param int threads: number of threads param str qid: Unique Esearch query id. Will be generated if not given.
Supported E-Utility parameter¶
Parameters are passed as dictionary to
entrezpy.esearch.esearcher.Esearcher.inquire()
and are expected to be the
same as those for the E-Utility [0]. For example:
{'db' : 'nuccore', 'term' : 'Pythons [Organism]'}
Esearcher
introduces the additional parameter reqsize
. It sets the size
of a request. Numbers grater than the maximum allowed by NCBI will be set to
the maximum.
Parameter | Type | |
---|---|---|
E-Utility | ||
db |
str |
|
WebEnv |
str |
|
query_key |
int |
|
uilist |
bool |
|
retmax |
int |
|
retstart |
int |
|
usehistory |
bool |
|
term |
str |
|
sort |
str |
|
field |
str |
|
reldate |
int |
|
datetype |
str (YYYY/MM/DD, YYYY/MM, YYYY) |
|
mindate |
str (YYYY/MM/DD, YYYY/MM, YYYY) |
|
maxdate |
str (YYYY/MM/DD, YYYY/MM, YYYY) |
|
idtype |
str |
|
retmode |
`json , enforced by Esearcher |
|
Esearcher | reqsize |
int |
Result¶
Instance of entrezpy.efetch.efetch_result.EfetchResult
.
If retmax
= 0 or retmode
= count
no UIDs are returned. If
usehistory
is True
(default), WebEnv and query_key for
the request is returned.
Approach¶
- Parameters are checked and the request size is configured
- Initial search is requested
- If more search requests are required, Parameter is adjusted and the remaining requests are done
- If no errors were encountered, returns the analyzer with the result for all requests