Class ExpressionExperimentServiceImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractService<O>
-
- ubic.gemma.persistence.service.AbstractFilteringVoEnabledService<ExpressionExperiment,ExpressionExperimentValueObject>
-
- ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentServiceImpl
-
- All Implemented Interfaces:
CuratableService<ExpressionExperiment,ExpressionExperimentValueObject>
,BaseImmutableService<ExpressionExperiment>
,BaseReadOnlyService<ExpressionExperiment>
,BaseService<ExpressionExperiment>
,BaseVoEnabledService<ExpressionExperiment,ExpressionExperimentValueObject>
,ExpressionExperimentService
,FilteringService<ExpressionExperiment>
,FilteringVoEnabledService<ExpressionExperiment,ExpressionExperimentValueObject>
@Service public class ExpressionExperimentServiceImpl extends AbstractFilteringVoEnabledService<ExpressionExperiment,ExpressionExperimentValueObject> implements ExpressionExperimentService
- Author:
- pavlidis, keshav
- See Also:
ExpressionExperimentService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService
ExpressionExperimentService.CharacteristicWithUsageStatisticsAndOntologyTerm
-
-
Field Summary
-
Fields inherited from class ubic.gemma.persistence.service.AbstractService
log
-
Fields inherited from interface ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService
FREE_TEXT, UNCATEGORIZED
-
-
Constructor Summary
Constructors Constructor Description ExpressionExperimentServiceImpl(ExpressionExperimentDao expressionExperimentDao)
-
Method Summary
-
Methods inherited from class ubic.gemma.persistence.service.AbstractFilteringVoEnabledService
count, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyResolvableAllowedValuesLabels, getFilterablePropertyType, getIdentifierPropertyName, getSort, load, load, loadAllValueObjects, loadIds, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjects, loadValueObjects, loadValueObjectsByIds
-
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, save, save, 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, findOrFail, getElementClass
-
Methods inherited from interface ubic.gemma.persistence.service.auditAndSecurity.curation.CuratableService
create, create, find, findOrCreate, load, load, load, load, loadAll, loadAllValueObjects, loadIds, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjects, loadValueObjects, loadValueObjectsByIds, save, save, update, update
-
Methods inherited from interface ubic.gemma.persistence.service.FilteringService
count, getFilter, getFilter, getFilter, getFilter, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyDescription, getFilterablePropertyIsUsingSubquery, getFilterablePropertyResolvableAllowedValuesLabels, getFilterablePropertyType, getIdentifierPropertyName, getSort
-
-
-
-
Constructor Detail
-
ExpressionExperimentServiceImpl
@Autowired public ExpressionExperimentServiceImpl(ExpressionExperimentDao expressionExperimentDao)
-
-
Method Detail
-
loadReference
@Transactional(readOnly=true) public ExpressionExperiment loadReference(Long id)
- Specified by:
loadReference
in interfaceExpressionExperimentService
-
loadReferences
@Transactional(readOnly=true) public Collection<ExpressionExperiment> loadReferences(Collection<Long> ids)
Description copied from interface:ExpressionExperimentService
Load references for the given experiment IDs.- Specified by:
loadReferences
in interfaceExpressionExperimentService
-
loadAllReferences
@Transactional(readOnly=true) public Collection<ExpressionExperiment> loadAllReferences()
Description copied from interface:ExpressionExperimentService
Load references for all experiments.References are pre-filtered for ACLs as per
CuratableService.loadIds(Filters, Sort)
.- Specified by:
loadAllReferences
in interfaceExpressionExperimentService
-
addFactor
@Transactional public ExperimentalFactor addFactor(ExpressionExperiment ee, ExperimentalFactor factor)
- Specified by:
addFactor
in interfaceExpressionExperimentService
-
addFactorValue
@Transactional public FactorValue addFactorValue(ExpressionExperiment ee, FactorValue fv)
- Specified by:
addFactorValue
in interfaceExpressionExperimentService
- Parameters:
ee
- experiment.fv
- must already have the experimental factor filled in.
-
addFactorValues
@Transactional public void addFactorValues(ExpressionExperiment ee, Map<BioMaterial,FactorValue> fvs)
Description copied from interface:ExpressionExperimentService
Intended with the case of a continuous factor being added.- Specified by:
addFactorValues
in interfaceExpressionExperimentService
-
addRawDataVectors
@Transactional public int addRawDataVectors(ExpressionExperiment ee, QuantitationType quantitationType, Collection<RawExpressionDataVector> newVectors)
Description copied from interface:ExpressionExperimentService
Used when we want to add data for a quantitation type. Does not remove any existing vectors.- Specified by:
addRawDataVectors
in interfaceExpressionExperimentService
- Parameters:
ee
- experiment to be updated.newVectors
- vectors to be added.- Returns:
- the number of added vectors
-
replaceRawDataVectors
@Transactional public int replaceRawDataVectors(ExpressionExperiment ee, QuantitationType qt, Collection<RawExpressionDataVector> vectors)
- Specified by:
replaceRawDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.replaceRawDataVectors(ExpressionExperiment, QuantitationType, Collection)
-
replaceAllRawDataVectors
@Transactional public int replaceAllRawDataVectors(ExpressionExperiment ee, Collection<RawExpressionDataVector> newVectors)
Description copied from interface:ExpressionExperimentService
Used when we are replacing data, such as when converting an experiment from one platform to another. Examples would be exon array or RNA-seq data sets, or other situations where we are replacing data. Does not take care of computing the processed data vectors, but it does clear them out.- Specified by:
replaceAllRawDataVectors
in interfaceExpressionExperimentService
- Parameters:
ee
- experimentnewVectors
- If they are from more than one platform, that will be dealt with.- Returns:
- the number of vectors replaced
-
removeAllRawDataVectors
@Transactional public int removeAllRawDataVectors(ExpressionExperiment ee)
- Specified by:
removeAllRawDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.removeAllRawDataVectors(ExpressionExperiment)
-
removeRawDataVectors
@Transactional public int removeRawDataVectors(ExpressionExperiment ee, QuantitationType qt)
- Specified by:
removeRawDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.removeRawDataVectors(ExpressionExperiment, QuantitationType)
-
createProcessedDataVectors
@Transactional public void createProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors)
- Specified by:
createProcessedDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.createProcessedDataVectors(ExpressionExperiment, Collection)
-
removeProcessedDataVectors
@Transactional public int removeProcessedDataVectors(ExpressionExperiment ee)
- Specified by:
removeProcessedDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.removeProcessedDataVectors(ExpressionExperiment)
-
replaceProcessedDataVectors
@Transactional public int replaceProcessedDataVectors(ExpressionExperiment ee, Collection<ProcessedExpressionDataVector> vectors)
- Specified by:
replaceProcessedDataVectors
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.replaceProcessedDataVectors(ExpressionExperiment, Collection)
-
browse
@Transactional(readOnly=true) public List<ExpressionExperiment> browse(int start, int limit)
- Specified by:
browse
in interfaceExpressionExperimentService
-
filter
@Transactional(readOnly=true) public Collection<Long> filter(String searchString) throws SearchException
returns ids of search results- Specified by:
filter
in interfaceExpressionExperimentService
- Parameters:
searchString
- search string- Returns:
- collection of ids or an empty collection
- Throws:
SearchException
-
filterByTaxon
@Transactional(readOnly=true) public Collection<Long> filterByTaxon(Collection<Long> ids, Taxon taxon)
Description copied from interface:ExpressionExperimentService
Remove IDs of Experiments that are not from the given taxon.- Specified by:
filterByTaxon
in interfaceExpressionExperimentService
- Parameters:
ids
- collection to purge.taxon
- taxon to retain.- Returns:
- purged IDs.
-
loadWithPrimaryPublication
@Transactional(readOnly=true) public ExpressionExperiment loadWithPrimaryPublication(Long id)
- Specified by:
loadWithPrimaryPublication
in interfaceExpressionExperimentService
-
loadWithMeanVarianceRelation
@Transactional(readOnly=true) public ExpressionExperiment loadWithMeanVarianceRelation(Long id)
- Specified by:
loadWithMeanVarianceRelation
in interfaceExpressionExperimentService
-
findByAccession
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByAccession(DatabaseEntry accession)
- Specified by:
findByAccession
in interfaceExpressionExperimentService
- Parameters:
accession
- accession- Returns:
- Experiments which have the given accession. There can be more than one, because one GEO accession can result in multiple experiments in Gemma.
- See Also:
ExpressionExperimentService.findByAccession(DatabaseEntry)
-
findByAccession
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByAccession(String accession)
- Specified by:
findByAccession
in interfaceExpressionExperimentService
-
findByBibliographicReference
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByBibliographicReference(BibliographicReference bibRef)
- Specified by:
findByBibliographicReference
in interfaceExpressionExperimentService
- Parameters:
bibRef
- bibliographic reference- Returns:
- a collection of EE that have that reference that BibliographicReference
- See Also:
ExpressionExperimentService.findByBibliographicReference(BibliographicReference)
-
findByBioAssay
@Transactional(readOnly=true) public ExpressionExperiment findByBioAssay(BioAssay ba)
- Specified by:
findByBioAssay
in interfaceExpressionExperimentService
- Parameters:
ba
- bio material- Returns:
- experiment the given bioassay is associated with
- See Also:
ExpressionExperimentService.findByBioAssay(BioAssay)
-
findByBioMaterial
@Transactional(readOnly=true) public ExpressionExperiment findByBioMaterial(BioMaterial bm)
- Specified by:
findByBioMaterial
in interfaceExpressionExperimentService
- Parameters:
bm
- bio material- Returns:
- experiment the given biomaterial is associated with
- See Also:
ExpressionExperimentService.findByBioMaterial(BioMaterial)
-
findByBioMaterials
@Transactional(readOnly=true) public Map<ExpressionExperiment,BioMaterial> findByBioMaterials(Collection<BioMaterial> bioMaterials)
- Specified by:
findByBioMaterials
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByBioMaterials(Collection)
-
findByExpressedGene
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByExpressedGene(Gene gene, double rank)
- Specified by:
findByExpressedGene
in interfaceExpressionExperimentService
- Parameters:
gene
- generank
- rank- Returns:
- a collection of expression experiment ids that express the given gene above the given expression level
- See Also:
ExpressionExperimentService.findByExpressedGene(Gene, double)
-
findByDesign
@Transactional(readOnly=true) public ExpressionExperiment findByDesign(ExperimentalDesign ed)
- Specified by:
findByDesign
in interfaceExpressionExperimentService
-
findByFactor
@Transactional(readOnly=true) public ExpressionExperiment findByFactor(ExperimentalFactor factor)
- Specified by:
findByFactor
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByFactor(ExperimentalFactor)
-
findByFactorValue
@Transactional(readOnly=true) public ExpressionExperiment findByFactorValue(FactorValue factorValue)
- Specified by:
findByFactorValue
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByFactorValue(FactorValue)
-
findByFactorValue
@Transactional(readOnly=true) public ExpressionExperiment findByFactorValue(Long factorValueId)
- Specified by:
findByFactorValue
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByFactorValue(FactorValue)
-
findByFactorValues
@Transactional(readOnly=true) public Map<ExpressionExperiment,FactorValue> findByFactorValues(Collection<FactorValue> factorValues)
- Specified by:
findByFactorValues
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByFactorValues(Collection)
-
findByGene
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByGene(Gene gene)
- Specified by:
findByGene
in interfaceExpressionExperimentService
- Parameters:
gene
- gene- Returns:
- a collection of expression experiments that have an AD that detects the given Gene (ie a probe on the AD hybridizes to the given Gene)
- See Also:
ExpressionExperimentService.findByGene(Gene)
-
findByName
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByName(String name)
- Specified by:
findByName
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByName(String)
-
findByQuantitationType
@Transactional(readOnly=true) public ExpressionExperiment findByQuantitationType(QuantitationType type)
- Specified by:
findByQuantitationType
in interfaceExpressionExperimentService
-
findByShortName
@Transactional(readOnly=true) public ExpressionExperiment findByShortName(String shortName)
- Specified by:
findByShortName
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByShortName(String)
-
findByTaxon
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findByTaxon(Taxon taxon)
- Specified by:
findByTaxon
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.findByTaxon(Taxon)
-
findByUpdatedLimit
@Transactional(readOnly=true) public List<ExpressionExperiment> findByUpdatedLimit(int limit)
- Specified by:
findByUpdatedLimit
in interfaceExpressionExperimentService
-
findUpdatedAfter
@Transactional(readOnly=true) public Collection<ExpressionExperiment> findUpdatedAfter(Date date)
- Specified by:
findUpdatedAfter
in interfaceExpressionExperimentService
-
getAnnotationCountsByIds
@Transactional(readOnly=true) public Map<Long,Long> getAnnotationCountsByIds(Collection<Long> ids)
- Specified by:
getAnnotationCountsByIds
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- the map of ids to number of terms associated with each expression experiment.
-
getAnnotationsById
@Transactional(readOnly=true) public Set<AnnotationValueObject> getAnnotationsById(Long eeId)
- Specified by:
getAnnotationsById
in interfaceExpressionExperimentService
- Parameters:
eeId
- experiment id.- Returns:
- the terms associated this expression experiment.
-
getFiltersWithInferredAnnotations
public Filters getFiltersWithInferredAnnotations(Filters f, @Nullable Collection<OntologyTerm> mentionedTerms, @Nullable Collection<OntologyTerm> inferredTerms, long timeout, TimeUnit timeUnit) throws TimeoutException
The approach here is to construct a collection for each sub-clause in the expression that regroups all the predicates that apply to characteristics as well as their inferred terms.The transformation only applies to properties that represent
Characteristic
objects such ascharacteristics
,allCharacteristics
,bioAssays.sample.characteristics
andexperimentalDesign.experimentalFactors.factorValues.characteristics
Given
characteristics.valueUri = a
, we construct a collection clause such ascharacteristics.valueUri in (a, children of a...)
.For efficiency, all the terms mentioned in a sub-clause are grouped by
ExpressionExperimentServiceImpl.SubClauseKey
and aggregated in a single collection. If a term is mentioned multiple times, it is simplified as a single appearance in the collection.For example,
characteristics.termUri = a or characteristics.termUri = b
will be transformed intocharacteristics.termUri in (a, b, children of a and b...)
.- Specified by:
getFiltersWithInferredAnnotations
in interfaceExpressionExperimentService
mentionedTerms
- if non-null, all the terms explicitly mentioned in the filters are added to the collection.inferredTerms
- if non-null, all the terms inferred from those mentioned in the filters are added to the collection- Throws:
TimeoutException
-
loadWithCharacteristics
@Transactional(readOnly=true) public ExpressionExperiment loadWithCharacteristics(Long id)
- Specified by:
loadWithCharacteristics
in interfaceExpressionExperimentService
-
loadBioAssaySet
@Transactional(readOnly=true) public BioAssaySet loadBioAssaySet(Long id)
Description copied from interface:ExpressionExperimentService
Load aBioAssaySet
by ID which can be either aExpressionExperiment
or aExpressionExperimentSubSet
.- Specified by:
loadBioAssaySet
in interfaceExpressionExperimentService
-
loadAndThawLiteOrFail
@Transactional(readOnly=true) public <T extends Exception> ExpressionExperiment loadAndThawLiteOrFail(Long id, Function<String,T> exceptionSupplier, String message) throws T extends Exception
Description copied from interface:ExpressionExperimentService
Load an experiment and thaw it as perExpressionExperimentService.thawLite(ExpressionExperiment)
or fail with the supplied exception and message.- Specified by:
loadAndThawLiteOrFail
in interfaceExpressionExperimentService
- Throws:
T extends Exception
-
loadAndThaw
@Nullable @Transactional(readOnly=true) public ExpressionExperiment loadAndThaw(Long id)
Description copied from interface:ExpressionExperimentService
Load an experiment and thaw it as perExpressionExperimentService.thaw(ExpressionExperiment)
.- Specified by:
loadAndThaw
in interfaceExpressionExperimentService
-
loadAndThawWithRefreshCacheMode
@Transactional(readOnly=true) public ExpressionExperiment loadAndThawWithRefreshCacheMode(Long id)
Description copied from interface:ExpressionExperimentService
Load an experiment without cache and thaw it as perExpressionExperimentService.thaw(ExpressionExperiment)
withCacheMode.REFRESH
.This has the side effect of refreshing the cache with the latest data. Since this can be expensive, only administrators are allowed to do this.
- Specified by:
loadAndThawWithRefreshCacheMode
in interfaceExpressionExperimentService
-
loadAndThawLiteWithRefreshCacheMode
@Transactional(readOnly=true) public ExpressionExperiment loadAndThawLiteWithRefreshCacheMode(Long id)
Description copied from interface:ExpressionExperimentService
A lightweight version ofExpressionExperimentService.loadAndThawWithRefreshCacheMode(Long)
which thaws as perExpressionExperimentService.thawLite(ExpressionExperiment)
.- Specified by:
loadAndThawLiteWithRefreshCacheMode
in interfaceExpressionExperimentService
-
loadAndThawOrFail
@Transactional(readOnly=true) public <T extends Exception> ExpressionExperiment loadAndThawOrFail(Long id, Function<String,T> exceptionSupplier, String message) throws T extends Exception
Description copied from interface:ExpressionExperimentService
Load an experiment and thaw it as perExpressionExperimentService.thawLite(ExpressionExperiment)
or fail with the supplied exception and message.- Specified by:
loadAndThawOrFail
in interfaceExpressionExperimentService
- Throws:
T extends Exception
-
loadIdsWithCache
@Transactional(readOnly=true) public List<Long> loadIdsWithCache(@Nullable Filters filters, @Nullable Sort sort)
- Specified by:
loadIdsWithCache
in interfaceExpressionExperimentService
-
countWithCache
@Transactional(readOnly=true) public long countWithCache(@Nullable Filters filters, @Nullable Set<Long> extraIds)
- Specified by:
countWithCache
in interfaceExpressionExperimentService
-
loadValueObjectsWithCache
@Transactional(readOnly=true) public Slice<ExpressionExperimentValueObject> loadValueObjectsWithCache(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadValueObjectsWithCache
in interfaceExpressionExperimentService
-
getCategoriesUsageFrequency
@Transactional(readOnly=true) public Map<Characteristic,Long> getCategoriesUsageFrequency(@Nullable Filters filters, @Nullable Set<Long> extraIds, @Nullable Collection<String> excludedCategoryUris, @Nullable Collection<String> excludedTermUris, @Nullable Collection<String> retainedTermUris, int maxResults)
Description copied from interface:ExpressionExperimentService
Obtain category usage frequency for datasets matching the given filter.- Specified by:
getCategoriesUsageFrequency
in interfaceExpressionExperimentService
- Parameters:
filters
- filters restricting the terms to a given set of datasetsexcludedCategoryUris
- ensure that the given category URIs are excludedexcludedTermUris
- ensure that the given term URIs and their sub-terms (as persubClassOf
relation) are excluded; this requires relevant ontologies to be loaded inOntologyService
.retainedTermUris
- ensure that the given terms are retained (overrides any exclusion from minFrequency and excludedTermUris)maxResults
- maximum number of results to return
-
getAnnotationsUsageFrequency
@Transactional(readOnly=true) public List<ExpressionExperimentService.CharacteristicWithUsageStatisticsAndOntologyTerm> getAnnotationsUsageFrequency(@Nullable Filters filters, @Nullable Set<Long> extraIds, @Nullable String category, @Nullable Collection<String> excludedCategoryUris, @Nullable Collection<String> excludedTermUris, int minFrequency, @Nullable Collection<String> retainedTermUris, int maxResults)
If the term cannot be resolved viaOntologyService.getTerm(String)
, an attempt is done to resolve its category and assign it as its parent. This handles free-text terms that lack a value URI.- Specified by:
getAnnotationsUsageFrequency
in interfaceExpressionExperimentService
- Parameters:
filters
- filters restricting the terms to a given set of datasetscategory
- a category to restrict annotations to, or null to include all categoriesexcludedCategoryUris
- ensure that the given category URIs are excludedexcludedTermUris
- ensure that the given term URIs and their sub-terms (as persubClassOf
relation) are excluded; this requires relevant ontologies to be loaded inOntologyService
.minFrequency
- minimum occurrences of a term to be included in the resultsretainedTermUris
- ensure that the given terms are retained (overrides any exclusion from minFrequency and excludedTermUris)maxResults
- maximum number of results to return- Returns:
- mapping annotations grouped by category and term (URI or value if null) to their number of occurrences in the matched datasets and ordered in descending number of associated experiments
- See Also:
ExpressionExperimentDao.getAnnotationsUsageFrequency(Collection, Class, int, int, String, Collection, Collection, Collection)
-
getArrayDesignsUsed
@Transactional(readOnly=true) public Collection<ArrayDesign> getArrayDesignsUsed(BioAssaySet expressionExperiment)
- Specified by:
getArrayDesignsUsed
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- a collection of ArrayDesigns referenced by any of the BioAssays that make up the given ExpressionExperiment.
-
getTechnologyTypeUsageFrequency
@Transactional(readOnly=true) public Map<TechnologyType,Long> getTechnologyTypeUsageFrequency(@Nullable Filters filters, @Nullable Set<Long> extraIds)
- Specified by:
getTechnologyTypeUsageFrequency
in interfaceExpressionExperimentService
-
getArrayDesignUsedOrOriginalPlatformUsageFrequency
@Transactional(readOnly=true) public Map<ArrayDesign,Long> getArrayDesignUsedOrOriginalPlatformUsageFrequency(@Nullable Filters filters, @Nullable Set<Long> extraIds, int maxResults)
Description copied from interface:ExpressionExperimentService
Calculate the usage frequency of platforms by the datasets matching the provided filters.- Specified by:
getArrayDesignUsedOrOriginalPlatformUsageFrequency
in interfaceExpressionExperimentService
- Parameters:
filters
- a set of filters to be applied as perCuratableService.load(Filters, Sort, int, int)
maxResults
- the maximum of results, or unlimited if less than 1
-
getTaxaUsageFrequency
@Transactional(readOnly=true) public Map<Taxon,Long> getTaxaUsageFrequency(@Nullable Filters filters, @Nullable Set<Long> extraIds)
Description copied from interface:ExpressionExperimentService
Calculate the usage frequency of taxa by the datasets matching the provided filters.If no filters are supplied (either being null or empty), the
ExpressionExperimentService.getPerTaxonCount()
fast path is used.- Specified by:
getTaxaUsageFrequency
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.getPerTaxonCount()
-
getBioAssayDimensions
@Transactional(readOnly=true) public Collection<BioAssayDimension> getBioAssayDimensions(ExpressionExperiment expressionExperiment)
- Specified by:
getBioAssayDimensions
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- the BioAssayDimensions for the study.
-
getBioMaterialCount
@Transactional(readOnly=true) public long getBioMaterialCount(ExpressionExperiment expressionExperiment)
- Specified by:
getBioMaterialCount
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- the amount of biomaterials associated with the given expression experiment.
-
getDesignElementDataVectorCount
@Transactional(readOnly=true) public long getDesignElementDataVectorCount(ExpressionExperiment ee)
- Specified by:
getDesignElementDataVectorCount
in interfaceExpressionExperimentService
-
getExperimentsWithOutliers
@Transactional(readOnly=true) public Collection<ExpressionExperiment> getExperimentsWithOutliers()
- Specified by:
getExperimentsWithOutliers
in interfaceExpressionExperimentService
-
getLastArrayDesignUpdate
@Transactional(readOnly=true) public Map<Long,Date> getLastArrayDesignUpdate(Collection<ExpressionExperiment> expressionExperiments)
- Specified by:
getLastArrayDesignUpdate
in interfaceExpressionExperimentService
-
getLastArrayDesignUpdate
@Transactional(readOnly=true) public Date getLastArrayDesignUpdate(ExpressionExperiment ee)
- Specified by:
getLastArrayDesignUpdate
in interfaceExpressionExperimentService
- Parameters:
ee
- experiment- Returns:
- the date of the last time any of the array designs associated with this experiment were updated.
-
getLastLinkAnalysis
@Transactional(readOnly=true) public Map<Long,AuditEvent> getLastLinkAnalysis(Collection<Long> ids)
- Specified by:
getLastLinkAnalysis
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- AuditEvents of the latest link analyses for the specified expression experiment ids. This returns a map of id -> AuditEvent. If the events do not exist, the map entry will point to null.
-
getLastMissingValueAnalysis
@Transactional(readOnly=true) public Map<Long,AuditEvent> getLastMissingValueAnalysis(Collection<Long> ids)
- Specified by:
getLastMissingValueAnalysis
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- AuditEvents of the latest missing value analysis for the specified expression experiment ids. This returns a map of id -> AuditEvent. If the events do not exist, the map entry will point to null.
-
getLastProcessedDataUpdate
@Transactional(readOnly=true) public Map<Long,AuditEvent> getLastProcessedDataUpdate(Collection<Long> ids)
- Specified by:
getLastProcessedDataUpdate
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- AuditEvents of the latest rank computation for the specified expression experiment ids. This returns a map of id -> AuditEvent. If the events do not exist, the map entry will point to null.
-
getPerTaxonCount
@Transactional(readOnly=true) public Map<Taxon,Long> getPerTaxonCount()
- Specified by:
getPerTaxonCount
in interfaceExpressionExperimentService
- Returns:
- counts of expression experiments grouped by taxon
-
getPopulatedFactorCounts
@Transactional(readOnly=true) public Map<Long,Long> getPopulatedFactorCounts(Collection<Long> ids)
- Specified by:
getPopulatedFactorCounts
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- map of ids to how many factor values the experiment has, counting only factor values which are associated with biomaterials.
-
getPopulatedFactorCountsExcludeBatch
@Transactional(readOnly=true) public Map<Long,Long> getPopulatedFactorCountsExcludeBatch(Collection<Long> ids)
- Specified by:
getPopulatedFactorCountsExcludeBatch
in interfaceExpressionExperimentService
- Parameters:
ids
- ids- Returns:
- map of ids to how many factor values the experiment has, counting only factor values which are associated with biomaterials and only factors that aren't batch
-
getPreferredQuantitationType
@Transactional(readOnly=true) public QuantitationType getPreferredQuantitationType(ExpressionExperiment ee)
Description copied from interface:ExpressionExperimentService
Iterates over the quantitation types for a given expression experiment and returns the preferred quantitation types.- Specified by:
getPreferredQuantitationType
in interfaceExpressionExperimentService
- Parameters:
ee
- experiment- Returns:
- quantitation types
-
hasProcessedExpressionData
@Transactional(readOnly=true) public boolean hasProcessedExpressionData(ExpressionExperiment ee)
Description copied from interface:ExpressionExperimentService
Test if the given experiment has processed data vectors.- Specified by:
hasProcessedExpressionData
in interfaceExpressionExperimentService
-
getQuantitationTypeCount
@Transactional(readOnly=true) public Map<QuantitationType,Long> getQuantitationTypeCount(ExpressionExperiment ee)
- Specified by:
getQuantitationTypeCount
in interfaceExpressionExperimentService
- Returns:
- counts design element data vectors grouped by quantitation type
-
getQuantitationTypes
@Transactional(readOnly=true) public Collection<QuantitationType> getQuantitationTypes(ExpressionExperiment expressionExperiment)
- Specified by:
getQuantitationTypes
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- all the quantitation types used by the given expression experiment
-
getQuantitationTypeValueObjects
@Transactional(readOnly=true) public Collection<QuantitationTypeValueObject> getQuantitationTypeValueObjects(ExpressionExperiment expressionExperiment)
Description copied from interface:ExpressionExperimentService
Load allQuantitationType
associated to an expression experiment as VOs.- Specified by:
getQuantitationTypeValueObjects
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentService.getQuantitationTypes(ExpressionExperiment)
-
getSampleRemovalEvents
@Transactional(readOnly=true) public Map<ExpressionExperiment,Collection<AuditEvent>> getSampleRemovalEvents(Collection<ExpressionExperiment> expressionExperiments)
- Specified by:
getSampleRemovalEvents
in interfaceExpressionExperimentService
-
getSubSets
@Transactional(readOnly=true) public Collection<ExpressionExperimentSubSet> getSubSets(ExpressionExperiment expressionExperiment)
- Specified by:
getSubSets
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- any ExpressionExperimentSubSets this Experiment might have.
-
getTaxa
@Transactional(readOnly=true) public <T extends BioAssaySet> Map<T,Taxon> getTaxa(Collection<T> bioAssaySets)
Description copied from interface:ExpressionExperimentService
Return the taxon for each of the given experiments (or subsets).- Specified by:
getTaxa
in interfaceExpressionExperimentService
-
getTaxon
@Transactional(readOnly=true) public Taxon getTaxon(BioAssaySet bioAssaySet)
Description copied from interface:ExpressionExperimentService
Returns the taxon of the given experiment or subset.- Specified by:
getTaxon
in interfaceExpressionExperimentService
- Parameters:
bioAssaySet
- bioAssaySet.- Returns:
- taxon, or null if the experiment taxon cannot be determined (i.e., if it has no samples).
-
isRNASeq
@Transactional(readOnly=true) public boolean isRNASeq(ExpressionExperiment expressionExperiment)
- Specified by:
isRNASeq
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- ee- Returns:
- true if this experiment was run on a sequencing-based platform.
-
isTroubled
@Transactional(readOnly=true) public boolean isTroubled(ExpressionExperiment ee)
Description copied from interface:ExpressionExperimentService
Check if the dataset is either troubled or uses a troubled platform.- Specified by:
isTroubled
in interfaceExpressionExperimentService
- Parameters:
ee
- the expression experiment to be checked for trouble. This method will usually be preferred over checking the curation details of the object directly, as this method also checks all the array designs the given experiment belongs to.- Returns:
- true, if the given experiment, or any of its parenting array designs is troubled. False otherwise
-
loadDetailsValueObjects
@Transactional(readOnly=true) public Slice<ExpressionExperimentDetailsValueObject> loadDetailsValueObjects(@Nullable Collection<Long> ids, @Nullable Taxon taxon, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadDetailsValueObjects
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.loadDetailsValueObjects(Collection, Taxon, Sort, int, int)
-
loadDetailsValueObjectsWithCache
@Transactional(readOnly=true) public Slice<ExpressionExperimentDetailsValueObject> loadDetailsValueObjectsWithCache(Collection<Long> ids, @Nullable Taxon taxon, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadDetailsValueObjectsWithCache
in interfaceExpressionExperimentService
-
loadDetailsValueObjectsByIds
@Transactional(readOnly=true) public List<ExpressionExperimentDetailsValueObject> loadDetailsValueObjectsByIds(Collection<Long> ids)
- Specified by:
loadDetailsValueObjectsByIds
in interfaceExpressionExperimentService
-
loadDetailsValueObjectsByIdsWithCache
@Transactional(readOnly=true) public List<ExpressionExperimentDetailsValueObject> loadDetailsValueObjectsByIdsWithCache(Collection<Long> ids)
- Specified by:
loadDetailsValueObjectsByIdsWithCache
in interfaceExpressionExperimentService
-
loadBlacklistedValueObjects
@Transactional(readOnly=true) public Slice<ExpressionExperimentValueObject> loadBlacklistedValueObjects(@Nullable Filters filters, @Nullable Sort sort, int offset, int limit)
- Specified by:
loadBlacklistedValueObjects
in interfaceExpressionExperimentService
-
loadLackingFactors
@Transactional(readOnly=true) public Collection<ExpressionExperiment> loadLackingFactors()
- Specified by:
loadLackingFactors
in interfaceExpressionExperimentService
-
loadLackingTags
@Transactional(readOnly=true) public Collection<ExpressionExperiment> loadLackingTags()
- Specified by:
loadLackingTags
in interfaceExpressionExperimentService
-
loadValueObjectsByIdsWithRelationsAndCache
@Transactional(readOnly=true) public List<ExpressionExperimentValueObject> loadValueObjectsByIdsWithRelationsAndCache(List<Long> ids)
Description copied from interface:ExpressionExperimentService
Load VOs for the given dataset IDs and initialize their relations likeCuratableService.load(Filters, Sort)
.The order of VOs is preserved.
- Specified by:
loadValueObjectsByIdsWithRelationsAndCache
in interfaceExpressionExperimentService
-
loadValueObjectsByIds
@Transactional(readOnly=true) public List<ExpressionExperimentValueObject> loadValueObjectsByIds(List<Long> ids, boolean maintainOrder)
Description copied from interface:ExpressionExperimentService
Variant ofCuratableService.loadValueObjectsByIds(Collection)
that preserve its input order.- Specified by:
loadValueObjectsByIds
in interfaceExpressionExperimentService
- Parameters:
ids
- ids to loadmaintainOrder
- If true, order of valueObjects returned will correspond to order of ids passed in.- Returns:
- value objects
-
addCharacteristic
@Transactional public void addCharacteristic(ExpressionExperiment ee, Characteristic vc)
Will add the characteristic to the expression experiment and persist the changes.- Specified by:
addCharacteristic
in interfaceExpressionExperimentService
- Parameters:
ee
- the experiment to add the characteristics to.vc
- If the evidence code is null, it will be filled in with IC. A category and value must be provided.
-
thaw
@Transactional(readOnly=true) public ExpressionExperiment thaw(ExpressionExperiment expressionExperiment)
- Specified by:
thaw
in interfaceExpressionExperimentService
-
thawBioAssays
@Transactional(readOnly=true) public ExpressionExperiment thawBioAssays(ExpressionExperiment expressionExperiment)
- Specified by:
thawBioAssays
in interfaceExpressionExperimentService
-
thawLite
@Transactional(readOnly=true) public ExpressionExperiment thawLite(ExpressionExperiment expressionExperiment)
Description copied from interface:ExpressionExperimentService
Partially thaw the expression experiment given - do not thaw the raw data.- Specified by:
thawLite
in interfaceExpressionExperimentService
- Parameters:
expressionExperiment
- experiment- Returns:
- thawed experiment
-
thawLiter
@Transactional(readOnly=true) public ExpressionExperiment thawLiter(ExpressionExperiment expressionExperiment)
- Specified by:
thawLiter
in interfaceExpressionExperimentService
-
remove
@Transactional public void remove(Long id)
Description copied from interface:BaseImmutableService
Removes the entity with given ID from the persistent storage.- Specified by:
remove
in interfaceBaseImmutableService<ExpressionExperiment>
- Specified by:
remove
in interfaceCuratableService<ExpressionExperiment,ExpressionExperimentValueObject>
- Overrides:
remove
in classAbstractService<ExpressionExperiment>
- Parameters:
id
- the ID of entity to be removed.
-
remove
@Transactional public void remove(ExpressionExperiment ee)
Deletes an experiment and all of its associated objects, including coexpression links. Some types of associated objects may need to be deleted before this can be run (example: analyses involving multiple experiments; these will not be deleted automatically).- Specified by:
remove
in interfaceBaseImmutableService<ExpressionExperiment>
- Specified by:
remove
in interfaceCuratableService<ExpressionExperiment,ExpressionExperimentValueObject>
- Overrides:
remove
in classAbstractService<ExpressionExperiment>
- Parameters:
ee
- the entity to be removed.
-
remove
@Transactional public void remove(Collection<ExpressionExperiment> entities)
Description copied from interface:BaseImmutableService
Removes all the given entities from persistent storage.- Specified by:
remove
in interfaceBaseImmutableService<ExpressionExperiment>
- Overrides:
remove
in classAbstractService<ExpressionExperiment>
- Parameters:
entities
- the entities to be removed.
-
isBlackListed
@Transactional(readOnly=true) public boolean isBlackListed(String geoAccession)
- Specified by:
isBlackListed
in interfaceExpressionExperimentService
-
isSuitableForDEA
@Transactional(readOnly=true) public Boolean isSuitableForDEA(ExpressionExperiment ee)
- Specified by:
isSuitableForDEA
in interfaceExpressionExperimentService
- Returns:
- true if the experiment is not explicitly marked as unsuitable for DEA; false otherwise.
-
getExperimentsLackingPublications
@Transactional(readOnly=true) public Collection<ExpressionExperiment> getExperimentsLackingPublications()
- Specified by:
getExperimentsLackingPublications
in interfaceExpressionExperimentService
- Returns:
- collection of GEO experiments which lack an association with a publication (non-GEO experiments will be ignored)
-
updateMeanVarianceRelation
@Transactional public MeanVarianceRelation updateMeanVarianceRelation(ExpressionExperiment ee, MeanVarianceRelation mvr)
- Specified by:
updateMeanVarianceRelation
in interfaceExpressionExperimentService
-
countBioMaterials
@Transactional(readOnly=true) public long countBioMaterials(@Nullable Filters filters)
- Specified by:
countBioMaterials
in interfaceExpressionExperimentService
- See Also:
ExpressionExperimentDao.countBioMaterials(Filters)
-
getFilterablePropertyConfigAttributes
public Collection<org.springframework.security.access.ConfigAttribute> getFilterablePropertyConfigAttributes(String property)
Checks for special properties that are allowed to be referenced on certain objects. E.g. characteristics on EEs. Obtain the Spring Security config attributes for a given property.- Specified by:
getFilterablePropertyConfigAttributes
in interfaceFilteringService<ExpressionExperiment>
- Overrides:
getFilterablePropertyConfigAttributes
in classAbstractFilteringVoEnabledService<ExpressionExperiment,ExpressionExperimentValueObject>
- Returns:
- the config attributes, or null if no security check should be performed
-
-