Package ubic.gemma.core.loader.entrez
Class EntrezUtils
- java.lang.Object
-
- ubic.gemma.core.loader.entrez.EntrezUtils
-
public class EntrezUtils extends Object
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 Modifier and Type Class Description static interface
EntrezUtils.EntrezCall<T>
-
Constructor Summary
Constructors Constructor Description EntrezUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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
fetchById(String db, String id, EntrezRetmode retmode, String rettype, String apiKey)
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
linkById(String db, String dbfrom, String id, String cmd, EntrezRetmode retmode, String apiKey)
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 Detail
-
ESEARCH
public static final String ESEARCH
- See Also:
- Constant Field Values
-
ESUMMARY
public static final String ESUMMARY
- See Also:
- Constant Field Values
-
EFETCH
public static final String EFETCH
- See Also:
- Constant Field Values
-
ELINK
public static final String ELINK
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:
doNicely(EntrezCall, String)
-
search
public static URL search(String db, String term, EntrezRetmode retmode, @Nullable String apiKey)
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.
-
-