Interface ExpressionAnalysisResultSetDao
- All Superinterfaces:
AnalysisResultSetDao<DifferentialExpressionAnalysisResult, ExpressionAnalysisResultSet>, BaseDao<ExpressionAnalysisResultSet>, BaseVoEnabledDao<ExpressionAnalysisResultSet, DifferentialExpressionAnalysisResultSetValueObject>, FilteringDao<ExpressionAnalysisResultSet>, FilteringVoEnabledDao<ExpressionAnalysisResultSet, DifferentialExpressionAnalysisResultSetValueObject>
- All Known Implementing Classes:
ExpressionAnalysisResultSetDaoImpl
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface FilteringDao
FilteringDao.ConjunctSpec -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDelete(DifferentialExpressionAnalysis differentialExpressionAnalysis) longCount the number of results in a given result set.longcountResults(ExpressionAnalysisResultSet ears, double threshold) Count the number of results in a given result set below a given corrected P-value threshold.findByBioAssaySetInAndDatabaseEntryInByCursor(Collection<BioAssaySet> bioAssaySets, Collection<DatabaseEntry> databaseEntries, Filters filters, Cursor cursor, int limit) Cursor-paged counterpart tofindByBioAssaySetInAndDatabaseEntryInLimit(Collection, Collection, Filters, int, int, Sort): keyset pagination over the result sets associated to a set ofBioAssaySetand externaldatabase entries, always sorted by ascendingid.findByBioAssaySetInAndDatabaseEntryInLimit(Collection<BioAssaySet> bioAssaySets, Collection<DatabaseEntry> databaseEntries, Filters filters, int offset, int limit, Sort sort) Retrieve result sets associated to a set ofBioAssaySetand external database entries.Retrieve the baseline for the given result set.getBaselinesForInteractions(Collection<@MayBeUninitialized ExpressionAnalysisResultSet> resultSets, boolean initializeFactorValues) Retrieve baselines for all the given result sets representing factor interactions.getBaselinesForInteractionsByIds(Collection<Long> ids, boolean initializeFactorValues) Retrieve baselines using result set IDs representing factor interactions.getPrefetchForVo(Collection<Long> ids) Batch-fetch theexperimentalFactors+baselineGroupassociations of the given result sets in two queries (one per association, to avoidMultipleBagFetchExceptionand Cartesian explosion on a multi-row join), and return a map keyed by result-set id.Obtain the stored histogram of the P-value distribution for a given result set.loadResultToGenesMap(ExpressionAnalysisResultSet resultSet, boolean queryByResult) Load aDifferentialExpressionAnalysisResulttoGenemulti-map.loadValueObjectWithResults(ExpressionAnalysisResultSet resultSet, boolean includeFactorValuesInContrasts, boolean queryGenesByResult, boolean includeTaxonInGenes) Load an analysis result set with its all of its associated results.Load a result set with its analysis and the analysis' experimentAnalyzed fully initialized, in a single round-trip.Load an analysis result set with its all of its associated results.loadWithResultsAndContrasts(Long id, double threshold, int offset, int limit) Load a slice of an analysis result set with a corrected P-value threshold.loadWithResultsAndContrasts(Long id, int offset, int limit) Load a slice of an analysis result set.voidInitialize the analysis and subset factor vale.voidBatch counterpart tothaw(ExpressionAnalysisResultSet)for a whole page of result sets.Methods inherited from interface BaseDao
countAll, create, create, find, findOrCreate, getElementClass, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, save, save, streamAll, streamAll, update, updateMethods inherited from interface BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIdsMethods inherited from interface FilteringDao
count, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyType, getSort, isFilterablePropertyDeprecated, isFilterablePropertyUsingSubquery, load, load, loadIdsMethods inherited from interface FilteringVoEnabledDao
loadValueObjects, loadValueObjects, loadValueObjectsByCursor
-
Method Details
-
loadWithResultsAndContrasts
Load an analysis result set with its all of its associated results.- Parameters:
id- the ID of the analysis result set- Returns:
- the analysis result set with its associated results, or null if not found
-
loadWithAnalysisAndExperimentAnalyzed
Load a result set with its analysis and the analysis' experimentAnalyzed fully initialized, in a single round-trip. Avoids the sequential lazy-init chain that thaw() does — the dominant cost on the /datasets/{id}/expressions/differential endpoint over a high-latency DB link. -
loadWithResultsAndContrasts
Load a slice of an analysis result set.Results are sorted by ascending correct P-value.
- Parameters:
offset- an offset of results to loadlimit- a limit of results to load, or -1 to load all results starting at offset- See Also:
-
loadWithResultsAndContrasts
@Nullable ExpressionAnalysisResultSet loadWithResultsAndContrasts(Long id, double threshold, int offset, int limit) Load a slice of an analysis result set with a corrected P-value threshold.Important note: when using a threshold, results with null P-values will not be included, thus setting the threshold to
1.0is not equivalent toloadWithResultsAndContrasts(Long, int, int).- Parameters:
threshold- corrected P-value maximum threshold (inclusive)
-
canDelete
-
loadValueObjectWithResults
DifferentialExpressionAnalysisResultSetValueObject loadValueObjectWithResults(ExpressionAnalysisResultSet resultSet, boolean includeFactorValuesInContrasts, boolean queryGenesByResult, boolean includeTaxonInGenes) Load an analysis result set with its all of its associated results.- Parameters:
includeFactorValuesInContrasts- include complete FV in the contrasts, only IDs are displayed if falsequeryGenesByResult- query genes by results instead of result set, this is considerably faster if the results are sliced (i.e. fromloadWithResultsAndContrasts(Long, int, int))includeTaxonInGenes- include complete taxon in the contrasts, only the ID is displayed if false- See Also:
-
loadResultToGenesMap
Map<Long, Set<Gene>> loadResultToGenesMap(ExpressionAnalysisResultSet resultSet, boolean queryByResult) Load aDifferentialExpressionAnalysisResulttoGenemulti-map.This is much faster than navigating through the probe's alignments, transcripts and then genes as it uses the internal GENE2CS table described in
TableMaintenanceUtil.updateGene2CsEntries().Note: Not all probes have associated genes, so you should use
Map.getOrDefault(Object, Object)with an empty collection to handle this case.- Parameters:
queryByResult- query by results instead of result set, this is considerably faster if the results are sliced (i.e. fromloadWithResultsAndContrasts(Long, int, int))
-
findByBioAssaySetInAndDatabaseEntryInLimit
Slice<DifferentialExpressionAnalysisResultSetValueObject> findByBioAssaySetInAndDatabaseEntryInLimit(@Nullable Collection<BioAssaySet> bioAssaySets, @Nullable Collection<DatabaseEntry> databaseEntries, @Nullable Filters filters, int offset, int limit, @Nullable Sort sort) Retrieve result sets associated to a set ofBioAssaySetand external database entries.- Parameters:
bioAssaySets- relatedBioAssaySet, or any if nulldatabaseEntries- related external identifier associated to theBioAssaySet, or any if nullfilters- filters for restricting resultslimit- maximum number of results to returnsort- field and direction by which the collection is ordered
-
findByBioAssaySetInAndDatabaseEntryInByCursor
CursorPage<DifferentialExpressionAnalysisResultSetValueObject> findByBioAssaySetInAndDatabaseEntryInByCursor(@Nullable Collection<BioAssaySet> bioAssaySets, @Nullable Collection<DatabaseEntry> databaseEntries, @Nullable Filters filters, @Nullable Cursor cursor, int limit) Cursor-paged counterpart tofindByBioAssaySetInAndDatabaseEntryInLimit(Collection, Collection, Filters, int, int, Sort): keyset pagination over the result sets associated to a set ofBioAssaySetand externaldatabase entries, always sorted by ascendingid.Single-component
id-asc sort only — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1i (compound sorts deferred pending the indexed-column audit, recce sec. 3.4). Whencursoris non-null the cursor'ssortSpecmust equal"+id"and its key tuple must be a single numeric id.- Parameters:
bioAssaySets- relatedBioAssaySet, or any if nulldatabaseEntries- related external identifier associated to theBioAssaySet, or any if nullfilters- filters for restricting resultscursor- decoded cursor (forward or backward) for keyset pagination, ornullfor the first pagelimit- maximum number of results to return
-
thaw
Initialize the analysis and subset factor vale. -
thawAll
Batch counterpart tothaw(ExpressionAnalysisResultSet)for a whole page of result sets.Initializes the same set of lazy associations as the single-element form (analysis,
analysis.experimentAnalyzed,analysis.subsetFactorValue(+EF),experimentalFactors,baselineGroup(+EF)) but issues a small fixed number of queries across the whole collection instead of 5-7 sequentialHibernate.initializeround-trips per row. Idempotent and safe to call with an empty ornullcollection (no-op). -
countResults
Count the number of results in a given result set. -
countResults
Count the number of results in a given result set below a given corrected P-value threshold. -
getBaseline
Retrieve the baseline for the given result set.Factor values are always initialized.
- Returns:
- a baseline, or null if none could be determined for the given result set
-
getBaselinesForInteractions
Map<@MayBeUninitialized ExpressionAnalysisResultSet, Baseline> getBaselinesForInteractions(Collection<@MayBeUninitialized ExpressionAnalysisResultSet> resultSets, boolean initializeFactorValues) Retrieve baselines for all the given result sets representing factor interactions.- Parameters:
initializeFactorValues- whether to initialize factor values
-
getBaselinesForInteractionsByIds
Map<Long,Baseline> getBaselinesForInteractionsByIds(Collection<Long> ids, boolean initializeFactorValues) Retrieve baselines using result set IDs representing factor interactions.- Parameters:
initializeFactorValues- whether to initialize factor values
-
getPrefetchForVo
Batch-fetch theexperimentalFactors+baselineGroupassociations of the given result sets in two queries (one per association, to avoidMultipleBagFetchExceptionand Cartesian explosion on a multi-row join), and return a map keyed by result-set id.Consumed by the
findByExperimentIdsVO enrichment path so the per-rowDiffExResultSetSummaryValueObjectctor can skip three sequentialHibernate.initializeround-trips on a warm cache.Returns an empty map if
idsis empty. Result-sets missing from the result (e.g. concurrently deleted) are simply absent from the map; the caller should fall back to the lazy-load path for those.- Parameters:
ids- the result-set ids to prefetch- Returns:
- map from result-set id to
DiffExResultSetSummaryValueObject.Prefetch
-
loadPvalueDistribution
Obtain the stored histogram of the P-value distribution for a given result set.Read straight out of the
PVALUE_DISTRIBUTIONrow hanging off the result set; nothing is aggregated.DifferentialExpressionAnalyzerServiceImpl#addPvalueDistributionwrites it at analysis time with 100 fixed-width bins over[0, 1]of the RAW p-values, so binicovers(i/100, (i+1)/100]and bin 0 also holds0.0. There is no stored corrected-p-value histogram.- Returns:
- the stored histogram, or
nullwhenPVALUE_DISTRIBUTION_FKis null
-