Class GeoDomainObjectGenerator

java.lang.Object
ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator
All Implemented Interfaces:
SourceDomainObjectGenerator
Direct Known Subclasses:
GeoDomainObjectGeneratorLocal

public class GeoDomainObjectGenerator extends Object implements SourceDomainObjectGenerator
Handle fetching and parsing GEO files.
Author:
pavlidis
  • Field Details

    • log

      protected static final org.apache.commons.logging.Log log
  • Constructor Details

    • GeoDomainObjectGenerator

      public GeoDomainObjectGenerator()
    • GeoDomainObjectGenerator

      protected GeoDomainObjectGenerator(DatasetFetcher datasetFetcher, SeriesFetcher seriesFetcher, Fetcher platformFetcher)
  • Method Details

    • generate

      public Collection<? extends GeoData> generate(String geoAccession)
      Description copied from interface: SourceDomainObjectGenerator
      Combines the necessary data fetching and parsing steps to get a collection of source domain objects.
      Specified by:
      generate in interface SourceDomainObjectGenerator
      Parameters:
      geoAccession - , either a GPL, GDS or GSE value.
      Returns:
      If processPlatformsOnly is true, a collection of GeoPlatforms. Otherwise a Collection of series (just one). If the accession is a GPL then processPlatformsOnly is set to true and any sample data is ignored.
    • getProjectedAccessions

      @Nullable public Collection<DatabaseEntry> getProjectedAccessions(String geoAccession)
      Determine the set of external accession values that will be generated during parsing. This can be used to pre-empty time-consuming fetch and download of data we already have.
      Parameters:
      geoAccession - geo accession
      Returns:
      database entries
    • processDataSet

      public void processDataSet(GeoSeries series, String dataSetAccession, GeoFamilyParser parser)
      Process a data set and add it to the series
    • setNcbiApiKey

      public void setNcbiApiKey(String ncbiApiKey)
      Set the NCBI API key to use.

      This is only used to resolve GEO datasets from series, so it is not critical for the good functioning of this class, but it is preferable to set it.

    • setSeriesFamilySoftFetcher

      public void setSeriesFamilySoftFetcher(GeoFetcher seriesFamilySoftFetcher)
      Wire the resilient (FTP → HTTPS → GEO-generate) series-family SOFT downloader. NCBI has been deprecating anonymous FTP, so relying on the legacy FTP-only fetcher alone fails on files that are still served fine over HTTPS.
    • setMetadataCacheDir

      public void setMetadataCacheDir(@Nullable File metadataCacheDir)
      Override where metadata-only records are cached; defaults to geo.local.datafile.basepath, the directory the family SOFT files already live in.
    • setDoSampleMatching

      public void setDoSampleMatching(boolean doSampleMatching)
    • setProcessPlatformsOnly

      public void setProcessPlatformsOnly(boolean b)
    • generateSeriesMetadataOnly

      public GeoSeries generateSeriesMetadataOnly(String seriesAccession)
      Fetch and parse only the METADATA of a series: its own record plus its sample records, with no data tables and no platform record.

      The family SOFT file that processSeries(String, GeoFamilyParser) downloads embeds the platform table and every sample's data table, which is the whole of its size: GSE1024's is 36 MB on disk, against 60 KB for the two records read here (measured 2026-08-29). Nothing that reads a sourceMetadata document needs either table, so the backfill pays 36 MB per experiment for two fields it uses.

      It is still SOFT, so GeoFamilyParser reads it unchanged; the two responses are parsed into one parser, series first, because the sample records attach to the series the !Series_sample_id lines named. What is NOT done here is everything conversion needs — no GDS lookup, no sample correspondence — because no ExpressionExperiment is built.

      Throws:
      RuntimeException - if GEO answers with no series, which includes the case of an accession that does not exist