Class HomeStats

java.lang.Object
ubic.gemma.core.analysis.report.HomeStats

public class HomeStats extends Object
Cached snapshot of public-home-page statistics. Recomputed daily by HomeStatsRefresher from an anonymous-user perspective and served as-is by GET /stats/home on the REST API.

Computing these on every request is too expensive — see legacy WhatsNew for the precedent (file-cached weekly report read at every page load).

  • Constructor Details

    • HomeStats

      public HomeStats()
  • Method Details

    • getGeneratedAt

      public Date getGeneratedAt()
      When the snapshot was last refreshed (ISO-8601 in JSON via default Jackson).
    • getDatasetCount

      public long getDatasetCount()
      Total public expression experiments.
    • getPlatformCount

      public long getPlatformCount()
      Total public platforms (array designs).
    • getDistinctAccessionCount

      public long getDistinctAccessionCount()
      Distinct external accessions across all public EEs. <= datasetCount — the difference is the EEs split off a parent submission ("1 GSE → 2 Gemma EEs"). Drives the Datasets-tile sub-line "from N distinct accessions".
    • getSampleCount

      public long getSampleCount()
      Total distinct biomaterials across all public experiments.
    • getGeneCount

      public long getGeneCount()
      Number of distinct genes in the database. Computed once per refresh; cheap.
    • getByTaxon

      public List<HomeStats.TaxonStat> getByTaxon()
      Per-taxon dataset counts, sorted descending by count.
    • getDatasetsByAccessionSource

      public List<HomeStats.AccessionSourceStat> getDatasetsByAccessionSource()
      Per-external-database dataset counts — GEO, ArrayExpress, CELLxGENE, etc., plus a "none" bucket for datasets without an external accession (direct lab submissions / Gemma-native). Sorted descending by count.
    • getByPlatformType

      public Map<String,Long> getByPlatformType()
      Per-platform-technology-type dataset counts. Keys are TechnologyType enum names (ONECOLOR / TWOCOLOR / DUALMODE / SEQUENCING / GENELIST / OTHER). Frontend rolls these up into microarray (ONECOLOR+TWOCOLOR+DUALMODE) and RNA-seq (SEQUENCING+GENELIST) buckets.
    • getSingleCellCount

      public long getSingleCellCount()
      Number of public experiments that have at least one single-cell dimension recorded (orthogonal to platform-technology type — a single-cell experiment usually rides on a GENELIST platform).
    • getDeaResultSetCount

      public long getDeaResultSetCount()
      Total distinct differential-expression analysis result sets across public datasets. A DEA result set is the per-contrast unit of analysis output (e.g. "diseased vs control on factor 'disease state'"), so this number reflects the size of Gemma's DEA library — the corpus of comparisons callers can query / re-use.
    • getDrugCount

      public long getDrugCount()
      Distinct CHEBI-anchored drug / chemical annotations in use (characteristics whose valueUri starts with http://purl.obolibrary.org/obo/CHEBI_). Narrower than byAnnotationCategory.treatment — that bucket includes non-drug treatments like radiation exposure or behavioural interventions.
    • getGeneManipulatedCount

      public long getGeneManipulatedCount()
      Distinct genes annotated as manipulation targets across the corpus — characteristics whose valueUri starts with Gene.NCBI_URI_PREFIX AND whose own categoryUri is genotype. Reflects how many distinct genes Gemma has perturbation data for (knockouts, knockdowns, overexpression, etc.).

      The category is enforced on the SAME characteristic, not on the experiment. Until 2026-08-21 it was not enforced at all and the field counted a gene URI in any category, which swept in cytokines and growth factors administered under treatment.

    • getGeneManipulatedExperimentCount

      public long getGeneManipulatedExperimentCount()
      Companion to geneManipulatedCount: number of distinct experiments carrying at least one genotype-category gene-URI annotation. geneManipulatedCount counts the genes; this counts how many experiments perturbed any gene at all.
    • getTotalCells

      public long getTotalCells()
      Total individual cells measured across all single-cell experiments — sum of BioAssay.numberOfCells for assays attached to EEs with a SingleCellDimension. Typically reported in millions on the home page.
    • getSamplesByTech

      public Map<String,Long> getSamplesByTech()
      Sample (biomaterial) counts broken down by technology bucket — companion to sampleCount. Keys are stable lowercase-snake-case labels: single_cell, rna_seq (bulk RNA-seq only, single-cell excluded), microarray. Counts distinct ba.sampleUsed biomaterials per bucket, not cells / sub-biomaterials.
    • getFactorValuesByCategory

      public List<HomeStats.FactorValueCategoryStat> getFactorValuesByCategory()
      Distinct factor-value count per ExperimentalFactor category. Reflects the range of experimental conditions Gemma has measured along each axis (e.g. how many distinct disease-state factor values exist across the corpus, how many genotypes, how many treatments). Keys are the canonical category labels carried on ExperimentalFactor.category; sorted descending by value.
    • getTreatmentSubcategories

      public List<HomeStats.TreatmentBucketStat> getTreatmentSubcategories()
      Treatment-category terms broken down by bucket (see treatment-buckets.json): approved_drug, hormone, vitamin, toxin, vehicle, biologic (PR / NCBI Gene), pathogen (NCBITaxon), control, plus the other_chemical catchall (unbucketed CHEBI) and other catchall (non-CHEBI). Counts are EE-mention sums (Σ numberOfExpressionExperiments over each bucket's matched terms), not distinct-URI counts — a single popular drug used in 40 datasets contributes 40, not 1. Sorted descending by count.
    • getTopPerturbedGenes

      public List<HomeStats.PerturbedGeneStat> getTopPerturbedGenes()
      Per-gene ranking of how many public EEs carry that gene as a perturbation-target annotation — a gene URI whose own category is genotype. Top 25, sorted descending by numberOfExpressionExperiments. Drives the home-page middle-column bar chart of most-studied perturbed genes.

      Scoped to genotype since 2026-08-21. Before that it counted the gene URI in any category, so genes that are both perturbation targets and administered agents read high for the wrong reason — TNF 72 against 39 real perturbations, TGFB1 62 against 31 — and four cytokines held top-10 places that belong to Sox2, Mecp2, Pten and Apoe.

    • getOntologyTermCount

      public long getOntologyTermCount()
      Total distinct ontology-backed annotation terms in use across all public datasets. Free-text characteristics (no valueUri) are excluded — same semantics as GET /datasets/annotations/count?excludeFreeText=true.
    • getByAnnotationCategory

      public Map<String,Long> getByAnnotationCategory()
      Per-category distinct-term counts. Keys are stable lowercase-snake-case strings: disease, organism_part, cell_type, treatment, strain, cell_line. Each value is the count of distinct ontology-backed terms in that category (free-text excluded). The treatment bucket carries the drug-annotation count.
    • getCategoryDistribution

      public List<HomeStats.CategoryStat> getCategoryDistribution()
      Distribution of annotation categories observed across public datasets — the top-N categories Gemma actually uses, with the number of experiments each appears on. Reflects the range of experimental conditions / annotation dimensions represented in the corpus. Sorted descending by numberOfExpressionExperiments.
    • getRecentExperiments

      public List<HomeStats.RecentExperiment> getRecentExperiments()
      Most-recently curated public experiments, for the scrolling-names widget.
    • getDatasetsAdded

      public List<HomeStats.AddedInWindow> getDatasetsAdded()
      How many public experiments were added to Gemma over each of several trailing windows, newest window first. "Added" is the action='C' audit row — when the dataset was first loaded — NOT when it was made public; see WhatsNewService for why the publication date is not reportable.

      Several windows ship together because loading runs in bursts, so the useful window is not fixed: on 2026-08-21 the trailing 7-, 30- and 90-day counts were all 0 (the most recent load was 2026-05-12) while the 365-day count was 1,195. A caller that renders a "recently added" figure should pick the shortest window whose count is non-zero and label it with that window's HomeStats.AddedInWindow.since, rather than hard-coding "this week" and rendering a permanent zero.

    • setGeneratedAt

      public void setGeneratedAt(Date generatedAt)
      When the snapshot was last refreshed (ISO-8601 in JSON via default Jackson).
    • setDatasetCount

      public void setDatasetCount(long datasetCount)
      Total public expression experiments.
    • setPlatformCount

      public void setPlatformCount(long platformCount)
      Total public platforms (array designs).
    • setDistinctAccessionCount

      public void setDistinctAccessionCount(long distinctAccessionCount)
      Distinct external accessions across all public EEs. <= datasetCount — the difference is the EEs split off a parent submission ("1 GSE → 2 Gemma EEs"). Drives the Datasets-tile sub-line "from N distinct accessions".
    • setSampleCount

      public void setSampleCount(long sampleCount)
      Total distinct biomaterials across all public experiments.
    • setGeneCount

      public void setGeneCount(long geneCount)
      Number of distinct genes in the database. Computed once per refresh; cheap.
    • setByTaxon

      public void setByTaxon(List<HomeStats.TaxonStat> byTaxon)
      Per-taxon dataset counts, sorted descending by count.
    • setDatasetsByAccessionSource

      public void setDatasetsByAccessionSource(List<HomeStats.AccessionSourceStat> datasetsByAccessionSource)
      Per-external-database dataset counts — GEO, ArrayExpress, CELLxGENE, etc., plus a "none" bucket for datasets without an external accession (direct lab submissions / Gemma-native). Sorted descending by count.
    • setByPlatformType

      public void setByPlatformType(Map<String,Long> byPlatformType)
      Per-platform-technology-type dataset counts. Keys are TechnologyType enum names (ONECOLOR / TWOCOLOR / DUALMODE / SEQUENCING / GENELIST / OTHER). Frontend rolls these up into microarray (ONECOLOR+TWOCOLOR+DUALMODE) and RNA-seq (SEQUENCING+GENELIST) buckets.
    • setSingleCellCount

      public void setSingleCellCount(long singleCellCount)
      Number of public experiments that have at least one single-cell dimension recorded (orthogonal to platform-technology type — a single-cell experiment usually rides on a GENELIST platform).
    • setDeaResultSetCount

      public void setDeaResultSetCount(long deaResultSetCount)
      Total distinct differential-expression analysis result sets across public datasets. A DEA result set is the per-contrast unit of analysis output (e.g. "diseased vs control on factor 'disease state'"), so this number reflects the size of Gemma's DEA library — the corpus of comparisons callers can query / re-use.
    • setDrugCount

      public void setDrugCount(long drugCount)
      Distinct CHEBI-anchored drug / chemical annotations in use (characteristics whose valueUri starts with http://purl.obolibrary.org/obo/CHEBI_). Narrower than byAnnotationCategory.treatment — that bucket includes non-drug treatments like radiation exposure or behavioural interventions.
    • setGeneManipulatedCount

      public void setGeneManipulatedCount(long geneManipulatedCount)
      Distinct genes annotated as manipulation targets across the corpus — characteristics whose valueUri starts with Gene.NCBI_URI_PREFIX AND whose own categoryUri is genotype. Reflects how many distinct genes Gemma has perturbation data for (knockouts, knockdowns, overexpression, etc.).

      The category is enforced on the SAME characteristic, not on the experiment. Until 2026-08-21 it was not enforced at all and the field counted a gene URI in any category, which swept in cytokines and growth factors administered under treatment.

    • setGeneManipulatedExperimentCount

      public void setGeneManipulatedExperimentCount(long geneManipulatedExperimentCount)
      Companion to geneManipulatedCount: number of distinct experiments carrying at least one genotype-category gene-URI annotation. geneManipulatedCount counts the genes; this counts how many experiments perturbed any gene at all.
    • setTotalCells

      public void setTotalCells(long totalCells)
      Total individual cells measured across all single-cell experiments — sum of BioAssay.numberOfCells for assays attached to EEs with a SingleCellDimension. Typically reported in millions on the home page.
    • setSamplesByTech

      public void setSamplesByTech(Map<String,Long> samplesByTech)
      Sample (biomaterial) counts broken down by technology bucket — companion to sampleCount. Keys are stable lowercase-snake-case labels: single_cell, rna_seq (bulk RNA-seq only, single-cell excluded), microarray. Counts distinct ba.sampleUsed biomaterials per bucket, not cells / sub-biomaterials.
    • setFactorValuesByCategory

      public void setFactorValuesByCategory(List<HomeStats.FactorValueCategoryStat> factorValuesByCategory)
      Distinct factor-value count per ExperimentalFactor category. Reflects the range of experimental conditions Gemma has measured along each axis (e.g. how many distinct disease-state factor values exist across the corpus, how many genotypes, how many treatments). Keys are the canonical category labels carried on ExperimentalFactor.category; sorted descending by value.
    • setTreatmentSubcategories

      public void setTreatmentSubcategories(List<HomeStats.TreatmentBucketStat> treatmentSubcategories)
      Treatment-category terms broken down by bucket (see treatment-buckets.json): approved_drug, hormone, vitamin, toxin, vehicle, biologic (PR / NCBI Gene), pathogen (NCBITaxon), control, plus the other_chemical catchall (unbucketed CHEBI) and other catchall (non-CHEBI). Counts are EE-mention sums (Σ numberOfExpressionExperiments over each bucket's matched terms), not distinct-URI counts — a single popular drug used in 40 datasets contributes 40, not 1. Sorted descending by count.
    • setTopPerturbedGenes

      public void setTopPerturbedGenes(List<HomeStats.PerturbedGeneStat> topPerturbedGenes)
      Per-gene ranking of how many public EEs carry that gene as a perturbation-target annotation — a gene URI whose own category is genotype. Top 25, sorted descending by numberOfExpressionExperiments. Drives the home-page middle-column bar chart of most-studied perturbed genes.

      Scoped to genotype since 2026-08-21. Before that it counted the gene URI in any category, so genes that are both perturbation targets and administered agents read high for the wrong reason — TNF 72 against 39 real perturbations, TGFB1 62 against 31 — and four cytokines held top-10 places that belong to Sox2, Mecp2, Pten and Apoe.

    • setOntologyTermCount

      public void setOntologyTermCount(long ontologyTermCount)
      Total distinct ontology-backed annotation terms in use across all public datasets. Free-text characteristics (no valueUri) are excluded — same semantics as GET /datasets/annotations/count?excludeFreeText=true.
    • setByAnnotationCategory

      public void setByAnnotationCategory(Map<String,Long> byAnnotationCategory)
      Per-category distinct-term counts. Keys are stable lowercase-snake-case strings: disease, organism_part, cell_type, treatment, strain, cell_line. Each value is the count of distinct ontology-backed terms in that category (free-text excluded). The treatment bucket carries the drug-annotation count.
    • setCategoryDistribution

      public void setCategoryDistribution(List<HomeStats.CategoryStat> categoryDistribution)
      Distribution of annotation categories observed across public datasets — the top-N categories Gemma actually uses, with the number of experiments each appears on. Reflects the range of experimental conditions / annotation dimensions represented in the corpus. Sorted descending by numberOfExpressionExperiments.
    • setRecentExperiments

      public void setRecentExperiments(List<HomeStats.RecentExperiment> recentExperiments)
      Most-recently curated public experiments, for the scrolling-names widget.
    • setDatasetsAdded

      public void setDatasetsAdded(List<HomeStats.AddedInWindow> datasetsAdded)
      How many public experiments were added to Gemma over each of several trailing windows, newest window first. "Added" is the action='C' audit row — when the dataset was first loaded — NOT when it was made public; see WhatsNewService for why the publication date is not reportable.

      Several windows ship together because loading runs in bursts, so the useful window is not fixed: on 2026-08-21 the trailing 7-, 30- and 90-day counts were all 0 (the most recent load was 2026-05-12) while the 365-day count was 1,195. A caller that renders a "recently added" figure should pick the shortest window whose count is non-zero and label it with that window's HomeStats.AddedInWindow.since, rather than hard-coding "this week" and rendering a permanent zero.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object