Interface BioMaterialService
- All Superinterfaces:
BaseImmutableService<BioMaterial>, BaseReadOnlyService<BioMaterial>, BaseService<BioMaterial>, BaseVoEnabledService<BioMaterial, BioMaterialValueObject>, SecurableBaseImmutableService<BioMaterial>, SecurableBaseReadOnlyService<BioMaterial>, SecurableBaseService<BioMaterial>, SecurableBaseVoEnabledService<BioMaterial, BioMaterialValueObject>
- All Known Implementing Classes:
BioMaterialServiceImpl
public interface BioMaterialService
extends SecurableBaseService<BioMaterial>, SecurableBaseVoEnabledService<BioMaterial, BioMaterialValueObject>
- Author:
- kelsey
-
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(ExpressionExperiment owner, BioMaterial bm, Characteristic vc) Per-tag add of a characteristic to a biomaterial, the sample-level counterpart ofExpressionExperimentService.addAnnotation(ExpressionExperiment, Characteristic).addAnnotation(ExpressionExperiment owner, BioMaterial bm, Characteristic vc, String reason) AsaddAnnotation(ExpressionExperiment, BioMaterial, Characteristic), with a caller-supplied reason appended to the audit note after the server's own description.voidWill persist the give vocab characteristic to the given biomaterial<T> voidassociateBatchFactor(Map<BioMaterial, T> descriptors, Map<T, FactorValue> d2fv) Associate dates with bioassays and any new factors with the biomaterials.copy(BioMaterial bioMaterial) Copies a bioMaterial.findByExperiment(ExpressionExperiment experiment) findByFactor(ExperimentalFactor experimentalFactor) findSiblings(BioMaterial bioMaterial) Find the siblings of a given biomaterial.findSubBioMaterials(BioMaterial bioMaterial, boolean direct) <T extends Exception>
BioMaterialloadAndThawOrFail(Long bmId, Function<String, T> exceptionSupplier, String message) removeAnnotation(ExpressionExperiment owner, BioMaterial bm, Long annotationId) Per-tag remove of a characteristic from a biomaterial by id, the sample-level counterpart ofExpressionExperimentService.removeAnnotation(ExpressionExperiment, Long).removeAnnotation(ExpressionExperiment owner, BioMaterial bm, Long annotationId, String reason) AsremoveAnnotation(ExpressionExperiment, BioMaterial, Long), with a caller-supplied reason appended to the audit note.voidRemove the given characteristic from the given biomaterialthaw(Collection<BioMaterial> bioMaterials) thaw(BioMaterial bioMaterial) intupdateAnnotations(ExpressionExperiment owner, BioMaterial bm, Collection<Characteristic> desired) Idempotent set-replace for a biomaterial's direct characteristic set, the sample-level counterpart ofExpressionExperimentService.updateAnnotations(ExpressionExperiment, Collection).updateBioMaterials(Collection<BioMaterialValueObject> valueObjects) Update the biomaterials that are described by the given valueObjects.Methods inherited from interface BaseReadOnlyService
countAll, getElementClass, loadOrFail, loadOrFailMethods inherited from interface SecurableBaseImmutableService
create, create, findOrCreate, remove, removeMethods inherited from interface SecurableBaseReadOnlyService
find, findOrFail, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, streamAll, streamAllMethods inherited from interface SecurableBaseService
save, save, update, updateMethods inherited from interface SecurableBaseVoEnabledService
loadAllValueObjects, loadValueObject, loadValueObjectById, loadValueObjects, loadValueObjectsByIds
-
Method Details
-
copy
Copies a bioMaterial.- Parameters:
bioMaterial- ba to copy- Returns:
- the copy
-
findSubBioMaterials
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<BioMaterial> findSubBioMaterials(BioMaterial bioMaterial, boolean direct) - See Also:
-
findSiblings
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<BioMaterial> findSiblings(BioMaterial bioMaterial) Find the siblings of a given biomaterial. -
findByExperiment
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<BioMaterial> findByExperiment(ExpressionExperiment experiment) -
findByFactor
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<BioMaterial> findByFactor(ExperimentalFactor experimentalFactor) -
loadAndThawOrFail
@Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostAuthorize("returnObject == null or hasPermission(returnObject, 'READ') or hasPermission(returnObject, 'ADMINISTRATION')") <T extends Exception> BioMaterial loadAndThawOrFail(Long bmId, Function<String, T> exceptionSupplier, String message) throws T- Throws:
T
-
getExpressionExperiments
@Nullable @Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostFilter("hasPermission(filterObject.key, 'READ') or hasPermission(filterObject.key, 'ADMINISTRATION')") Map<BioMaterial, Map<BioAssay, ExpressionExperiment>> getExpressionExperiments(BioMaterial bm) -
thaw
@CheckReturnValue @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) BioMaterial thaw(BioMaterial bioMaterial) -
thaw
@CheckReturnValue @Secured("IS_AUTHENTICATED_ANONYMOUSLY") @PostFilter("hasPermission(filterObject, 'READ') or hasPermission(filterObject, 'ADMINISTRATION')") Collection<BioMaterial> thaw(Collection<BioMaterial> bioMaterials) -
updateBioMaterials
@Secured("GROUP_ADMIN") Collection<BioMaterial> updateBioMaterials(Collection<BioMaterialValueObject> valueObjects) Update the biomaterials that are described by the given valueObjects. This is used to update experimental designs in particular.- Parameters:
valueObjects- VOs- Returns:
- the biomaterials that were modified.
-
associateBatchFactor
@Secured("GROUP_ADMIN") <T> void associateBatchFactor(Map<BioMaterial, T> descriptors, Map<T, FactorValue> d2fv) Associate dates with bioassays and any new factors with the biomaterials. Note we can have missing values.- Parameters:
d2fv- map of dates to factor values
-
addCharacteristic
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void addCharacteristic(BioMaterial bm, Characteristic vc) Will persist the give vocab characteristic to the given biomaterial- See Also:
-
removeCharacteristics
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void removeCharacteristics(BioMaterial bm, Collection<Characteristic> vc) Remove the given characteristic from the given biomaterial- Throws:
IllegalArgumentException- if the characteristic does not belong to the biomaterial
-
updateAnnotations
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) int updateAnnotations(ExpressionExperiment owner, BioMaterial bm, Collection<Characteristic> desired) Idempotent set-replace for a biomaterial's direct characteristic set, the sample-level counterpart ofExpressionExperimentService.updateAnnotations(ExpressionExperiment, Collection).The
ownerexperiment is the audit + ACL target: theManualAnnotationEventis recorded on the experiment (not the sample) andACL_SECURABLE_EDITis checked against it, so all tag edits — experiment- or sample-level — surface on the experiment's history and share one permission gate. The diff is statement-aware (seeCharacteristicUtils.sameTag(Characteristic, Characteristic)).- Parameters:
owner- the experiment that ownsbm(audit + ACL target)bm- the biomaterial whose characteristics are replaceddesired- the full desired characteristic set (empty clears)- Returns:
- the number of changes (adds + removes); zero means the set was already as desired
-
addAnnotation
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) Characteristic addAnnotation(ExpressionExperiment owner, BioMaterial bm, Characteristic vc) Per-tag add of a characteristic to a biomaterial, the sample-level counterpart ofExpressionExperimentService.addAnnotation(ExpressionExperiment, Characteristic). Records aTagAddedEventonownerand rejects a duplicate (by statement-awaresameTag) withIllegalArgumentException.- Parameters:
owner- the experiment that ownsbm(audit + ACL target)- Returns:
- the persisted characteristic
-
addAnnotation
Characteristic addAnnotation(ExpressionExperiment owner, BioMaterial bm, Characteristic vc, @Nullable String reason) AsaddAnnotation(ExpressionExperiment, BioMaterial, Characteristic), with a caller-supplied reason appended to the audit note after the server's own description. -
removeAnnotation
@Nullable @Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) Characteristic removeAnnotation(ExpressionExperiment owner, BioMaterial bm, Long annotationId) Per-tag remove of a characteristic from a biomaterial by id, the sample-level counterpart ofExpressionExperimentService.removeAnnotation(ExpressionExperiment, Long). Records aTagRemovedEventonowner; returnsnullwhen the id is not inbm's characteristic set so the caller can surface a 404.- Parameters:
owner- the experiment that ownsbm(audit + ACL target)
-
removeAnnotation
Characteristic removeAnnotation(ExpressionExperiment owner, BioMaterial bm, Long annotationId, @Nullable String reason) AsremoveAnnotation(ExpressionExperiment, BioMaterial, Long), with a caller-supplied reason appended to the audit note. A deletion has no surviving annotation to carry evidence, so this is the only place its reason can be recorded.
-