Class GeneSetServiceImpl
java.lang.Object
ubic.gemma.persistence.service.AbstractService<GeneSet>
ubic.gemma.persistence.service.AbstractVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>
ubic.gemma.persistence.service.genome.gene.GeneSetServiceImpl
- All Implemented Interfaces:
BaseImmutableService<GeneSet>
,BaseReadOnlyService<GeneSet>
,BaseService<GeneSet>
,BaseVoEnabledService<GeneSet,
,DatabaseBackedGeneSetValueObject> GeneSetService
@Service
@ParametersAreNonnullByDefault
public class GeneSetServiceImpl
extends AbstractVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject>
implements GeneSetService
Service for managing gene sets
- Author:
- kelsey
-
Field Summary
Fields inherited from class ubic.gemma.persistence.service.AbstractService
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDatabaseEntity
(GeneSetValueObject geneSetVo) create an entity in the database based on the value object parametervoid
Security is handled within methodvoid
Security 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 object) getGenesInGroup
(GeneSetValueObject object) Get the gene value objects for the members of the group paramint
getSize
(GeneSetValueObject object) 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 setsReturns 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).loadMyGeneSets
(Taxon tax) loadValueObject
(GeneSet geneSet) Load value objects by a given collection of IDs.loadValueObjectsByIdsLite
(Collection<Long> genesetIds) loadWithMembers
(Collection<Long> ids) Load the gene sets with their members initialized.int
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.AJAX Updates the database entity (permission permitting) with the name and description fields of the param value objectMethods inherited from class ubic.gemma.persistence.service.AbstractVoEnabledService
loadAllValueObjects, loadValueObjectById, loadValueObjects
Methods inherited from class ubic.gemma.persistence.service.AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, remove, save, save, streamAll, streamAll, update, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, streamAll, streamAll
Methods inherited from interface ubic.gemma.persistence.service.genome.gene.GeneSetService
create, create, load, load, loadAll, loadAllValueObjects, loadOrFail, loadValueObjectById, loadValueObjects, remove, remove, remove, save, save, update, update
-
Constructor Details
-
GeneSetServiceImpl
-
-
Method Details
-
loadWithMembers
Description copied from interface:GeneSetService
Load the gene sets with their members initialized.- Specified by:
loadWithMembers
in interfaceGeneSetService
-
findByGene
Description copied from interface:GeneSetService
Return all sets that contain the given gene.GeneSetDao
- Specified by:
findByGene
in interfaceGeneSetService
- Parameters:
gene
- gene- Returns:
- gene sets
- See Also:
-
loadValueObject
@Transactional(readOnly=true) public DatabaseBackedGeneSetValueObject loadValueObject(GeneSet geneSet) - Specified by:
loadValueObject
in interfaceBaseVoEnabledService<GeneSet,
DatabaseBackedGeneSetValueObject> - Specified by:
loadValueObject
in interfaceGeneSetService
- Overrides:
loadValueObject
in classAbstractVoEnabledService<GeneSet,
DatabaseBackedGeneSetValueObject> - See Also:
-
loadValueObjectByIdLite
@Transactional(readOnly=true) public DatabaseBackedGeneSetValueObject loadValueObjectByIdLite(Long id) - Specified by:
loadValueObjectByIdLite
in interfaceGeneSetService
-
loadValueObjectsByIds
@Transactional(readOnly=true) public List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIds(Collection<Long> ids) Description copied from interface:BaseVoEnabledService
Load value objects by a given collection of IDs.- Specified by:
loadValueObjectsByIds
in interfaceBaseVoEnabledService<GeneSet,
DatabaseBackedGeneSetValueObject> - Specified by:
loadValueObjectsByIds
in interfaceGeneSetService
- Overrides:
loadValueObjectsByIds
in classAbstractVoEnabledService<GeneSet,
DatabaseBackedGeneSetValueObject> - Parameters:
ids
- ids- Returns:
- gene set value object
-
loadValueObjectsByIdsLite
@Transactional(readOnly=true) public List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIdsLite(Collection<Long> genesetIds) - Specified by:
loadValueObjectsByIdsLite
in interfaceGeneSetService
-
findByName
- Specified by:
findByName
in interfaceGeneSetService
- Parameters:
name
- name- Returns:
- gene sets
- See Also:
-
findByName
- Specified by:
findByName
in interfaceGeneSetService
- Parameters:
name
- nametaxon
- taxon- Returns:
- gene sets
- See Also:
-
loadAll
- Specified by:
loadAll
in interfaceGeneSetService
- Parameters:
tax
- taxon- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
Description copied from interface:GeneSetService
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.- Specified by:
loadMyGeneSets
in interfaceGeneSetService
- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
- Specified by:
loadMyGeneSets
in interfaceGeneSetService
- Parameters:
tax
- taxon- Returns:
- gene sets
- See Also:
-
createDatabaseEntity
Description copied from interface:GeneSetService
create an entity in the database based on the value object parameter- Specified by:
createDatabaseEntity
in interfaceGeneSetService
- Parameters:
geneSetVo
- gene set value object- Returns:
- value object converted from the newly created entity
-
findGeneSetsByGene
Description copied from interface:GeneSetService
Given a Gemma Gene Id, find all the gene groups it is a member of (filtering is handled when gene sets are loaded)- Specified by:
findGeneSetsByGene
in interfaceGeneSetService
- Parameters:
geneId
- gene id- Returns:
- collection of geneSetValueObject
-
updateDatabaseEntityNameDesc
@Transactional public DatabaseBackedGeneSetValueObject updateDatabaseEntityNameDesc(DatabaseBackedGeneSetValueObject geneSetVO) Description copied from interface:GeneSetService
AJAX Updates the database entity (permission permitting) with the name and description fields of the param value object- Specified by:
updateDatabaseEntityNameDesc
in interfaceGeneSetService
- Parameters:
geneSetVO
- gene set value object- Returns:
- value objects for the updated entities
-
updateDatabaseEntityMembers
Description copied from interface:GeneSetService
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.- Specified by:
updateDatabaseEntityMembers
in interfaceGeneSetService
- Parameters:
groupId
- group idgeneIds
- gene ids
-
updateDatabaseEntity
@Transactional public Collection<DatabaseBackedGeneSetValueObject> updateDatabaseEntity(Collection<DatabaseBackedGeneSetValueObject> geneSetVos) Description copied from interface:GeneSetService
AJAX Updates the database entity (permission permitting) with the fields of the param value object- Specified by:
updateDatabaseEntity
in interfaceGeneSetService
- Parameters:
geneSetVos
- gene sets- Returns:
- value objects for the updated entities
-
deleteDatabaseEntity
Description copied from interface:GeneSetService
Security is handled within method, when the set is loaded- Specified by:
deleteDatabaseEntity
in interfaceGeneSetService
- Parameters:
geneSetVO
- gene set VO
-
deleteDatabaseEntities
Description copied from interface:GeneSetService
Security is handled within method- Specified by:
deleteDatabaseEntities
in interfaceGeneSetService
- Parameters:
vos
- gene set value objects
-
getUsersGeneGroups
@Transactional(readOnly=true) public Collection<GeneSet> getUsersGeneGroups(boolean privateOnly, @Nullable Long taxonId, boolean sharedPublicOnly) - Specified by:
getUsersGeneGroups
in interfaceGeneSetService
- 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
@Transactional(readOnly=true) public Collection<DatabaseBackedGeneSetValueObject> getUsersGeneGroupsValueObjects(boolean privateOnly, Long taxonId) Description copied from interface:GeneSetService
Returns just the current users gene sets- Specified by:
getUsersGeneGroupsValueObjects
in interfaceGeneSetService
- 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
@Transactional(readOnly=true) public Collection<GeneValueObject> getGenesInGroup(GeneSetValueObject object) Description copied from interface:GeneSetService
Get the gene value objects for the members of the group param- Specified by:
getGenesInGroup
in interfaceGeneSetService
- Parameters:
object
- can be just a wrapper to trigger security- Returns:
- gene value object
-
getGeneIdsInGroup
- Specified by:
getGeneIdsInGroup
in interfaceGeneSetService
-
getSize
- Specified by:
getSize
in interfaceGeneSetService
-
findGeneSetsByName
@Transactional(readOnly=true) public Collection<GeneSetValueObject> findGeneSetsByName(String query, @Nullable Long taxonId) throws SearchException - Specified by:
findGeneSetsByName
in interfaceGeneSetService
- Parameters:
query
- string to match to gene setstaxonId
- taxon id- Returns:
- collection of GeneSetValueObjects that match name query
- Throws:
SearchException
-
getTaxonVOforGeneSetVO
@Transactional(readOnly=true) public TaxonValueObject getTaxonVOforGeneSetVO(SessionBoundGeneSetValueObject geneSetVO) Description copied from interface:GeneSetService
get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Specified by:
getTaxonVOforGeneSetVO
in interfaceGeneSetService
- Parameters:
geneSetVO
- gene set value object- Returns:
- the taxon or null if the gene set param was null
-
getTaxon
Description copied from interface:GeneSetService
get the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Specified by:
getTaxon
in interfaceGeneSetService
- Parameters:
geneSet
- gene set- Returns:
- a taxon, or null if the gene set has no member
-
getTaxa
Description copied from interface:GeneSetService
Obtain all the taxa for the members of a given gene set.- Specified by:
getTaxa
in interfaceGeneSetService
-
removeAll
@Transactional public int removeAll()- Specified by:
removeAll
in interfaceGeneSetService
-