Class GeoBrowserImpl
- java.lang.Object
-
- ubic.gemma.core.loader.expression.geo.service.GeoBrowserImpl
-
- All Implemented Interfaces:
GeoBrowser
public class GeoBrowserImpl extends Object implements GeoBrowser
-
-
Constructor Summary
Constructors Constructor Description GeoBrowserImpl(String ncbiApiKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<GeoRecord>
getAllGeoRecords(GeoRecordType recordType, Collection<String> allowedTaxa, int limit)
Retrieve all GEO records of a given type.GeoRecord
getGeoRecord(GeoRecordType recordType, String accession, GeoRetrieveConfig config)
Retrieve a single GEO record.Collection<GeoRecord>
getGeoRecords(GeoRecordType recordType, Collection<String> accessions, GeoRetrieveConfig config)
Retrieve records for experimentsSlice<GeoRecord>
getRecentGeoRecords(GeoRecordType recordType, int start, int pageSize)
Retrieve recent GEO records from GEO browser.Collection<GeoRecord>
retrieveAllGeoRecords(GeoQuery query, GeoRetrieveConfig config)
Slice<GeoRecord>
retrieveGeoRecords(GeoQuery query, int start, int pageSize, GeoRetrieveConfig config)
Retrieve records from a GEO query.GeoQuery
searchGeoRecords(GeoRecordType recordType, String term)
Search GEO records.GeoQuery
searchGeoRecords(GeoRecordType recordType, String searchTerms, GeoSearchField field, Collection<String> allowedTaxa, Collection<String> limitPlatforms, Collection<GeoSeriesType> seriesTypes)
Search GEO records.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.loader.expression.geo.service.GeoBrowser
getGeoRecord, getGeoRecords, retrieveGeoRecords, searchAndRetrieveGeoRecords
-
-
-
-
Constructor Detail
-
GeoBrowserImpl
public GeoBrowserImpl(String ncbiApiKey)
-
-
Method Detail
-
getGeoRecord
@Nullable public GeoRecord getGeoRecord(GeoRecordType recordType, String accession, GeoRetrieveConfig config) throws IOException
Description copied from interface:GeoBrowser
Retrieve a single GEO record.- Specified by:
getGeoRecord
in interfaceGeoBrowser
- Throws:
IOException
-
getGeoRecords
public Collection<GeoRecord> getGeoRecords(GeoRecordType recordType, Collection<String> accessions, GeoRetrieveConfig config) throws IOException
Retrieve records for experiments- Specified by:
getGeoRecords
in interfaceGeoBrowser
- Parameters:
accessions
- of experiments- Returns:
- collection of records
- Throws:
IOException
-
getAllGeoRecords
public Collection<GeoRecord> getAllGeoRecords(GeoRecordType recordType, @Nullable Collection<String> allowedTaxa, int limit) throws IOException
Description copied from interface:GeoBrowser
Retrieve all GEO records of a given type.A bit hacky, can be improved. Limited to human, mouse, rat, is not guaranteed to get everything, though as of 7/2021, this is sufficient (~8000 platforms)
- Specified by:
getAllGeoRecords
in interfaceGeoBrowser
allowedTaxa
- a collection of allowed taxa, ignored if null or empty- Returns:
- all relevant platforms up to single-query limit of NCBI
- Throws:
IOException
-
getRecentGeoRecords
public Slice<GeoRecord> getRecentGeoRecords(GeoRecordType recordType, int start, int pageSize) throws IOException
Description copied from interface:GeoBrowser
Retrieve recent GEO records from GEO browser.The retrieved information is pretty minimal. Use
GeoBrowser.searchGeoRecords(GeoRecordType, String, GeoSearchField, Collection, Collection, Collection)
for detailed records.- Specified by:
getRecentGeoRecords
in interfaceGeoBrowser
start
- start pagepageSize
- page size- Returns:
- a slice of GEO records
- Throws:
IOException
-
searchGeoRecords
public GeoQuery searchGeoRecords(GeoRecordType recordType, @Nullable String searchTerms, @Nullable GeoSearchField field, @Nullable Collection<String> allowedTaxa, @Nullable Collection<String> limitPlatforms, @Nullable Collection<GeoSeriesType> seriesTypes) throws IOException
Description copied from interface:GeoBrowser
Search GEO records.Provides more details than
GeoBrowser.getRecentGeoRecords(GeoRecordType, int, int)
. Performs an E-utilities query of the GEO database with the given search terms (search terms can be omitted). Returns at most pageSize records.Note that the search is reversed in time. You get the most recent records first.
- Specified by:
searchGeoRecords
in interfaceGeoBrowser
- Parameters:
recordType
- the type of record to search forsearchTerms
- search term, ignored if null or blankfield
- a field to search in or null to search everywhereallowedTaxa
- restrict search to the given taxa if not nulllimitPlatforms
- restrict search to the given platforms if not nullseriesTypes
- restrict search to the given series types if not null (i.e. Expression profiling by array)- Returns:
- a GEO query that can be retrieved with
GeoBrowser.retrieveGeoRecords(GeoQuery, int, int, GeoRetrieveConfig)
- Throws:
IOException
- if there is a problem obtaining or manipulating the file (some exceptions are not thrown and just logged)
-
searchGeoRecords
public GeoQuery searchGeoRecords(GeoRecordType recordType, String term) throws IOException
Description copied from interface:GeoBrowser
Search GEO records.- Specified by:
searchGeoRecords
in interfaceGeoBrowser
- Throws:
IOException
-
retrieveGeoRecords
public Slice<GeoRecord> retrieveGeoRecords(GeoQuery query, int start, int pageSize, GeoRetrieveConfig config) throws IOException
Description copied from interface:GeoBrowser
Retrieve records from a GEO query.- Specified by:
retrieveGeoRecords
in interfaceGeoBrowser
start
- start at an offset to retrieve batchespageSize
- number of results to retrieve in a batchconfig
- configuration for populating the records- Throws:
IOException
-
retrieveAllGeoRecords
public Collection<GeoRecord> retrieveAllGeoRecords(GeoQuery query, GeoRetrieveConfig config) throws IOException
- Specified by:
retrieveAllGeoRecords
in interfaceGeoBrowser
- Throws:
IOException
-
-