Class GeneSetServiceImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.AbstractService<O>
-
- 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 Constructor Description GeneSetServiceImpl(GeneSetDao voDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneSetValueObject
createDatabaseEntity(GeneSetValueObject geneSetVo)
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 object)
Collection<GeneValueObject>
getGenesInGroup(GeneSetValueObject object)
Get the gene value objects for the members of the group paramint
getSize(GeneSetValueObject object)
Set<Taxon>
getTaxa(GeneSet geneSet)
Obtain all the taxa for the members of a given gene set.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 setsCollection<GeneSet>
loadAll(Taxon tax)
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)
DatabaseBackedGeneSetValueObject
loadValueObject(GeneSet geneSet)
DatabaseBackedGeneSetValueObject
loadValueObjectByIdLite(Long id)
List<DatabaseBackedGeneSetValueObject>
loadValueObjectsByIds(Collection<Long> ids)
Load value objects by a given collection of IDs.List<DatabaseBackedGeneSetValueObject>
loadValueObjectsByIdsLite(Collection<Long> genesetIds)
int
removeAll()
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 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, 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
-
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 Detail
-
GeneSetServiceImpl
@Autowired public GeneSetServiceImpl(GeneSetDao voDao)
-
-
Method Detail
-
findByGene
@Transactional(readOnly=true) public Collection<GeneSet> findByGene(Gene gene)
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:
GeneSetDao for security filtering
-
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:
BaseVoEnabledDao.loadValueObject(Identifiable)
-
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
@Transactional(readOnly=true) public Collection<GeneSet> findByName(String name)
- Specified by:
findByName
in interfaceGeneSetService
- Parameters:
name
- name- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
findByName
@Transactional(readOnly=true) public Collection<GeneSet> findByName(String name, Taxon taxon)
- Specified by:
findByName
in interfaceGeneSetService
- Parameters:
name
- nametaxon
- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
loadAll
@Transactional(readOnly=true) public Collection<GeneSet> loadAll(@Nullable Taxon tax)
- Specified by:
loadAll
in interfaceGeneSetService
- Parameters:
tax
- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
loadMyGeneSets
@Transactional(readOnly=true) public Collection<GeneSet> 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:
GeneSetDao for security filtering
-
loadMyGeneSets
@Transactional(readOnly=true) public Collection<GeneSet> loadMyGeneSets(Taxon tax)
- Specified by:
loadMyGeneSets
in interfaceGeneSetService
- Parameters:
tax
- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
loadMySharedGeneSets
@Transactional(readOnly=true) public Collection<GeneSet> loadMySharedGeneSets(Taxon tax)
- Specified by:
loadMySharedGeneSets
in interfaceGeneSetService
- Parameters:
tax
- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
createDatabaseEntity
@Transactional public GeneSetValueObject createDatabaseEntity(GeneSetValueObject geneSetVo)
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
@Transactional(readOnly=true) public Collection<GeneSetValueObject> findGeneSetsByGene(Long geneId)
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
@Transactional public void updateDatabaseEntityMembers(Long groupId, Collection<Long> geneIds)
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
@Transactional public void deleteDatabaseEntity(DatabaseBackedGeneSetValueObject geneSetVO)
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
@Transactional public void deleteDatabaseEntities(Collection<DatabaseBackedGeneSetValueObject> vos)
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, 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
@Transactional(readOnly=true) public Collection<Long> getGeneIdsInGroup(GeneSetValueObject object)
- Specified by:
getGeneIdsInGroup
in interfaceGeneSetService
-
getSize
@Transactional(readOnly=true) public int getSize(GeneSetValueObject object)
- 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
@Transactional(readOnly=true) public Taxon getTaxon(GeneSet geneSet)
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
@Transactional(readOnly=true) public Set<Taxon> getTaxa(GeneSet geneSet)
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
-
-