Package ubic.gemma.core.loader.entrez
Class EntrezUtils
java.lang.Object
ubic.gemma.core.loader.entrez.EntrezUtils
Low-level utilities for generating Entrez URLs.
Read more about this in The E-utilities In-Depth: Parameters, Syntax and More.
- Author:
- poirigui
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
doNicely
(EntrezUtils.EntrezCall<T> task, String apiKey) Coordinate calls to the Entrez API so that we always respect the recommended usage.static URL
fetch
(String db, EntrezQuery query, EntrezRetmode retmode, String rettype, int retstart, int retmax, String apiKey) Retrieve the results of a previoussearch(String, String, EntrezRetmode, String)
query.static URL
Retrieve a record from an Entrez database by ID.static URL
link
(String db, String dbfrom, EntrezQuery query, String cmd, EntrezRetmode retmode, String apiKey) Retrieve related records from an Entrez database from a previoussearch(String, String, EntrezRetmode, String)
query.static URL
Retrieve related records from an Entrez database by ID.static <T> SimpleRetryCallable
<T, IOException> retryNicely
(SimpleRetryCallable<T, IOException> callable, String apiKey) Wrap aSimpleRetryCallable
such that it will respect the recommended usage of the Entrez API.static URL
search
(String db, String term, EntrezRetmode retmode, String apiKey) Perform a search on an Entrez database.static URL
search
(String db, EntrezQuery query, EntrezRetmode retmode, int retstart, int retmax, String apiKey) Replay a previoussearch(String, String, EntrezRetmode, String)
query.static URL
summary
(String db, EntrezQuery query, EntrezRetmode retmode, int retstart, int retmax, String apiKey) Summarize a previoussearch(String, String, EntrezRetmode, String)
query.
-
Field Details
-
ESEARCH
- See Also:
-
ESUMMARY
- See Also:
-
EFETCH
- See Also:
-
ELINK
- See Also:
-
-
Constructor Details
-
EntrezUtils
public EntrezUtils()
-
-
Method Details
-
doNicely
public static <T> T doNicely(EntrezUtils.EntrezCall<T> task, @Nullable String apiKey) throws IOException Coordinate calls to the Entrez API so that we always respect the recommended usage.Refer to A General Introduction to the E-utilities for more information about usage policies.
- Throws:
IOException
-
retryNicely
public static <T> SimpleRetryCallable<T,IOException> retryNicely(SimpleRetryCallable<T, IOException> callable, @Nullable String apiKey) Wrap aSimpleRetryCallable
such that it will respect the recommended usage of the Entrez API.- See Also:
-
search
Perform a search on an Entrez database.Results must be subsequently retrieved with
fetch(String, EntrezQuery, EntrezRetmode, String, int, int, String)
orsummary(String, EntrezQuery, EntrezRetmode, int, int, String)
. The query key and WebEnv values must be extracted from the payload. -
search
public static URL search(String db, EntrezQuery query, EntrezRetmode retmode, int retstart, int retmax, @Nullable String apiKey) Replay a previoussearch(String, String, EntrezRetmode, String)
query. -
summary
public static URL summary(String db, EntrezQuery query, EntrezRetmode retmode, int retstart, int retmax, @Nullable String apiKey) Summarize a previoussearch(String, String, EntrezRetmode, String)
query. -
fetchById
public static URL fetchById(String db, String id, EntrezRetmode retmode, String rettype, @Nullable String apiKey) Retrieve a record from an Entrez database by ID. -
fetch
public static URL fetch(String db, EntrezQuery query, EntrezRetmode retmode, String rettype, int retstart, int retmax, @Nullable String apiKey) Retrieve the results of a previoussearch(String, String, EntrezRetmode, String)
query. -
linkById
public static URL linkById(String db, String dbfrom, String id, String cmd, EntrezRetmode retmode, @Nullable String apiKey) Retrieve related records from an Entrez database by ID.- Parameters:
db
- target databasedbfrom
- source database, the ID must come from this databaseid
- the ID to link fromcmd
- the command to use, e.g. "neighbor"
-
link
public static URL link(String db, String dbfrom, EntrezQuery query, String cmd, EntrezRetmode retmode, @Nullable String apiKey) Retrieve related records from an Entrez database from a previoussearch(String, String, EntrezRetmode, String)
query.
-