Class DatasetArgService
- All Implemented Interfaces:
EntityArgService<ExpressionExperiment, ExpressionExperimentService>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classResult of an applyDesignChange call. -
Field Summary
Fields inherited from class AbstractEntityArgService
service -
Constructor Summary
ConstructorsConstructorDescriptionDatasetArgService(ExpressionExperimentService service, SearchService searchService, ArrayDesignService adService, BioAssayService baService, OutlierDetectionService outlierDetectionService, PublicationAssociationService publicationAssociationService) -
Method Summary
Modifier and TypeMethodDescriptionapplyDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed, boolean force) Validate and apply a proposed design replacement.getAnnotations(DatasetArg<?> arg) getAnnotations(DatasetArg<?> arg, boolean includeFreeText) getBlacklistedDatasetsByCursor(Filters filters, Cursor cursor, int limit) Cursor-mode counterpart toExpressionExperimentService.loadBlacklistedValueObjects(Filters, Sort, int, int).getDatasetsByCursor(Filters filters, Cursor cursor, int limit) Cursor-mode counterpart toSecurableFilteringVoEnabledService.loadValueObjects(Filters, Sort, int, int).getEntityId(DatasetArg<?> datasetArg) Retrieve an ID for a given dataset argument.getExcludedUris(StringArrayArg excludedUrisArg, boolean excludeFreeText, boolean excludeUncategorizedTerms) Obtain a list of exclude URIs from an argument containing excluded URIs.getExperimentalDesign(DatasetArg<?> arg) getFilters(FilterArg<ExpressionExperiment> filterArg) Obtain aFiltersfrom a filter argument.getFilters(FilterArg<ExpressionExperiment> filterArg, Collection<OntologyTerm> mentionedTerms, Collection<OntologyTerm> inferredTerms) getFilters(FilterArg<ExpressionExperiment> filterArg, Collection<OntologyTerm> mentionedTerms, Collection<OntologyTerm> inferredTerms, long timeout, TimeUnit timeUnit) getIdsForSearchQuery(QueryArg query, Collection<Throwable> queryWarnings) Shortcut for extracting the result IDs fromgetResultsForSearchQuery(QueryArg, Highlighter, Collection).getIdsForSearchQuery(QueryArg query, Map<Long, Double> scoreById, Collection<Throwable> queryWarnings) Shortcut for extracting the result IDs and scores fromgetResultsForSearchQuery(QueryArg, Highlighter, Collection).getOriginalPlatforms(DatasetArg<?> arg) The platforms the dataset was originally submitted on, before any switch — empty when it was never switched.getPlatforms(DatasetArg<?> arg) Retrieves the Platforms of the Dataset that this argument represents.getPreferredQuantitationType(DatasetArg<?> datasetArg) getPublications(DatasetArg<?> datasetArg) getPublications(DatasetArg<?> datasetArg, boolean includeRejected) A dataset's publications, each carrying the evidenced claim that attaches it.getQuantitationTypes(DatasetArg<?> arg) Retrieve a dataset with quantitation type initialized.getResultsForSearchQuery(QueryArg query, Highlighter highlighter, Collection<Throwable> queryWarnings) Obtain the search results for a given query and highlighter.getSamples(DatasetArg<?> arg, boolean includePredictedOutliers) getSamples(DatasetArg<?> datasetArg, QuantitationType qt, boolean includePredictedOutliers) Obtain a collection of BioAssays that represent the experiments samples for a particular quantitation type.getSamplesByCursor(DatasetArg<?> arg, Cursor cursor, int limit, boolean includePredictedOutliers) Cursor-mode counterpart togetSamples(DatasetArg, boolean)for theGET /datasets/{dataset}/samplesendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1k.getSubSet(DatasetArg<?> datasetArg, Long subSetId) getSubSetGroupIds(DatasetArg<?> datasetArg, ExpressionExperimentSubSet subset) getSubSets(DatasetArg<?> datasetArg) getSubSetSamples(DatasetArg<?> datasetArg, Long subSetId, boolean includePredictedOutliers) getSubSetSamplesByCursor(DatasetArg<?> datasetArg, Long subSetId, Cursor cursor, int limit, boolean includePredictedOutliers) Cursor-mode counterpart togetSubSetSamples(DatasetArg, Long, boolean)for theGET /datasets/{dataset}/subSets/{subSet}/samplesendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1u (the subset-scoped twin of step 1k forGET /datasets/{dataset}/samples).getSubSetsGroupIds(DatasetArg<?> datasetArg) voidpopulateOutliers(ExpressionExperiment ee, Collection<BioAssayValueObject> bioAssayValueObjects) SetBioAssayValueObject.getPredictedOutlier()from the median-correlation algorithm.previewDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed) Run a dry-run preflight for the proposed design replacement.previewDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed, DesignCommitPlan plan) Run a dry-run preflight for a design commit, counting the bindingsplandefers to a second apply pass.Methods inherited from class AbstractEntityArgService
checkEntity, entityArgValueOf, getArgsByPropertyName, getElementClass, getEntities, getEntities, getEntity, getFilterableProperties, getFilterablePropertyAllowedValues, getFilterablePropertyConfigAttributes, getFilterablePropertyDescription, getFilterablePropertyResolvableAllowedValuesLabels, getFilterablePropertyType, getFilters, getFilters, getSort, isFilterablePropertyDeprecated, isFilterablePropertyUsingSubquery
-
Constructor Details
-
DatasetArgService
@Autowired public DatasetArgService(ExpressionExperimentService service, SearchService searchService, ArrayDesignService adService, BioAssayService baService, OutlierDetectionService outlierDetectionService, PublicationAssociationService publicationAssociationService)
-
-
Method Details
-
getEntityId
Retrieve an ID for a given dataset argument. -
getExcludedUris
@Nullable public List<String> getExcludedUris(@Nullable StringArrayArg excludedUrisArg, boolean excludeFreeText, boolean excludeUncategorizedTerms) Obtain a list of exclude URIs from an argument containing excluded URIs.- Parameters:
excludedUrisArg- argument containing excluded URIs or null if unspecifiedexcludeFreeText- if true, null will be included in the returned list which will result in the exclusion of free-text categories or terms- Returns:
- null if excludedUrisArg is null and excludeFreeText is false, otherwise a list of excluded URIs
-
getFilters
public Filters getFilters(FilterArg<ExpressionExperiment> filterArg) throws jakarta.ws.rs.BadRequestException, jakarta.ws.rs.ServiceUnavailableException Description copied from interface:EntityArgServiceObtain aFiltersfrom a filter argument.- Specified by:
getFiltersin interfaceEntityArgService<ExpressionExperiment, ExpressionExperimentService>- Overrides:
getFiltersin classAbstractEntityArgService<ExpressionExperiment, ExpressionExperimentService>- Throws:
jakarta.ws.rs.BadRequestException- if the argument is malformedjakarta.ws.rs.ServiceUnavailableException
-
getFilters
public Filters getFilters(FilterArg<ExpressionExperiment> filterArg, @Nullable Collection<OntologyTerm> mentionedTerms, @Nullable Collection<OntologyTerm> inferredTerms) throws jakarta.ws.rs.ServiceUnavailableException - Throws:
jakarta.ws.rs.ServiceUnavailableException
-
getFilters
public Filters getFilters(FilterArg<ExpressionExperiment> filterArg, @Nullable Collection<OntologyTerm> mentionedTerms, @Nullable Collection<OntologyTerm> inferredTerms, long timeout, TimeUnit timeUnit) throws TimeoutException - Throws:
TimeoutException
-
getDatasetsByCursor
public CursorPage<ExpressionExperimentValueObject> getDatasetsByCursor(@Nullable Filters filters, @Nullable Cursor cursor, int limit) Cursor-mode counterpart toSecurableFilteringVoEnabledService.loadValueObjects(Filters, Sort, int, int). Always sorts by ascendingid(the primary key, indexed and unique) — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1d. The caller'sFiltersstill applies (so endpoints likeGET /taxa/{taxon}/datasetscan pre-compose thetaxon.id = ?constraint into the filter and pass it through). The user's?sort=arg is intentionally not honoured in cursor mode because the DAO currently restricts cursors to single-component id sorts (recce sec. 3.4 — to be lifted in phase B once the index audit is complete). -
getBlacklistedDatasetsByCursor
public CursorPage<ExpressionExperimentValueObject> getBlacklistedDatasetsByCursor(@Nullable Filters filters, @Nullable Cursor cursor, int limit) Cursor-mode counterpart toExpressionExperimentService.loadBlacklistedValueObjects(Filters, Sort, int, int). Always sorts by ascendingid(the primary key, indexed and unique) — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1t (the EE-targeted twin of step 1h). The caller'sFiltersstill applies on top of the blacklist short-name/accession predicate composed inside the DAO. The user's?sort=arg is intentionally not honoured in cursor mode because the DAO currently restricts cursors to single-component id sorts (recce §3.4 — to be lifted in phase B once the index audit is complete). -
getResultsForSearchQuery
public List<SearchResult<ExpressionExperiment>> getResultsForSearchQuery(QueryArg query, @Nullable Highlighter highlighter, @Nullable Collection<Throwable> queryWarnings) throws jakarta.ws.rs.BadRequestException, jakarta.ws.rs.ServiceUnavailableException, jakarta.ws.rs.InternalServerErrorException Obtain the search results for a given query and highlighter.- Parameters:
highlighter- a highlighter to use for the query or null to ignorequeryWarnings- a collection that will receive warnings regarding the full-text query- Throws:
jakarta.ws.rs.BadRequestException- if the query is emptyjakarta.ws.rs.ServiceUnavailableException- if the search times outjakarta.ws.rs.InternalServerErrorException- for any other search-related exceptions
-
getIdsForSearchQuery
public Set<Long> getIdsForSearchQuery(QueryArg query, Map<Long, Double> scoreById, @Nullable Collection<Throwable> queryWarnings) Shortcut for extracting the result IDs and scores fromgetResultsForSearchQuery(QueryArg, Highlighter, Collection).- See Also:
-
getIdsForSearchQuery
public Set<Long> getIdsForSearchQuery(QueryArg query, @Nullable Collection<Throwable> queryWarnings) Shortcut for extracting the result IDs fromgetResultsForSearchQuery(QueryArg, Highlighter, Collection).- See Also:
-
getQuantitationTypes
Retrieve a dataset with quantitation type initialized. -
getPlatforms
Retrieves the Platforms of the Dataset that this argument represents.- Returns:
- a collection of Platforms that the dataset represented by this argument is in.
-
getOriginalPlatforms
The platforms the dataset was originally submitted on, before any switch — empty when it was never switched. Plural because a dataset's assays need not have come from one submitted platform. -
getSamples
- Returns:
- a collection of BioAssays that represent the experiments samples.
Uses the narrow
ExpressionExperimentService.thawBioAssays(ExpressionExperiment)thaw rather than the broaderthawLite: theBioAssayValueObjectctor only reads the per-assay shape (array design, original platform, biomaterial-with-factor-values), so warming the nine EE-level lazy collections thatthawLitetouches (publications, otherParts, factors, factor values, quantitation types, characteristics, accession, mean-variance, geeq, curationDetails) is dead pre-fetch on this code path. SeeSAMPLES_DESIGN_PERF_RECCE.mdfor the measurement.
-
getSamplesByCursor
public CursorPage<BioAssayValueObject> getSamplesByCursor(DatasetArg<?> arg, @Nullable Cursor cursor, int limit, boolean includePredictedOutliers) Cursor-mode counterpart togetSamples(DatasetArg, boolean)for theGET /datasets/{dataset}/samplesendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1k. Walks the EE→bioAssays association directly viaBioAssayService.loadValueObjectsByCursorForExpressionExperiment(ExpressionExperiment, Cursor, int); always sorts by ascendingid(the primary key, indexed and unique). ThethawLitestep is intentionally omitted in cursor mode because the keyset HQL fetches the assays directly (it doesn't iterateee.getBioAssays()as a lazy collection). Outliers are populated post-hoc on the returned page's data, matching the offset-mode VO shape.Note: this branch is taken only when no
quantitationType/useProcessedQuantitationTypeparameter is supplied — seeDatasetsWebService.getDatasetSamples(DatasetArg, QuantitationTypeArg, boolean, CursorArg, LimitArg, ExcludeArg, boolean). The QT-narrowed variants intentionally remain offset-mode (they sort byBioAssay::getNameand apply aBioAssayDimensionrestriction that is not expressible as anid-only cursor). -
getSamples
public List<BioAssayValueObject> getSamples(DatasetArg<?> datasetArg, QuantitationType qt, boolean includePredictedOutliers) Obtain a collection of BioAssays that represent the experiments samples for a particular quantitation type. -
getAnnotations
- Returns:
- a collection of Annotations value objects that represent the experiments annotations.
-
getAnnotations
- Parameters:
includeFreeText- also return tags with no ontology mapping- Returns:
- a collection of Annotations value objects that represent the experiments annotations.
-
getExperimentalDesign
- Returns:
- the full structured experimental design (factors, factor values with statements, and biomaterial to factor-value assignments).
-
previewDesignChange
public DesignPreflightReport previewDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed) Run a dry-run preflight for the proposed design replacement. -
previewDesignChange
public DesignPreflightReport previewDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed, DesignCommitPlan plan) Run a dry-run preflight for a design commit, counting the bindingsplandefers to a second apply pass. For the curation commit, which is the one caller that has a plan; a payload that can only name factor values that already exist goes throughpreviewDesignChange(DatasetArg, ExperimentalDesignValueObject).- See Also:
-
applyDesignChange
public DatasetArgService.DesignChangeResult applyDesignChange(DatasetArg<?> arg, ExperimentalDesignValueObject proposed, boolean force) Validate and apply a proposed design replacement.When the preflight report carries blockers, returns
DatasetArgService.DesignChangeResult.blocked(DesignPreflightReport)without mutating state. When the preflight report has no blockers butrequires consent— it would delete differential-expression analyses, or strand a subset on deleted factor values — andforceis false, returnsDatasetArgService.DesignChangeResult.forceRequired. Otherwise applies the change and returnsDatasetArgService.DesignChangeResult.ok(ExperimentalDesignValueObject)with the fresh design VO. -
getSubSets
-
getSubSet
-
getSubSetGroupIds
-
getSubSetsGroupIds
-
getSubSetSamples
public List<BioAssayValueObject> getSubSetSamples(DatasetArg<?> datasetArg, Long subSetId, boolean includePredictedOutliers) -
getSubSetSamplesByCursor
public CursorPage<BioAssayValueObject> getSubSetSamplesByCursor(DatasetArg<?> datasetArg, Long subSetId, @Nullable Cursor cursor, int limit, boolean includePredictedOutliers) Cursor-mode counterpart togetSubSetSamples(DatasetArg, Long, boolean)for theGET /datasets/{dataset}/subSets/{subSet}/samplesendpoint — seeCURSOR_PAGINATION_STEP1_PLAN.mdstep 1u (the subset-scoped twin of step 1k forGET /datasets/{dataset}/samples). Walks theExpressionExperimentSubSet→bioAssaysassociation directly viaBioAssayService.loadValueObjectsByCursorForSubSet(ExpressionExperimentSubSet, Cursor, int); always sorts by ascendingid(primary key, indexed and unique).The assay→source-assay mapping (used to populate the VO's
sourceBioAssayId) is built post-hoc against the subset's source experiment so the VO shape matches offset mode exactly. Outliers are also populated post-hoc on the returned page.Subset existence is validated up-front (mirroring the offset variant's
NotFoundExceptionon unknownsubSetId); thegetSubSetByIdWithCharacteristicsAndBioAssaysloader is reused intentionally — it returns the subset entity with its source experiment populated, which the source-assay map and outlier helpers both need, without forcing the fullsubset.bioAssayscollection to materialise (Hibernate lazy-loads on access). -
getPreferredQuantitationType
-
getPublications
-
getPublications
public List<DatasetPublicationValueObject> getPublications(DatasetArg<?> datasetArg, boolean includeRejected) A dataset's publications, each carrying the evidenced claim that attaches it.- Parameters:
includeRejected- also emit the publications that were considered and ruled out for this dataset. Off by default: a rejection is a record of a decision, not a publication of the dataset, and anything listing "the dataset's papers" must not pick them up by accident. Turn it on to see what a publication finder should not re-propose.
-
populateOutliers
public void populateOutliers(ExpressionExperiment ee, Collection<BioAssayValueObject> bioAssayValueObjects) SetBioAssayValueObject.getPredictedOutlier()from the median-correlation algorithm.This is expensive and does not scale with the number of VOs passed in: it loads the experiment's whole N×N sample-correlation matrix (
SampleCoexpressionMatrix.coexpressionMatrix, a LONGBLOB) to compute the prediction, so the cost is set by the correlation analysis, not by the page size. On experiments whose matrix is dimensioned over subset assays it reaches ~100 MB and the request exceeds the 60 s proxy timeout; becauseOutlierDetectionService.getOutlierDetails(ExpressionExperiment)caches only on completion, a request that times out never populates the cache and the next one pays the same cost again.Callers therefore opt in. The persisted, curator-facing
BioAssayValueObject.isOutlier()flag is read fromBIO_ASSAY.IS_OUTLIERby the VO constructor and is always present at no cost; only the algorithmic prediction needs this.
-