Class ExpressionAnalysisResultSetDaoImpl
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,AnalysisResultSetDao<DifferentialExpressionAnalysisResult,
,ExpressionAnalysisResultSet> ExpressionAnalysisResultSetDao
,BaseDao<ExpressionAnalysisResultSet>
,BaseVoEnabledDao<ExpressionAnalysisResultSet,
,DifferentialExpressionAnalysisResultSetValueObject> FilteringDao<ExpressionAnalysisResultSet>
,FilteringVoEnabledDao<ExpressionAnalysisResultSet,
DifferentialExpressionAnalysisResultSetValueObject>
- Author:
- Paul
-
Nested Class Summary
Nested classes/interfaces inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
AbstractFilteringVoEnabledDao.FilterablePropertiesConfigurer, AbstractFilteringVoEnabledDao.FilterablePropertyMeta
-
Field Summary
Fields inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
REPORT_SLOW_QUERY_AFTER_MS
Fields inherited from class ubic.gemma.persistence.service.AbstractDao
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDelete
(DifferentialExpressionAnalysis differentialExpressionAnalysis) protected void
configureFilterableProperties
(AbstractFilteringVoEnabledDao<ExpressionAnalysisResultSet, DifferentialExpressionAnalysisResultSetValueObject>.FilterablePropertiesConfigurer configurer) Register filterable properties.long
Count the number of results in a given result set.long
countResults
(ExpressionAnalysisResultSet ears, double threshold) Count the number of results in a given result set below a given corrected P-value threshold.create
(ExpressionAnalysisResultSet entity) Create an object.Load a value object for a given entity.findByBioAssaySetInAndDatabaseEntryInLimit
(Collection<BioAssaySet> bioAssaySets, Collection<DatabaseEntry> databaseEntries, Filters filters, int offset, int limit, Sort sort) Retrieve result sets associated to a set ofBioAssaySet
and external database entries.Retrieve the baseline for the given result set.getBaselinesForInteractions
(Collection<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.protected Criteria
getFilteringCriteria
(Filters filters) Obtain aCriteria
for loading VOs.Obtain a histogram of the P-value distribution for a given result set.loadResultToGenesMap
(ExpressionAnalysisResultSet resultSet, boolean queryByResult) Load aDifferentialExpressionAnalysisResult
toGene
multi-map.loadValueObjectWithResults
(ExpressionAnalysisResultSet entity, boolean includeFactorValuesInContrasts, boolean queryGenesByResult, boolean includeTaxonInGenes) Load an analysis result set with its all of its associated results.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.protected void
postProcessValueObjects
(List<DifferentialExpressionAnalysisResultSetValueObject> differentialExpressionAnalysisResultSetValueObjects) Post-process VOs in bulk.void
remove
(ExpressionAnalysisResultSet entity) Remove a persistent instancevoid
Initialize the analysis and subset factor vale.Methods inherited from class ubic.gemma.persistence.service.AbstractCriteriaFilteringVoEnabledDao
afterPropertiesSet, count, getFilterablePropertyMeta, load, load, loadIds, loadValueObjects, loadValueObjects
Methods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledDao
getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyMeta, getFilterablePropertyType, getSort
Methods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledDao
doLoadValueObjects, loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
Methods inherited from class ubic.gemma.persistence.service.AbstractDao
countAll, create, find, findByProperty, findByPropertyIn, findOneByProperty, findOrCreate, getBatchSize, getElementClass, getIdentifierPropertyName, getSessionFactory, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, save, save, streamAll, streamAll, streamQuery, update, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ubic.gemma.persistence.service.BaseDao
countAll, create, find, findOrCreate, getElementClass, getIdentifierPropertyName, load, load, loadAll, loadReference, loadReference, reload, reload, remove, remove, save, save, streamAll, streamAll, update, update
Methods inherited from interface ubic.gemma.persistence.service.BaseVoEnabledDao
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
Methods inherited from interface ubic.gemma.persistence.service.FilteringDao
count, getFilter, getFilter, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyType, getSort, load, load, loadIds
Methods inherited from interface ubic.gemma.persistence.service.FilteringVoEnabledDao
loadValueObjects, loadValueObjects
-
Constructor Details
-
ExpressionAnalysisResultSetDaoImpl
-
-
Method Details
-
create
Description copied from interface:BaseDao
Create an object. If the entity type is immutable, this may also remove any existing entities identified by an appropriate 'find' method.- Specified by:
create
in interfaceBaseDao<ExpressionAnalysisResultSet>
- Overrides:
create
in classAbstractDao<ExpressionAnalysisResultSet>
- Parameters:
entity
- the entity to create- Returns:
- the persistent version of the entity
-
remove
Description copied from interface:BaseDao
Remove a persistent instance- Specified by:
remove
in interfaceBaseDao<ExpressionAnalysisResultSet>
- Overrides:
remove
in classAbstractDao<ExpressionAnalysisResultSet>
- Parameters:
entity
- the entity to be removed
-
loadWithResultsAndContrasts
Description copied from interface:ExpressionAnalysisResultSetDao
Load an analysis result set with its all of its associated results.- Specified by:
loadWithResultsAndContrasts
in interfaceExpressionAnalysisResultSetDao
- Parameters:
id
- the ID of the analysis result set- Returns:
- the analysis result set with its associated results, or null if not found
-
loadWithResultsAndContrasts
Description copied from interface:ExpressionAnalysisResultSetDao
Load a slice of an analysis result set.Results are sorted by ascending correct P-value.
- Specified by:
loadWithResultsAndContrasts
in interfaceExpressionAnalysisResultSetDao
- 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
public ExpressionAnalysisResultSet loadWithResultsAndContrasts(Long id, double threshold, int offset, int limit) Description copied from interface:ExpressionAnalysisResultSetDao
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.0
is not equivalent toExpressionAnalysisResultSetDao.loadWithResultsAndContrasts(Long, int, int)
.- Specified by:
loadWithResultsAndContrasts
in interfaceExpressionAnalysisResultSetDao
- Parameters:
threshold
- corrected P-value maximum threshold (inclusive)
-
canDelete
- Specified by:
canDelete
in interfaceExpressionAnalysisResultSetDao
-
findByBioAssaySetInAndDatabaseEntryInLimit
public Slice<DifferentialExpressionAnalysisResultSetValueObject> findByBioAssaySetInAndDatabaseEntryInLimit(@Nullable Collection<BioAssaySet> bioAssaySets, @Nullable Collection<DatabaseEntry> databaseEntries, @Nullable Filters filters, int offset, int limit, @Nullable Sort sort) Description copied from interface:ExpressionAnalysisResultSetDao
Retrieve result sets associated to a set ofBioAssaySet
and external database entries.- Specified by:
findByBioAssaySetInAndDatabaseEntryInLimit
in interfaceExpressionAnalysisResultSetDao
- 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
-
postProcessValueObjects
protected void postProcessValueObjects(List<DifferentialExpressionAnalysisResultSetValueObject> differentialExpressionAnalysisResultSetValueObjects) Description copied from class:AbstractVoEnabledDao
Post-process VOs in bulk.Use this as an opportunity to load extra informations that could not be populated in the initial
AbstractVoEnabledDao.doLoadValueObject(Identifiable)
orAbstractVoEnabledDao.doLoadValueObjects(Collection)
-
thaw
Description copied from interface:ExpressionAnalysisResultSetDao
Initialize the analysis and subset factor vale.- Specified by:
thaw
in interfaceExpressionAnalysisResultSetDao
-
countResults
Description copied from interface:ExpressionAnalysisResultSetDao
Count the number of results in a given result set.- Specified by:
countResults
in interfaceExpressionAnalysisResultSetDao
-
countResults
Description copied from interface:ExpressionAnalysisResultSetDao
Count the number of results in a given result set below a given corrected P-value threshold.- Specified by:
countResults
in interfaceExpressionAnalysisResultSetDao
-
getBaseline
Description copied from interface:ExpressionAnalysisResultSetDao
Retrieve the baseline for the given result set.Factor values are always initialized.
- Specified by:
getBaseline
in interfaceExpressionAnalysisResultSetDao
- Returns:
- a baseline, or null if none could be determined for the given result set
-
getBaselinesForInteractions
public Map<ExpressionAnalysisResultSet,Baseline> getBaselinesForInteractions(Collection<ExpressionAnalysisResultSet> resultSets, boolean initializeFactorValues) Description copied from interface:ExpressionAnalysisResultSetDao
Retrieve baselines for all the given result sets representing factor interactions.- Specified by:
getBaselinesForInteractions
in interfaceExpressionAnalysisResultSetDao
- Parameters:
initializeFactorValues
- whether to initialize factor values
-
getBaselinesForInteractionsByIds
public Map<Long,Baseline> getBaselinesForInteractionsByIds(Collection<Long> ids, boolean initializeFactorValues) Description copied from interface:ExpressionAnalysisResultSetDao
Retrieve baselines using result set IDs representing factor interactions.- Specified by:
getBaselinesForInteractionsByIds
in interfaceExpressionAnalysisResultSetDao
- Parameters:
initializeFactorValues
- whether to initialize factor values
-
loadPvalueDistribution
Description copied from interface:ExpressionAnalysisResultSetDao
Obtain a histogram of the P-value distribution for a given result set.- Specified by:
loadPvalueDistribution
in interfaceExpressionAnalysisResultSetDao
-
getFilteringCriteria
Description copied from class:AbstractCriteriaFilteringVoEnabledDao
Obtain aCriteria
for loading VOs.- Overrides:
getFilteringCriteria
in classAbstractCriteriaFilteringVoEnabledDao<ExpressionAnalysisResultSet,
DifferentialExpressionAnalysisResultSetValueObject> - See Also:
-
configureFilterableProperties
protected void configureFilterableProperties(AbstractFilteringVoEnabledDao<ExpressionAnalysisResultSet, DifferentialExpressionAnalysisResultSetValueObject>.FilterablePropertiesConfigurer configurer) Description copied from class:AbstractFilteringVoEnabledDao
Register filterable properties. -
doLoadValueObject
protected DifferentialExpressionAnalysisResultSetValueObject doLoadValueObject(ExpressionAnalysisResultSet entity) Description copied from class:AbstractVoEnabledDao
Load a value object for a given entity.This should be fast and efficient, and avoid any database query or post-processing. If you need to perform additional queries, implement
AbstractVoEnabledDao.postProcessValueObjects(List)
instead. -
loadValueObjectWithResults
public DifferentialExpressionAnalysisResultSetValueObject loadValueObjectWithResults(ExpressionAnalysisResultSet entity, boolean includeFactorValuesInContrasts, boolean queryGenesByResult, boolean includeTaxonInGenes) Description copied from interface:ExpressionAnalysisResultSetDao
Load an analysis result set with its all of its associated results.- Specified by:
loadValueObjectWithResults
in interfaceExpressionAnalysisResultSetDao
- 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. fromExpressionAnalysisResultSetDao.loadWithResultsAndContrasts(Long, int, int)
)includeTaxonInGenes
- include complete taxon in the contrasts, only the ID is displayed if false- See Also:
-
loadResultToGenesMap
public Map<Long,Set<Gene>> loadResultToGenesMap(ExpressionAnalysisResultSet resultSet, boolean queryByResult) Description copied from interface:ExpressionAnalysisResultSetDao
Load aDifferentialExpressionAnalysisResult
toGene
multi-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.- Specified by:
loadResultToGenesMap
in interfaceExpressionAnalysisResultSetDao
- Parameters:
queryByResult
- query by results instead of result set, this is considerably faster if the results are sliced (i.e. fromExpressionAnalysisResultSetDao.loadWithResultsAndContrasts(Long, int, int)
)
-