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 storageGeneSet
create(GeneSet geneset)
Creates the given entity in the persistent storage.GeneSetValueObject
createDatabaseEntity(GeneSetValueObject gsvo)
create an entity in the database based on the value object parametervoid
deleteDatabaseEntities(Collection<DatabaseBackedGeneSetValueObject> vos)
Security is handled within methodvoid
deleteDatabaseEntity(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 paramint
getSize(GeneSetValueObject geneSetVO)
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 genesTaxonValueObject
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 genesCollection<GeneSet>
getUsersGeneGroups(boolean privateOnly, Long taxonId, boolean sharedPublicOnly)
Collection<DatabaseBackedGeneSetValueObject>
getUsersGeneGroupsValueObjects(boolean privateOnly, Long taxonId)
Returns just the current users gene setsGeneSet
load(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 theGeneSet
s 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)
GeneSet
loadOrFail(Long id)
Convenience for runningBaseReadOnlyService.load(Long)
and checking if the result is null.DatabaseBackedGeneSetValueObject
loadValueObject(GeneSet geneSet)
DatabaseBackedGeneSetValueObject
loadValueObjectById(Long entityId)
DatabaseBackedGeneSetValueObject
loadValueObjectByIdLite(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)
void
remove(Long id)
Removes the entity with given ID from the persistent storage.void
remove(Collection<GeneSet> entities)
Removes all the given entities from persistent storage.void
remove(GeneSet entity)
Removes the given entity from the persistent storage.int
removeAll()
Collection<GeneSet>
save(Collection<GeneSet> entities)
GeneSet
save(GeneSet entity)
void
update(Collection<GeneSet> entities)
Updates all entities in the given collection in the persistent storage.void
update(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 objectvoid
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.DatabaseBackedGeneSetValueObject
updateDatabaseEntityNameDesc(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:BaseImmutableService
Creates all the given entities in a persistent storage- Specified by:
create
in 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:BaseImmutableService
Creates the given entity in the persistent storage.- Specified by:
create
in 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:
save
in interfaceBaseService<GeneSet>
- See Also:
BaseDao.save(Object)
-
save
@Secured("GROUP_USER") Collection<GeneSet> save(Collection<GeneSet> entities)
- Specified by:
save
in 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:
loadValueObject
in 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:
loadValueObjectById
in 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:BaseVoEnabledService
Loads value objects for all given entities.- Specified by:
loadValueObjects
in 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:
loadValueObjectsByIds
in 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:BaseVoEnabledService
Loads value objects representing all the entities of specific type.- Specified by:
loadAllValueObjects
in 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:BaseReadOnlyService
Loads objects with given ids.- Specified by:
load
in 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:BaseReadOnlyService
Convenience for runningBaseReadOnlyService.load(Long)
and checking if the result is null.- Specified by:
loadOrFail
in 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:BaseReadOnlyService
Loads object with given ID.- Specified by:
load
in 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:BaseReadOnlyService
Loads all the entities of specific type.- Specified by:
loadAll
in 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(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 theGeneSet
s 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
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:
- the taxon or null if the gene set param was null
-
update
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void update(GeneSet entity)
Description copied from interface:BaseService
Updates the given entity in the persistent storage.- Specified by:
update
in 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:BaseService
Updates all entities in the given collection in the persistent storage.- Specified by:
update
in interfaceBaseService<GeneSet>
- Parameters:
entities
- the entities to be updated.
-
remove
@Secured({"GROUP_USER","ACL_SECURABLE_EDIT"}) void remove(GeneSet entity)
Description copied from interface:BaseImmutableService
Removes the given entity from the persistent storage.- Specified by:
remove
in 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:BaseImmutableService
Removes all the given entities from persistent storage.- Specified by:
remove
in interfaceBaseImmutableService<GeneSet>
- Parameters:
entities
- the entities to be removed.
-
remove
@Secured("GROUP_ADMIN") void remove(Long id)
Description copied from interface:BaseImmutableService
Removes the entity with given ID from the persistent storage.- Specified by:
remove
in interfaceBaseImmutableService<GeneSet>
- Parameters:
id
- the ID of entity to be removed.
-
removeAll
@Secured("GROUP_ADMIN") int removeAll()
-
-