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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<GeneSet>create(Collection<GeneSet> sets)Creates all the given entities in a persistent storageGeneSetcreate(GeneSet geneset)Creates the given entity in the persistent storage.GeneSetValueObjectcreateDatabaseEntity(GeneSetValueObject gsvo)create an entity in the database based on the value object parametervoiddeleteDatabaseEntities(Collection<DatabaseBackedGeneSetValueObject> vos)Security is handled within methodvoiddeleteDatabaseEntity(DatabaseBackedGeneSetValueObject geneSetVO)Security is handled within method, when the set is loadedCollection<GeneSet>findByGene(Gene gene)Return all sets that contain the given gene.Collection<GeneSet>findByName(String name)Collection<GeneSet>findByName(String name, Taxon taxon)Collection<GeneSetValueObject>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)Collection<GeneSetValueObject>findGeneSetsByName(String query, Long taxonId)Collection<Long>getGeneIdsInGroup(GeneSetValueObject geneSetVO)Collection<GeneValueObject>getGenesInGroup(GeneSetValueObject object)Get the gene value objects for the members of the group paramintgetSize(GeneSetValueObject geneSetVO)Set<Taxon>getTaxa(GeneSet geneSet)Obtain all the taxa for the members of a given gene set.TaxongetTaxon(GeneSet geneSet)get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genesTaxonValueObjectgetTaxonVOforGeneSetVO(SessionBoundGeneSetValueObject geneSetVO)get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genesCollection<GeneSet>getUsersGeneGroups(boolean privateOnly, Long taxonId, boolean sharedPublicOnly)Collection<DatabaseBackedGeneSetValueObject>getUsersGeneGroupsValueObjects(boolean privateOnly, Long taxonId)Returns just the current users gene setsGeneSetload(Long id)Loads object with given ID.Collection<GeneSet>load(Collection<Long> ids)Loads objects with given ids.Collection<GeneSet>loadAll()Loads all the entities of specific type.Collection<GeneSet>loadAll(Taxon tax)List<DatabaseBackedGeneSetValueObject>loadAllValueObjects()Loads value objects representing all the entities of specific type.Collection<GeneSet>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).Collection<GeneSet>loadMyGeneSets(Taxon tax)Collection<GeneSet>loadMySharedGeneSets(Taxon tax)GeneSetloadOrFail(Long id)Convenience for runningBaseReadOnlyService.load(Long)and checking if the result is null.DatabaseBackedGeneSetValueObjectloadValueObject(GeneSet geneSet)DatabaseBackedGeneSetValueObjectloadValueObjectById(Long entityId)DatabaseBackedGeneSetValueObjectloadValueObjectByIdLite(Long id)List<DatabaseBackedGeneSetValueObject>loadValueObjects(Collection<GeneSet> entities)Loads value objects for all given entities.List<DatabaseBackedGeneSetValueObject>loadValueObjectsByIds(Collection<Long> ids)Ids of member genes will be filled inList<DatabaseBackedGeneSetValueObject>loadValueObjectsByIdsLite(Collection<Long> geneSetIds)voidremove(Long id)Removes the entity with given ID from the persistent storage.voidremove(Collection<GeneSet> entities)Removes all the given entities from persistent storage.voidremove(GeneSet entity)Removes the given entity from the persistent storage.intremoveAll()Collection<GeneSet>save(Collection<GeneSet> entities)GeneSetsave(GeneSet entity)voidupdate(Collection<GeneSet> entities)Updates all entities in the given collection in the persistent storage.voidupdate(GeneSet entity)Updates the given entity in the persistent storage.Collection<DatabaseBackedGeneSetValueObject>updateDatabaseEntity(Collection<DatabaseBackedGeneSetValueObject> geneSetVos)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.DatabaseBackedGeneSetValueObjectupdateDatabaseEntityNameDesc(DatabaseBackedGeneSetValueObject geneSetVO)AJAX Updates the database entity (permission permitting) with the name and description fields of the param value object-
Methods inherited from interface ubic.gemma.persistence.service.BaseImmutableService
findOrCreate
-
Methods inherited from interface ubic.gemma.persistence.service.BaseReadOnlyService
countAll, find, findOrFail, getElementClass, loadOrFail, loadOrFail, loadOrFail
-
-
-
-
Method Detail
-
create
@Secured("GROUP_USER") Collection<GeneSet> create(Collection<GeneSet> sets)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
@Secured("GROUP_USER") GeneSet create(GeneSet geneset)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
@Secured("GROUP_USER") GeneSet save(GeneSet entity)- Specified by:
savein interfaceBaseService<GeneSet>- See Also:
BaseDao.save(Object)
-
save
@Secured("GROUP_USER") Collection<GeneSet> save(Collection<GeneSet> entities)- Specified by:
savein interfaceBaseService<GeneSet>- See Also:
BaseDao.save(Collection)
-
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:
GeneSetDao for security filtering
-
loadValueObject
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) DatabaseBackedGeneSetValueObject loadValueObject(GeneSet geneSet)
- Specified by:
loadValueObjectin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>- See Also:
BaseVoEnabledDao.loadValueObject(Identifiable)
-
loadValueObjectById
@Nullable @Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_VALUE_OBJECT_READ"}) DatabaseBackedGeneSetValueObject loadValueObjectById(Long entityId)
- Specified by:
loadValueObjectByIdin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>- See Also:
BaseVoEnabledDao.loadValueObjectById(Long)
-
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:
GeneSetDao for security filtering
-
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:
GeneSetDao for security filtering
-
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
@Secured({"IS_AUTHENTICATED_ANONYMOUSLY","AFTER_ACL_READ"}) GeneSet load(Long id)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:
GeneSetDao for security filtering
-
loadMyGeneSets
@Secured({"GROUP_USER","AFTER_ACL_FILTER_MY_DATA"}) Collection<GeneSet> 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:
GeneSetDao for security filtering
-
loadMyGeneSets
@Secured({"GROUP_USER","AFTER_ACL_FILTER_MY_DATA"}) Collection<GeneSet> loadMyGeneSets(Taxon tax)- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
loadMySharedGeneSets
@Secured({"GROUP_USER","AFTER_ACL_FILTER_MY_PRIVATE_DATA"}) Collection<GeneSet> loadMySharedGeneSets(Taxon tax)- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
createDatabaseEntity
GeneSetValueObject createDatabaseEntity(GeneSetValueObject gsvo)
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
Collection<GeneSetValueObject> 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)- 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
void updateDatabaseEntityMembers(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.- 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
void deleteDatabaseEntity(DatabaseBackedGeneSetValueObject geneSetVO)
Security is handled within method, when the set is loaded- Parameters:
geneSetVO- gene set VO
-
deleteDatabaseEntities
void deleteDatabaseEntities(Collection<DatabaseBackedGeneSetValueObject> vos)
Security is handled within method- Parameters:
vos- gene set value objects
-
getUsersGeneGroups
@Secured("GROUP_USER") Collection<GeneSet> getUsersGeneGroups(boolean privateOnly, 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
TaxonValueObject getTaxonVOforGeneSetVO(SessionBoundGeneSetValueObject geneSetVO)
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
@Nullable Taxon getTaxon(GeneSet geneSet)
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
Set<Taxon> getTaxa(GeneSet geneSet)
Obtain all the taxa for the members of a given gene set.
-
update
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void update(GeneSet entity)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
@Secured({"GROUP_USER","ACL_SECURABLE_COLLECTION_EDIT"}) void update(Collection<GeneSet> entities)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
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void remove(GeneSet entity)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
@Secured({"GROUP_USER","ACL_SECURABLE_COLLECTION_EDIT"}) void remove(Collection<GeneSet> entities)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
@Secured("GROUP_ADMIN") void remove(Long id)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()
-
-