Interface GeneSetService
- All Superinterfaces:
BaseImmutableService<GeneSet>,BaseReadOnlyService<GeneSet>,BaseService<GeneSet>,BaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>
- All Known Implementing Classes:
GeneSetServiceImpl
@ParametersAreNonnullByDefault
public interface GeneSetService
extends BaseService<GeneSet>, BaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>
Service for managing gene sets
- Author:
- kelsey, paul
-
Method Summary
Modifier and TypeMethodDescriptioncreate(Collection<GeneSet> sets) Creates all the given entities in a persistent storageCreates the given entity in the persistent storage.create an entity in the database based on the value object parametervoidSecurity is handled within methodvoidSecurity is handled within method, when the set is loadedfindByGene(Gene gene) Return all sets that contain the given gene.findByName(String name) findByName(String name, Taxon taxon) findGeneSetsByGene(Long geneId) Given a Gemma Gene Id, find all the gene groups it is a member of (filtering is handled when gene sets are loaded)findGeneSetsByName(String query, Long taxonId) getGeneIdsInGroup(GeneSetValueObject geneSetVO) getGenesInGroup(GeneSetValueObject object) Get the gene value objects for the members of the group paramintgetSize(GeneSetValueObject geneSetVO) Obtain all the taxa for the members of a given gene set.get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genesget the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genesgetUsersGeneGroups(boolean privateOnly, Long taxonId, boolean sharedPublicOnly) getUsersGeneGroupsValueObjects(boolean privateOnly, Long taxonId) Returns just the current users gene setsLoads object with given ID.load(Collection<Long> ids) Loads objects with given ids.loadAll()Loads all the entities of specific type.Loads value objects representing all the entities of specific type.Returns theGeneSets for the currently logged inUser- i.e, ones for which the current user has specific read permissions on (as opposed to data sets which are public).loadMyGeneSets(Taxon tax) loadOrFail(Long id) Convenience for runningBaseReadOnlyService.load(Long)and checking if the result is null.loadValueObject(GeneSet geneSet) loadValueObjectById(Long entityId) loadValueObjects(Collection<GeneSet> entities) Loads value objects for all given entities.Ids of member genes will be filled inloadValueObjectsByIdsLite(Collection<Long> geneSetIds) loadWithMembers(Collection<Long> ids) Load the gene sets with their members initialized.voidRemoves the entity with given ID from the persistent storage.voidremove(Collection<GeneSet> entities) Removes all the given entities from persistent storage.voidRemoves the given entity from the persistent storage.intsave(Collection<GeneSet> entities) voidupdate(Collection<GeneSet> entities) Updates all entities in the given collection in the persistent storage.voidUpdates the given entity in the persistent storage.AJAX Updates the database entity (permission permitting) with the fields of the param value objectvoidupdateDatabaseEntityMembers(Long groupId, Collection<Long> geneIds) Updates the database record for the param gene set value object (permission permitting) with the members specified of the set, not the name or description etc.AJAX Updates the database entity (permission permitting) with the name and description fields of the param value objectMethods inherited from interface ubic.gemma.persistence.service.BaseImmutableService
findOrCreateMethods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, find, findOrFail, getElementClass, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, streamAll, streamAll
-
Method Details
-
loadWithMembers
Load the gene sets with their members initialized. -
create
Description copied from interface:BaseImmutableServiceCreates all the given entities in a persistent storage- Specified by:
createin interfaceBaseImmutableService<GeneSet>- Parameters:
sets- the entities to be created.- Returns:
- collection of objects referencing the persistent instances of given entities.
-
create
Description copied from interface:BaseImmutableServiceCreates the given entity in the persistent storage.- Specified by:
createin interfaceBaseImmutableService<GeneSet>- Parameters:
geneset- the entity to be created.- Returns:
- object referencing the persistent instance of the given entity.
-
save
- Specified by:
savein interfaceBaseService<GeneSet>- See Also:
-
save
- Specified by:
savein interfaceBaseService<GeneSet>- See Also:
-
findByGene
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> findByGene(Gene gene) Return all sets that contain the given gene.GeneSetDao- Parameters:
gene- gene- Returns:
- gene sets
- See Also:
-
loadValueObject
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) DatabaseBackedGeneSetValueObject loadValueObject(GeneSet geneSet) - Specified by:
loadValueObjectin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - See Also:
-
loadValueObjectById
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) DatabaseBackedGeneSetValueObject loadValueObjectById(Long entityId) - Specified by:
loadValueObjectByIdin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - See Also:
-
loadValueObjectByIdLite
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) DatabaseBackedGeneSetValueObject loadValueObjectByIdLite(Long id) -
loadValueObjects
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<DatabaseBackedGeneSetValueObject> loadValueObjects(Collection<GeneSet> entities) Description copied from interface:BaseVoEnabledServiceLoads value objects for all given entities.- Specified by:
loadValueObjectsin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Parameters:
entities- the entities to be converted to value objects- Returns:
- a collection of value objects representing he given entities.
-
loadValueObjectsByIds
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIds(Collection<Long> ids) Ids of member genes will be filled in- Specified by:
loadValueObjectsByIdsin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Parameters:
ids- ids- Returns:
- gene set value object
-
loadValueObjectsByIdsLite
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIdsLite(Collection<Long> geneSetIds) -
loadAllValueObjects
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) List<DatabaseBackedGeneSetValueObject> loadAllValueObjects()Description copied from interface:BaseVoEnabledServiceLoads value objects representing all the entities of specific type.- Specified by:
loadAllValueObjectsin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Returns:
- a collection of value objects
-
findByName
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> findByName(String name) - Parameters:
name- name- Returns:
- gene sets
- See Also:
-
findByName
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> findByName(String name, Taxon taxon) - Parameters:
name- nametaxon- taxon- Returns:
- gene sets
- See Also:
-
load
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> load(Collection<Long> ids) Description copied from interface:BaseReadOnlyServiceLoads objects with given ids.- Specified by:
loadin interfaceBaseReadOnlyService<GeneSet>- Parameters:
ids- the ids of objects to be loaded.- Returns:
- collection containing object with given IDs.
-
loadOrFail
@Nonnull @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) GeneSet loadOrFail(Long id) throws NullPointerException Description copied from interface:BaseReadOnlyServiceConvenience for runningBaseReadOnlyService.load(Long)and checking if the result is null.- Specified by:
loadOrFailin interfaceBaseReadOnlyService<GeneSet>- Parameters:
id- the ID used to retrieve the entity- Returns:
- the entity as per
BaseReadOnlyService.load(Long), never null - Throws:
NullPointerException- if the entity does not exist in the persistent storage
-
load
Description copied from interface:BaseReadOnlyServiceLoads object with given ID.- Specified by:
loadin interfaceBaseReadOnlyService<GeneSet>- Parameters:
id- the ID of entity to be loaded.- Returns:
- the entity with matching ID, or null if the entity does not exist or if the passed ID was null
-
loadAll
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> loadAll()Description copied from interface:BaseReadOnlyServiceLoads all the entities of specific type.- Specified by:
loadAllin interfaceBaseReadOnlyService<GeneSet>- Returns:
- collection of all entities currently available in the persistent storage.
-
loadAll
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_COLLECTION_READ"}) Collection<GeneSet> loadAll(@Nullable Taxon tax) - Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
Returns theGeneSets for the currently logged inUser- i.e, ones for which the current user has specific read permissions on (as opposed to data sets which are public). Important: This method will return all gene sets if security is not enabled. Implementation note: Via a methodInvocationFilter. See AclAfterFilterCollectionForMyData for processConfigAttribute.- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
-
createDatabaseEntity
create an entity in the database based on the value object parameter- Parameters:
gsvo- gene set value object- Returns:
- value object converted from the newly created entity
-
findGeneSetsByGene
Given a Gemma Gene Id, find all the gene groups it is a member of (filtering is handled when gene sets are loaded)- Parameters:
geneId- gene id- Returns:
- collection of geneSetValueObject
-
updateDatabaseEntityNameDesc
DatabaseBackedGeneSetValueObject updateDatabaseEntityNameDesc(DatabaseBackedGeneSetValueObject geneSetVO) AJAX Updates the database entity (permission permitting) with the name and description fields of the param value object- Parameters:
geneSetVO- gene set value object- Returns:
- value objects for the updated entities
-
updateDatabaseEntityMembers
Updates the database record for the param gene set value object (permission permitting) with the members specified of the set, not the name or description etc.- Parameters:
groupId- group idgeneIds- gene ids
-
updateDatabaseEntity
Collection<DatabaseBackedGeneSetValueObject> updateDatabaseEntity(Collection<DatabaseBackedGeneSetValueObject> geneSetVos) AJAX Updates the database entity (permission permitting) with the fields of the param value object- Parameters:
geneSetVos- gene sets- Returns:
- value objects for the updated entities
-
deleteDatabaseEntity
Security is handled within method, when the set is loaded- Parameters:
geneSetVO- gene set VO
-
deleteDatabaseEntities
Security is handled within method- Parameters:
vos- gene set value objects
-
getUsersGeneGroups
@Secured("GROUP_USER") Collection<GeneSet> getUsersGeneGroups(boolean privateOnly, @Nullable Long taxonId, boolean sharedPublicOnly) - Parameters:
privateOnly- only return private sets owned by the user or private sets shared with the usertaxonId- if non-null, restrict the groups by ones which have genes in the given taxon (can be null)sharedPublicOnly- if true, the only public sets returned will be those that are owned by the user or have been shared with the user. If param privateOnly is true, this will have no effect.- Returns:
- all the gene sets user can see, with optional restrictions based on taxon and whether the set is public or private
-
getUsersGeneGroupsValueObjects
@Secured({"GROUP_USER","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) Collection<DatabaseBackedGeneSetValueObject> getUsersGeneGroupsValueObjects(boolean privateOnly, Long taxonId) Returns just the current users gene sets- Parameters:
privateOnly- only privatetaxonId- if non-null, restrict the groups by ones which have genes in the given taxon.- Returns:
- gene set value objects
-
getGenesInGroup
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<GeneValueObject> getGenesInGroup(GeneSetValueObject object) Get the gene value objects for the members of the group param- Parameters:
object- can be just a wrapper to trigger security- Returns:
- gene value object
-
getGeneIdsInGroup
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) Collection<Long> getGeneIdsInGroup(GeneSetValueObject geneSetVO) -
getSize
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","ACL_SECURABLE_READ"}) int getSize(GeneSetValueObject geneSetVO) -
findGeneSetsByName
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_COLLECTION_READ"}) Collection<GeneSetValueObject> findGeneSetsByName(String query, @Nullable Long taxonId) throws SearchException - Parameters:
query- string to match to gene setstaxonId- taxon id- Returns:
- collection of GeneSetValueObjects that match name query
- Throws:
SearchException
-
getTaxonVOforGeneSetVO
get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Parameters:
geneSetVO- gene set value object- Returns:
- the taxon or null if the gene set param was null
-
getTaxon
get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Parameters:
geneSet- gene set- Returns:
- a taxon, or null if the gene set has no member
-
getTaxa
Obtain all the taxa for the members of a given gene set. -
update
Description copied from interface:BaseServiceUpdates the given entity in the persistent storage.- Specified by:
updatein interfaceBaseService<GeneSet>- Parameters:
entity- the entity to be updated.
-
update
Description copied from interface:BaseServiceUpdates all entities in the given collection in the persistent storage.- Specified by:
updatein interfaceBaseService<GeneSet>- Parameters:
entities- the entities to be updated.
-
remove
Description copied from interface:BaseImmutableServiceRemoves the given entity from the persistent storage.- Specified by:
removein interfaceBaseImmutableService<GeneSet>- Parameters:
entity- the entity to be removed.
-
remove
Description copied from interface:BaseImmutableServiceRemoves all the given entities from persistent storage.- Specified by:
removein interfaceBaseImmutableService<GeneSet>- Parameters:
entities- the entities to be removed.
-
remove
Description copied from interface:BaseImmutableServiceRemoves the entity with given ID from the persistent storage.- Specified by:
removein interfaceBaseImmutableService<GeneSet>- Parameters:
id- the ID of entity to be removed.
-
removeAll
@Secured("GROUP_ADMIN") int removeAll()
-