Class ProcessedExpressionDataVectorServiceImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractService<T>
-
- ubic.gemma.persistence.service.expression.bioAssayData.AbstractDesignElementDataVectorService<ProcessedExpressionDataVector>
-
- ubic.gemma.persistence.service.expression.bioAssayData.ProcessedExpressionDataVectorServiceImpl
-
- All Implemented Interfaces:
BaseImmutableService<ProcessedExpressionDataVector>
,BaseReadOnlyService<ProcessedExpressionDataVector>
,BaseService<ProcessedExpressionDataVector>
,ProcessedExpressionDataVectorService
@Service public class ProcessedExpressionDataVectorServiceImpl extends AbstractDesignElementDataVectorService<ProcessedExpressionDataVector> implements ProcessedExpressionDataVectorService
- Author:
- Paul
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractService
log
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProcessedExpressionDataVectorServiceImpl(ProcessedExpressionDataVectorDao mainDao)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks)
Create processed vectors and optionally update ranks.int
createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks, boolean ignoreQuantitationMismatch)
Create processed vectors and optionally update ranks.void
evictFromCache(ExpressionExperiment ee)
Collection<T>
find(Collection<QuantitationType> quantitationTypes)
Find specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.Collection<T>
find(QuantitationType quantitationType)
Find specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.Collection<T>
find(BioAssayDimension bioAssayDimension)
Find specific type (raw or processed, depending on the service) of vectors that meet the given criteria.Collection<T>
findAndThaw(Collection<QuantitationType> quantitationTypes)
Collection<T>
findAndThaw(QuantitationType quantitationType)
Find and thaw specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.Collection<T>
findAndThaw(BioAssayDimension bioAssayDimension)
List<DoubleVectorValueObject>
getDiffExVectors(Long resultSetId, double threshold, int maxNumberOfResults)
List<ExperimentExpressionLevelsValueObject>
getExpressionLevels(Collection<ExpressionExperiment> ees, Collection<Gene> genes, boolean keepGeneNonSpecific, String consolidateMode)
List<ExperimentExpressionLevelsValueObject>
getExpressionLevelsByIds(Collection<Long> eeIds, Collection<Gene> genes, boolean keepGeneNonSpecific, String consolidateMode)
Retrieve expression levels by dataset IDs.List<ExperimentExpressionLevelsValueObject>
getExpressionLevelsDiffEx(Collection<ExpressionExperiment> ees, Long diffExResultSetId, double threshold, int max, boolean keepGeneNonSpecific, String consolidateMode)
List<ExperimentExpressionLevelsValueObject>
getExpressionLevelsPca(Collection<ExpressionExperiment> ees, int limit, int component, boolean keepGeneNonSpecific, String consolidateMode)
Collection<DoubleVectorValueObject>
getProcessedDataArrays(Collection<ExpressionExperiment> expressionExperiments, Collection<Long> genes)
Collection<DoubleVectorValueObject>
getProcessedDataArrays(BioAssaySet bioAssaySet, Collection<Long> genes)
Collection<DoubleVectorValueObject>
getProcessedDataArrays(ExpressionExperiment expressionExperiment)
Collection<DoubleVectorValueObject>
getProcessedDataArraysByProbe(Collection<ExpressionExperiment> expressionExperiments, Collection<CompositeSequence> compositeSequences)
Collection<DoubleVectorValueObject>
getProcessedDataArraysByProbe(ExpressionExperiment ee, Collection<CompositeSequence> compositeSequences)
Collection<ProcessedExpressionDataVector>
getProcessedDataVectors(ExpressionExperiment expressionExperiment)
Slice<ProcessedExpressionDataVector>
getProcessedDataVectors(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit)
Collection<ProcessedExpressionDataVector>
getProcessedDataVectorsAndThaw(ExpressionExperiment expressionExperiment)
Retrieve and thaw a collection of vectors for a given experiment.Slice<CompositeSequence>
getProcessedDataVectorsDesignElements(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit)
Collection<DoubleVectorValueObject>
getRandomProcessedDataArrays(ExpressionExperiment ee, int limit)
Map<ExpressionExperiment,Map<Gene,Collection<Double>>>
getRanks(Collection<ExpressionExperiment> expressionExperiments, Collection<Gene> genes, ProcessedExpressionDataVectorDao.RankMethod method)
int
removeProcessedDataVectors(ExpressionExperiment ee)
Remove the processed vectors of an EE.void
reorderByDesign(ExpressionExperiment ee)
Creates new bioAssayDimensions to match the experimental design, reorders the data to match, updates.int
replaceProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors, boolean updateRanks)
Replace the processed vectors of a EE with the given vectors.Collection<T>
thaw(Collection<T> vectors)
Deprecated.UsefindAndThaw(QuantitationType)
,findAndThaw(Collection)
orfindAndThaw(BioAssayDimension)
instead, it's much more efficient.void
updateRanks(ExpressionExperiment ee)
Update the ranks of the processed vectors for the given experiment.-
Methods inherited from class ubic.gemma.persistence.service.expression.bioAssayData.AbstractDesignElementDataVectorService
find, find, find, findAndThaw, findAndThaw, findAndThaw, thaw
-
Methods inherited from class ubic.gemma.persistence.service.AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, remove, save, save, streamAll, streamAll, 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.BaseReadOnlyService
countAll, find, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, streamAll, streamAll
-
-
-
-
Constructor Detail
-
ProcessedExpressionDataVectorServiceImpl
@Autowired protected ProcessedExpressionDataVectorServiceImpl(ProcessedExpressionDataVectorDao mainDao)
-
-
Method Detail
-
createProcessedDataVectors
@Transactional(rollbackFor=QuantitationTypeConversionException.class) public int createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks) throws QuantitationTypeConversionException
Description copied from interface:ProcessedExpressionDataVectorService
Create 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:
createProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
updateRanks
- whether to update the rnaks of the vectors or not- Throws:
QuantitationTypeConversionException
- if the data cannot be converted, generally to log2 scale- See Also:
ProcessedExpressionDataVectorService.updateRanks(ExpressionExperiment)
,ProcessedExpressionDataVectorDao.createProcessedDataVectors(ExpressionExperiment, boolean)
-
createProcessedDataVectors
@Transactional(rollbackFor={QuantitationTypeDetectionException.class,QuantitationTypeConversionException.class}) public int createProcessedDataVectors(ExpressionExperiment expressionExperiment, boolean updateRanks, boolean ignoreQuantitationMismatch) throws QuantitationTypeDetectionException, QuantitationTypeConversionException
Description copied from interface:ProcessedExpressionDataVectorService
Create processed vectors and optionally update ranks.This also adds an audit event and evict the vectors from the cache.
- Specified by:
createProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
- 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:
ProcessedExpressionDataVectorService.createProcessedDataVectors(ExpressionExperiment, boolean)
,ProcessedExpressionDataVectorService.updateRanks(ExpressionExperiment)
-
replaceProcessedDataVectors
@Transactional public int replaceProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors, boolean updateRanks)
Description copied from interface:ProcessedExpressionDataVectorService
Replace 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:
replaceProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
- Parameters:
ee
- eevectors
- non-persistent, all of the sameQuantitationType
updateRanks
- whether to update ranks or not- See Also:
ProcessedExpressionDataVectorDao.createProcessedDataVectors(ExpressionExperiment, boolean)
-
removeProcessedDataVectors
@Transactional public int removeProcessedDataVectors(ExpressionExperiment ee)
Description copied from interface:ProcessedExpressionDataVectorService
Remove the processed vectors of an EE.This also adds an audit event and evict the vectors from the cache.
- Specified by:
removeProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
- See Also:
ExpressionExperimentService.removeProcessedDataVectors(ExpressionExperiment)
-
reorderByDesign
@Transactional public void reorderByDesign(ExpressionExperiment ee)
Description copied from interface:ProcessedExpressionDataVectorService
Creates 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:
reorderByDesign
in interfaceProcessedExpressionDataVectorService
-
updateRanks
@Transactional public void updateRanks(ExpressionExperiment ee)
Description copied from interface:ProcessedExpressionDataVectorService
Update 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:
updateRanks
in interfaceProcessedExpressionDataVectorService
-
getExpressionLevels
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevels(Collection<ExpressionExperiment> ees, Collection<Gene> genes, boolean keepGeneNonSpecific, @Nullable String consolidateMode)
- Specified by:
getExpressionLevels
in 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:ProcessedExpressionDataVectorService
Retrieve expression levels by dataset IDs.
-
getExpressionLevelsPca
@Transactional(readOnly=true) public List<ExperimentExpressionLevelsValueObject> getExpressionLevelsPca(Collection<ExpressionExperiment> ees, int limit, int component, boolean keepGeneNonSpecific, @Nullable String consolidateMode)
- Specified by:
getExpressionLevelsPca
in 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:
getExpressionLevelsDiffEx
in 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:
getProcessedDataArrays
in interfaceProcessedExpressionDataVectorService
- See Also:
CachedProcessedExpressionDataVectorService.getProcessedDataArrays(Collection, Collection)
-
getProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArrays(BioAssaySet bioAssaySet, Collection<Long> genes)
- Specified by:
getProcessedDataArrays
in interfaceProcessedExpressionDataVectorService
- See Also:
CachedProcessedExpressionDataVectorService.getProcessedDataArrays(BioAssaySet, Collection)
-
getProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArrays(ExpressionExperiment expressionExperiment)
- Specified by:
getProcessedDataArrays
in interfaceProcessedExpressionDataVectorService
- See Also:
CachedProcessedExpressionDataVectorService.getProcessedDataArrays(BioAssaySet)
-
getRandomProcessedDataArrays
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getRandomProcessedDataArrays(ExpressionExperiment ee, int limit)
- Specified by:
getRandomProcessedDataArrays
in interfaceProcessedExpressionDataVectorService
- See Also:
CachedProcessedExpressionDataVectorService.getRandomProcessedDataArrays(BioAssaySet, int)
-
getProcessedDataArraysByProbe
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArraysByProbe(ExpressionExperiment ee, Collection<CompositeSequence> compositeSequences)
- Specified by:
getProcessedDataArraysByProbe
in interfaceProcessedExpressionDataVectorService
-
getProcessedDataArraysByProbe
@Transactional(readOnly=true) public Collection<DoubleVectorValueObject> getProcessedDataArraysByProbe(Collection<ExpressionExperiment> expressionExperiments, Collection<CompositeSequence> compositeSequences)
- Specified by:
getProcessedDataArraysByProbe
in interfaceProcessedExpressionDataVectorService
- See Also:
CachedProcessedExpressionDataVectorService.getProcessedDataArraysByProbe(Collection, Collection)
-
getProcessedDataVectors
@Transactional(readOnly=true) public Collection<ProcessedExpressionDataVector> getProcessedDataVectors(ExpressionExperiment expressionExperiment)
- Specified by:
getProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
- See Also:
ProcessedExpressionDataVectorDao.getProcessedVectors(ExpressionExperiment)
-
getProcessedDataVectors
@Transactional(readOnly=true) public Slice<ProcessedExpressionDataVector> getProcessedDataVectors(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit)
- Specified by:
getProcessedDataVectors
in interfaceProcessedExpressionDataVectorService
-
getProcessedDataVectorsDesignElements
@Transactional(readOnly=true) public Slice<CompositeSequence> getProcessedDataVectorsDesignElements(ExpressionExperiment expressionExperiment, BioAssayDimension dimension, int offset, int limit)
- Specified by:
getProcessedDataVectorsDesignElements
in interfaceProcessedExpressionDataVectorService
-
getProcessedDataVectorsAndThaw
@Transactional(readOnly=true) public Collection<ProcessedExpressionDataVector> getProcessedDataVectorsAndThaw(ExpressionExperiment expressionExperiment)
Description copied from interface:ProcessedExpressionDataVectorService
Retrieve and thaw a collection of vectors for a given experiment.
-
getRanks
@Transactional(readOnly=true) public Map<ExpressionExperiment,Map<Gene,Collection<Double>>> getRanks(Collection<ExpressionExperiment> expressionExperiments, Collection<Gene> genes, ProcessedExpressionDataVectorDao.RankMethod method)
-
getDiffExVectors
@Transactional(readOnly=true) public List<DoubleVectorValueObject> getDiffExVectors(Long resultSetId, double threshold, int maxNumberOfResults)
- Specified by:
getDiffExVectors
in interfaceProcessedExpressionDataVectorService
-
evictFromCache
public void evictFromCache(ExpressionExperiment ee)
- Specified by:
evictFromCache
in interfaceProcessedExpressionDataVectorService
-
find
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_DATAVECTOR_COLLECTION_READ"}) public abstract Collection<T> find(BioAssayDimension bioAssayDimension)
Find specific type (raw or processed, depending on the service) of vectors that meet the given criteria.- Parameters:
bioAssayDimension
- the BA dimension- Returns:
- the found vectors of type
DesignElementDataVectorService
-
findAndThaw
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_DATAVECTOR_COLLECTION_READ"}) public abstract Collection<T> findAndThaw(BioAssayDimension bioAssayDimension)
-
find
@Secured("GROUP_ADMIN") public abstract Collection<T> find(Collection<QuantitationType> quantitationTypes)
Find specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.- Parameters:
quantitationTypes
- the QTs- Returns:
- the found vectors of type
DesignElementDataVectorService
-
findAndThaw
@Secured("GROUP_ADMIN") public abstract Collection<T> findAndThaw(Collection<QuantitationType> quantitationTypes)
-
find
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_DATAVECTOR_COLLECTION_READ"}) public abstract Collection<T> find(QuantitationType quantitationType)
Find specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.- Parameters:
quantitationType
- the QT- Returns:
- the found vectors of type
DesignElementDataVectorService
-
findAndThaw
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_DATAVECTOR_COLLECTION_READ"}) public abstract Collection<T> findAndThaw(QuantitationType quantitationType)
Find and thaw specific type (DesignElementDataVectorService
) of vectors that meet the given criteria.
-
thaw
@CheckReturnValue @Deprecated public abstract Collection<T> thaw(Collection<T> vectors)
Deprecated.UsefindAndThaw(QuantitationType)
,findAndThaw(Collection)
orfindAndThaw(BioAssayDimension)
instead, it's much more efficient.Thaw the given vectors.
-
-