Interface TableMaintenanceUtil

All Known Implementing Classes:
TableMaintenanceUtilImpl

public interface TableMaintenanceUtil
Author:
paul
  • Field Details

    • GENE2CS_QUERY_SPACE

      static final String GENE2CS_QUERY_SPACE
      Query space used by the GENE2CS table.

      You may also want to synchronize to ArrayDesign, CompositeSequence and Gene since entries in the GENE2CS table are removed in cascade.

      See Also:
    • GENE2CS_BATCH_SIZE

      static final int GENE2CS_BATCH_SIZE
      Recommended batch size to use when retrieving entries from the GENE2CS table either by gene or design element.
      See Also:
    • EE2C_QUERY_SPACE

      static final String EE2C_QUERY_SPACE
      Query space used by the EXPRESSION_EXPERIMENT2CHARACTERISTIC table.

      You may also want to synchronize to ExpressionExperiment and Characteristic since entries in the EE2C table are removed in cascade.

      See Also:
    • EE2AD_QUERY_SPACE

      static final String EE2AD_QUERY_SPACE
      Query space used by the EXPRESSION_EXPERIMENT2ARRAY_DESIGN table.

      You may also want to synchronize to ExpressionExperiment and ArrayDesign since entries in the EE2AD table are removed in cascade.

      See Also:
  • Method Details

    • updateGene2CsEntries

      @Secured("GROUP_AGENT") int updateGene2CsEntries()
      If necessary, update the GENE2CS table.
    • updateGene2CsEntries

      @Secured("GROUP_AGENT") int updateGene2CsEntries(ArrayDesign arrayDesign, boolean force)
      Update the GENE2CS table for a specific ArrayDesign.
      Parameters:
      arrayDesign - the platform for which to update the GENE2CS entries
      force - update the table even if no platforms has been modified since the last update
    • updateGene2CsEntries

      @Secured("GROUP_AGENT") int updateGene2CsEntries(@Nullable Date sinceLastUpdate, boolean truncate, boolean force)
      Update the GENE2CS table.
      Parameters:
      sinceLastUpdate - if not null, only update entries whose corresponding ArrayDesign hsa been updated after the given date
      truncate - if true, the GENE2CS table will be truncated before the update
      force - update the table even if no platforms has been modified since the last update
    • updateExpressionExperiment2CharacteristicEntries

      @Secured("GROUP_AGENT") int updateExpressionExperiment2CharacteristicEntries(@Nullable Date sinceLastUpdate, boolean truncate)
      Update the EXPRESSION_EXPERIMENT2CHARACTERISTIC table.
      Returns:
      the number of records that were created or updated
    • updateExpressionExperiment2CharacteristicEntries

      @Secured("GROUP_AGENT") int updateExpressionExperiment2CharacteristicEntries(Class<?> level, @Nullable Date sinceLastUpdate, boolean truncate)
      Update a specific level of the EXPRESSION_EXPERIMENT2CHARACTERISTIC table.
      Parameters:
      level - the level to update which is either ExpressionExperiment, BioMaterial or ExperimentalDesign
      Returns:
      the number of records that were created or updated
    • updateExpressionExperiment2CharacteristicEntries

      @Secured("GROUP_AGENT") int updateExpressionExperiment2CharacteristicEntries(ExpressionExperiment ee, @Nullable Class<?> level)
      Update the EXPRESSION_EXPERIMENT2CHARACTERISTIC table for a specific experiment.
    • updateExpressionExperiment2ArrayDesignEntries

      @Secured("GROUP_AGENT") int updateExpressionExperiment2ArrayDesignEntries(@Nullable Date sinceLastUpdate, boolean truncate)
      Update the EXPRESSION_EXPERIMENT2_ARRAY_DESIGN table.
      Parameters:
      sinceLastUpdate - only update entries for platforms updated since this date
      truncate - if true, the table will be truncated before the update
      Returns:
      the number of records that were created or updated
    • updateExpressionExperiment2ArrayDesignEntries

      @Secured("GROUP_AGENT") int updateExpressionExperiment2ArrayDesignEntries(ExpressionExperiment ee)
    • updateAnnotationRelationEntries

      @Secured("GROUP_AGENT") int updateAnnotationRelationEntries(@Nullable ExpressionExperiment ee)
      Rebuild the ANNOTATION_RELATION rows a curator already wrote.

      This is a harvest, not an inference. A curator writing disease model: autism spectrum disorder - has_genotype -> Mef2c put a subject, a predicate and an object into CHARACTERISTIC, and 10,040 datasets carry such a statement. The knowledge has always been there; what has never existed is an index that can be read from the object end, so "which genotypes are asserted against this disease?" has no query. Copying those triples into a table keyed both ways is the whole operation.

      Read from EXPRESSION_EXPERIMENT2CHARACTERISTIC rather than CHARACTERISTIC because EE2C has already done the work of resolving every annotation to its experiment, at every level, with the anonymous ACL mask alongside. Harvesting from the normalized table would mean re-deriving all of that and getting a second, divergent copy of it.

      Deletes the basis before inserting rather than upserting - see AnnotationRelation.

      Parameters:
      ee - restrict to one experiment, or null for the whole corpus
      Returns:
      how many relation rows were written
    • updateOntologyRelationEntries

      @Secured("GROUP_AGENT") int updateOntologyRelationEntries(@Nullable Collection<String> sources)
      Rebuild the ANNOTATION_RELATION rows a loaded ontology asserts.

      Sibling of updateAnnotationRelationEntries(ExpressionExperiment) and deliberately a separate entry point, because the two read from different places and cannot be ordered against each other. The curated harvest reads EXPRESSION_EXPERIMENT2CHARACTERISTIC and belongs beside the EE2C rebuild; this one reads the Jena models and needs CLO, CHEBI and MONDO loaded, which is minutes of warm-up an experiment-driven job has no business waiting on.

      🛑 An ontology that is not loaded leaves its rows alone rather than deleting them. Rebuilding from an empty model would be indistinguishable from the ontology having retracted every axiom it ever stated.

      Parameters:
      sources - source names to rebuild (CLO, CHEBI), or null/empty for all of them; the delete is narrowed the same way, so a partial run does not drop the rest
      Returns:
      how many relation rows were written
    • updateExternalRelationEntries

      @Secured("GROUP_AGENT") int updateExternalRelationEntries()
      Rebuild the AnnotationRelationBasis.EXTERNAL rows that MGI's genotype-to-disease reports assert — and the ones they deny.

      A third entry point rather than a flag on the other two, for the reason they are separate from each other: this reads two files off MGI's download server and needs MONDO loaded to translate their DOIDs, which is a different set of prerequisites again from the curated harvest (EE2C) and the ontology pass (Jena models).

      🛑 The delete is scoped to SOURCE = 'MGI'. Other EXTERNAL sources are somebody else's rows and a run here must not touch them.

      Returns:
      how many relation rows were written
    • evictAnnotationRelationQueryCache

      @Secured("GROUP_ADMIN") void evictAnnotationRelationQueryCache()
      Evict the query cache for the ANNOTATION_RELATION table.
    • evictGene2CsQueryCache

      @Secured("GROUP_ADMIN") void evictGene2CsQueryCache()
      Evict the query cache for the GENE2CS table.
    • evictEe2CQueryCache

      @Secured("GROUP_ADMIN") void evictEe2CQueryCache()
      Evict the query cache for the EXPRESSION_EXPERIMENT2CHARACTERISTIC table.
    • evictEe2AdQueryCache

      @Secured("GROUP_ADMIN") void evictEe2AdQueryCache()
      Evict the query cache for the EXPRESSION_EXPERIMENT2_ARRAY_DESIGN table.
    • disableEmail

      @Secured("GROUP_ADMIN") void disableEmail()