Class ProcessedExpressionDataVectorServiceImpl
java.lang.Object
ubic.gemma.persistence.service.AbstractService<ProcessedExpressionDataVector>
ubic.gemma.persistence.service.expression.bioAssayData.AbstractBulkExpressionDataVectorService<ProcessedExpressionDataVector>
ubic.gemma.persistence.service.expression.bioAssayData.ProcessedExpressionDataVectorServiceImpl
- All Implemented Interfaces:
BaseImmutableService<ProcessedExpressionDataVector>, BaseReadOnlyService<ProcessedExpressionDataVector>, BaseService<ProcessedExpressionDataVector>, BulkExpressionDataVectorService<ProcessedExpressionDataVector>, ProcessedExpressionDataVectorService
@Service
public class ProcessedExpressionDataVectorServiceImpl
extends AbstractBulkExpressionDataVectorService<ProcessedExpressionDataVector>
implements ProcessedExpressionDataVectorService
- Author:
- Paul
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptioncomputeUnmaskedProcessedDataMatrix(ExpressionExperiment expressionExperiment, boolean ignoreQuantitationMismatch) 🛑Propagation.NEVER, for the same reason ascreateProcessedDataVectors(ExpressionExperiment, boolean): the normalization between the read and the assembly is where the 44 minutes go, and nothing in it needs a connection.createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks) Create processed vectors and optionally update ranks.createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks, boolean ignoreQuantitationMismatch) 🛑Propagation.NEVER: the quantile normalization in the middle of this takes 44 minutes on a large experiment (GSE260875, measured 2026-09-17) and the connection handling mode isDELAYED_ACQUISITION_AND_HOLD, so a transaction around the whole thing pins a pooled connection for the duration without issuing a statement — against a pool that recycles at 30 minutes.voidfind(Collection<CompositeSequence> designElements, QuantitationType quantitationType) Retrieve the processed vectors for a set of design elements within a given (processed) quantitation type.getDiffExVectors(Long resultSetId, double threshold, int maxNumberOfResults) getExpressionLevels(Collection<ExpressionExperiment> ees, Collection<Gene> genes, boolean keepGeneNonSpecific, String consolidateMode) getExpressionLevelsByIds(Collection<Long> eeIds, Collection<Gene> genes, boolean keepGeneNonSpecific, String consolidateMode) Retrieve expression levels by dataset IDs.getExpressionLevelsDiffEx(Collection<ExpressionExperiment> ees, Long diffExResultSetId, double threshold, int max, boolean keepGeneNonSpecific, String consolidateMode) getExpressionLevelsPca(Collection<ExpressionExperiment> ees, int limit, int component, boolean keepGeneNonSpecific, String consolidateMode) getProcessedDataArrays(Collection<ExpressionExperiment> expressionExperiments, Collection<Long> genes) getProcessedDataArrays(BioAssaySet bioAssaySet, Collection<Long> genes) getProcessedDataArrays(ExpressionExperiment expressionExperiment) getProcessedDataArraysByProbe(Collection<ExpressionExperiment> expressionExperiments, Collection<CompositeSequence> compositeSequences) getProcessedDataArraysByProbe(ExpressionExperiment ee, Collection<CompositeSequence> compositeSequences) getProcessedDataVectors(ExpressionExperiment expressionExperiment) getProcessedDataVectors(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit) getProcessedDataVectorsAndThaw(ExpressionExperiment expressionExperiment) Retrieve and thaw a collection of vectors for a given experiment.getProcessedDataVectorsDesignElements(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit) getRandomProcessedDataArrays(ExpressionExperiment ee, int limit) getRanks(Collection<ExpressionExperiment> expressionExperiments, Collection<Gene> genes, ProcessedExpressionDataVectorDao.RankMethod method) intRemove the processed vectors of an EE.voidCreates new bioAssayDimensions to match the experimental design, reorders the data to match, updates.intreplaceProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors, boolean updateRanks) Replace the processed vectors of a EE with the given vectors.voidUpdate the ranks of the processed vectors for the given experiment.Methods inherited from class AbstractBulkExpressionDataVectorService
find, find, find, findAndThaw, findAndThaw, findAndThaw, thaw, thawMethods inherited from class AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, save, save, streamAll, streamAll, update, updateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseReadOnlyService
countAll, find, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, streamAll, streamAllMethods inherited from interface BulkExpressionDataVectorService
find, find, find, findAndThaw, findAndThaw, findAndThaw, thaw, thaw
-
Constructor Details
-
ProcessedExpressionDataVectorServiceImpl
@Autowired protected ProcessedExpressionDataVectorServiceImpl(ProcessedExpressionDataVectorDao mainDao)
-
-
Method Details
-
createProcessedDataVectors
@Transactional(propagation=NEVER) public QuantitationType createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks) throws QuantitationTypeConversionException Description copied from interface:ProcessedExpressionDataVectorServiceCreate processed vectors and optionally update ranks.Mismatch between quantitation type and data is ignored.
This also adds an audit event and evict the vectors from the cache.
- Specified by:
createProcessedDataVectorsin interfaceProcessedExpressionDataVectorService- Parameters:
updateRanks- whether to update the rnaks of the vectors or not- Returns:
- the created processed QT
- Throws:
QuantitationTypeConversionException- if the data cannot be converted, generally to log2 scale- See Also:
-
createProcessedDataVectors
@Transactional(propagation=NEVER) @AuditedOnError(value=FailedProcessedVectorComputationEvent.class, message="Failed to create processed expression data vectors.") public QuantitationType createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks, boolean ignoreQuantitationMismatch) throws QuantitationTypeDetectionException, QuantitationTypeConversionException 🛑Propagation.NEVER: the quantile normalization in the middle of this takes 44 minutes on a large experiment (GSE260875, measured 2026-09-17) and the connection handling mode isDELAYED_ACQUISITION_AND_HOLD, so a transaction around the whole thing pins a pooled connection for the duration without issuing a statement — against a pool that recycles at 30 minutes. Read, compute and write are three steps on the helper bean, each with its own transaction or none.updateRanksgoes throughselfrather thanthisbecause a self-invocation does not pass the proxy, and with no transaction inherited from here it would run without one at all.- Specified by:
createProcessedDataVectorsin interfaceProcessedExpressionDataVectorService- Returns:
- the created processed QT
- Throws:
QuantitationTypeDetectionException- if the QT caanot be detected from data, never raised if ignoreQuantitationMismatch is set to trueQuantitationTypeConversionException- if the data cannot be converted, generally to log2 scale- See Also:
-
computeUnmaskedProcessedDataMatrix
@Transactional(propagation=NEVER) public ExpressionDataDoubleMatrix computeUnmaskedProcessedDataMatrix(ExpressionExperiment expressionExperiment, boolean ignoreQuantitationMismatch) throws QuantitationTypeDetectionException, QuantitationTypeConversionException 🛑Propagation.NEVER, for the same reason ascreateProcessedDataVectors(ExpressionExperiment, boolean): the normalization between the read and the assembly is where the 44 minutes go, and nothing in it needs a connection.- Specified by:
computeUnmaskedProcessedDataMatrixin interfaceProcessedExpressionDataVectorService- Throws:
QuantitationTypeDetectionExceptionQuantitationTypeConversionException
-
replaceProcessedDataVectors
@Transactional @Audited(value=ProcessedVectorComputationEvent.class, message="Replaced processed expression data.") @AuditedOnError(value=FailedProcessedVectorComputationEvent.class, message="Failed to replace processed expression data vectors.") public int replaceProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors, boolean updateRanks) Description copied from interface:ProcessedExpressionDataVectorServiceReplace the processed vectors of a EE with the given vectors.Ranks are recomputed, no conversion of QT is done.
This also adds an audit event and evict the vectors from the cache.
- Specified by:
replaceProcessedDataVectorsin interfaceProcessedExpressionDataVectorService- Parameters:
ee- eevectors- non-persistent, all of the sameQuantitationTypeupdateRanks- whether to update ranks or not- See Also:
-
removeProcessedDataVectors
@Transactional @Audited(value=ProcessedVectorComputationEvent.class, message="Removed processed expression data.") @AuditedOnError(value=FailedProcessedVectorComputationEvent.class, message="Failed to remove processed expression data vectors.") public int removeProcessedDataVectors(ExpressionExperiment ee) Description copied from interface:ProcessedExpressionDataVectorServiceRemove the processed vectors of an EE.This also adds an audit event and evict the vectors from the cache.
- Specified by:
removeProcessedDataVectorsin interfaceProcessedExpressionDataVectorService- See Also:
-
reorderByDesign
@Transactional @Audited(value=VectorsReorderedEvent.class, message="Reordered the data vectors by experimental design") public void reorderByDesign(ExpressionExperiment ee) Description copied from interface:ProcessedExpressionDataVectorServiceCreates new bioAssayDimensions to match the experimental design, reorders the data to match, updates.This also adds an audit event and evict the vectors from the cache.
- Specified by:
reorderByDesignin interfaceProcessedExpressionDataVectorService
-
updateRanks
@Transactional @AuditedOnError(value=FailedProcessedVectorComputationEvent.class, message="Failed to update ranks for expression data vectors.") public void updateRanks(ExpressionExperiment ee) Description copied from interface:ProcessedExpressionDataVectorServiceUpdate the ranks of the processed vectors for the given experiment.This also adds an audit event and evict the vectors from the cache.
- Specified by:
updateRanksin interfaceProcessedExpressionDataVectorService
-
getExpressionLevels
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevels(Collection<ExpressionExperiment> ees, Collection<Gene> genes, boolean keepGeneNonSpecific, @Nullable String consolidateMode) - Specified by:
getExpressionLevelsin interfaceProcessedExpressionDataVectorService- Parameters:
ees- expressionExperimentsgenes- geneskeepGeneNonSpecific- whether to keep vectors that are not specific to the geneconsolidateMode- how to consolidate the vectors when there is more than one- Returns:
- value objects containing structured information about the expression levels of given genes
-
getExpressionLevelsByIds
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevelsByIds(Collection<Long> eeIds, Collection<Gene> genes, boolean keepGeneNonSpecific, @Nullable String consolidateMode) Description copied from interface:ProcessedExpressionDataVectorServiceRetrieve expression levels by dataset IDs.- Specified by:
getExpressionLevelsByIdsin interfaceProcessedExpressionDataVectorService- See Also:
-
getExpressionLevelsPca
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevelsPca(Collection<ExpressionExperiment> ees, int limit, int component, boolean keepGeneNonSpecific, @Nullable String consolidateMode) - Specified by:
getExpressionLevelsPcain interfaceProcessedExpressionDataVectorService- Parameters:
ees- expressionExperimentslimit- thresholdcomponent- the principal componentkeepGeneNonSpecific- whether to keep vectors that are not specific to the geneconsolidateMode- how to consolidate the vectors when there is more than one- Returns:
- value objects containing structured information about the expression levels of genes highly loaded in the given principal component.
-
getExpressionLevelsDiffEx
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevelsDiffEx(Collection<ExpressionExperiment> ees, Long diffExResultSetId, double threshold, int max, boolean keepGeneNonSpecific, @Nullable String consolidateMode) - Specified by:
getExpressionLevelsDiffExin interfaceProcessedExpressionDataVectorService- Parameters:
ees- eesdiffExResultSetId- the differential expression result set to accessthreshold- thresholdmax- max levelkeepGeneNonSpecific- whether to keep vectors that are not specific to the geneconsolidateMode- how to consolidate the vectors when there is more than one- Returns:
- value objects containing structured information about the expression levels of genes highly loaded in the given principal component.
-
getProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArrays(Collection<ExpressionExperiment> expressionExperiments, Collection<Long> genes) - Specified by:
getProcessedDataArraysin interfaceProcessedExpressionDataVectorService- See Also:
-
getProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArrays(BioAssaySet bioAssaySet, Collection<Long> genes) - Specified by:
getProcessedDataArraysin interfaceProcessedExpressionDataVectorService- See Also:
-
getProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArrays(ExpressionExperiment expressionExperiment) - Specified by:
getProcessedDataArraysin interfaceProcessedExpressionDataVectorService- See Also:
-
getRandomProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getRandomProcessedDataArrays(ExpressionExperiment ee, int limit) - Specified by:
getRandomProcessedDataArraysin interfaceProcessedExpressionDataVectorService- See Also:
-
getProcessedDataArraysByProbe
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArraysByProbe(ExpressionExperiment ee, Collection<CompositeSequence> compositeSequences) - Specified by:
getProcessedDataArraysByProbein interfaceProcessedExpressionDataVectorService
-
getProcessedDataArraysByProbe
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArraysByProbe(Collection<ExpressionExperiment> expressionExperiments, Collection<CompositeSequence> compositeSequences) - Specified by:
getProcessedDataArraysByProbein interfaceProcessedExpressionDataVectorService- See Also:
-
find
@Transactional(readOnly=true) public Collection<ProcessedExpressionDataVector> find(Collection<CompositeSequence> designElements, QuantitationType quantitationType) Description copied from interface:ProcessedExpressionDataVectorServiceRetrieve the processed vectors for a set of design elements within a given (processed) quantitation type. UnlikegetProcessedDataArraysByProbe(...)these are raw entities whose data has NOT had read-time outlier masking applied, so the caller can recover un-masked values for those probes.- Specified by:
findin interfaceProcessedExpressionDataVectorService- See Also:
-
getProcessedDataVectors
@Transactional(readOnly=true) public Collection<ProcessedExpressionDataVector> getProcessedDataVectors(ExpressionExperiment expressionExperiment) - Specified by:
getProcessedDataVectorsin interfaceProcessedExpressionDataVectorService- See Also:
-
getProcessedDataVectors
@Transactional(readOnly=true) public Slice<ProcessedExpressionDataVector> getProcessedDataVectors(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit) - Specified by:
getProcessedDataVectorsin interfaceProcessedExpressionDataVectorService
-
getProcessedDataVectorsDesignElements
@Transactional(readOnly=true) public Slice<CompositeSequence> getProcessedDataVectorsDesignElements(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit) - Specified by:
getProcessedDataVectorsDesignElementsin interfaceProcessedExpressionDataVectorService
-
getProcessedDataVectorsAndThaw
@Transactional(readOnly=true) public Collection<ProcessedExpressionDataVector> getProcessedDataVectorsAndThaw(ExpressionExperiment expressionExperiment) Description copied from interface:ProcessedExpressionDataVectorServiceRetrieve and thaw a collection of vectors for a given experiment.- Specified by:
getProcessedDataVectorsAndThawin interfaceProcessedExpressionDataVectorService- See Also:
-
getRanks
@Transactional(readOnly=true) public Map<ExpressionExperiment, Map<Gene, Collection<Double>>> getRanks(Collection<ExpressionExperiment> expressionExperiments, Collection<Gene> genes, ProcessedExpressionDataVectorDao.RankMethod method) - Specified by:
getRanksin interfaceProcessedExpressionDataVectorService- See Also:
-
getDiffExVectors
@Transactional(readOnly=true) public List<DoubleVectorValueObject> getDiffExVectors(Long resultSetId, double threshold, int maxNumberOfResults) - Specified by:
getDiffExVectorsin interfaceProcessedExpressionDataVectorService
-
evictFromCache
- Specified by:
evictFromCachein interfaceProcessedExpressionDataVectorService
-