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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDatabaseEntity(GeneSetValueObject geneSetVo) 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 object) getGenesInGroup(GeneSetValueObject object) Get the gene value objects for the members of the group paramintgetSize(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 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) 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.intAJAX 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 class ubic.gemma.persistence.service.AbstractVoEnabledService
loadAllValueObjects, loadValueObjectById, loadValueObjectsMethods inherited from class ubic.gemma.persistence.service.AbstractService
countAll, create, create, ensureInSession, ensureInSession, find, findOrCreate, findOrFail, getElementClass, load, load, loadAll, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, loadOrFail, remove, remove, remove, save, save, streamAll, streamAll, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, streamAllMethods 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:GeneSetServiceLoad the gene sets with their members initialized.- Specified by:
loadWithMembersin interfaceGeneSetService
-
findByGene
Description copied from interface:GeneSetServiceReturn all sets that contain the given gene.GeneSetDao- Specified by:
findByGenein interfaceGeneSetService- Parameters:
gene- gene- Returns:
- gene sets
- See Also:
-
loadValueObject
@Transactional(readOnly=true) public DatabaseBackedGeneSetValueObject loadValueObject(GeneSet geneSet) - Specified by:
loadValueObjectin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Specified by:
loadValueObjectin interfaceGeneSetService- Overrides:
loadValueObjectin classAbstractVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - See Also:
-
loadValueObjectByIdLite
@Transactional(readOnly=true) public DatabaseBackedGeneSetValueObject loadValueObjectByIdLite(Long id) - Specified by:
loadValueObjectByIdLitein interfaceGeneSetService
-
loadValueObjectsByIds
@Transactional(readOnly=true) public List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIds(Collection<Long> ids) Description copied from interface:BaseVoEnabledServiceLoad value objects by a given collection of IDs.- Specified by:
loadValueObjectsByIdsin interfaceBaseVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Specified by:
loadValueObjectsByIdsin interfaceGeneSetService- Overrides:
loadValueObjectsByIdsin classAbstractVoEnabledService<GeneSet,DatabaseBackedGeneSetValueObject> - Parameters:
ids- ids- Returns:
- gene set value object
-
loadValueObjectsByIdsLite
@Transactional(readOnly=true) public List<DatabaseBackedGeneSetValueObject> loadValueObjectsByIdsLite(Collection<Long> genesetIds) - Specified by:
loadValueObjectsByIdsLitein interfaceGeneSetService
-
findByName
- Specified by:
findByNamein interfaceGeneSetService- Parameters:
name- name- Returns:
- gene sets
- See Also:
-
findByName
- Specified by:
findByNamein interfaceGeneSetService- Parameters:
name- nametaxon- taxon- Returns:
- gene sets
- See Also:
-
loadAll
- Specified by:
loadAllin interfaceGeneSetService- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
Description copied from interface:GeneSetServiceReturns 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.- Specified by:
loadMyGeneSetsin interfaceGeneSetService- Returns:
- gene sets
- See Also:
-
loadMyGeneSets
- Specified by:
loadMyGeneSetsin interfaceGeneSetService- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
-
createDatabaseEntity
Description copied from interface:GeneSetServicecreate an entity in the database based on the value object parameter- Specified by:
createDatabaseEntityin interfaceGeneSetService- Parameters:
geneSetVo- gene set value object- Returns:
- value object converted from the newly created entity
-
findGeneSetsByGene
Description copied from interface:GeneSetServiceGiven a Gemma Gene Id, find all the gene groups it is a member of (filtering is handled when gene sets are loaded)- Specified by:
findGeneSetsByGenein interfaceGeneSetService- Parameters:
geneId- gene id- Returns:
- collection of geneSetValueObject
-
updateDatabaseEntityNameDesc
@Transactional public DatabaseBackedGeneSetValueObject updateDatabaseEntityNameDesc(DatabaseBackedGeneSetValueObject geneSetVO) Description copied from interface:GeneSetServiceAJAX Updates the database entity (permission permitting) with the name and description fields of the param value object- Specified by:
updateDatabaseEntityNameDescin interfaceGeneSetService- Parameters:
geneSetVO- gene set value object- Returns:
- value objects for the updated entities
-
updateDatabaseEntityMembers
Description copied from interface:GeneSetServiceUpdates 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:
updateDatabaseEntityMembersin interfaceGeneSetService- Parameters:
groupId- group idgeneIds- gene ids
-
updateDatabaseEntity
@Transactional public Collection<DatabaseBackedGeneSetValueObject> updateDatabaseEntity(Collection<DatabaseBackedGeneSetValueObject> geneSetVos) Description copied from interface:GeneSetServiceAJAX Updates the database entity (permission permitting) with the fields of the param value object- Specified by:
updateDatabaseEntityin interfaceGeneSetService- Parameters:
geneSetVos- gene sets- Returns:
- value objects for the updated entities
-
deleteDatabaseEntity
Description copied from interface:GeneSetServiceSecurity is handled within method, when the set is loaded- Specified by:
deleteDatabaseEntityin interfaceGeneSetService- Parameters:
geneSetVO- gene set VO
-
deleteDatabaseEntities
Description copied from interface:GeneSetServiceSecurity is handled within method- Specified by:
deleteDatabaseEntitiesin interfaceGeneSetService- Parameters:
vos- gene set value objects
-
getUsersGeneGroups
@Transactional(readOnly=true) public Collection<GeneSet> getUsersGeneGroups(boolean privateOnly, @Nullable Long taxonId, boolean sharedPublicOnly) - Specified by:
getUsersGeneGroupsin 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:GeneSetServiceReturns just the current users gene sets- Specified by:
getUsersGeneGroupsValueObjectsin 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:GeneSetServiceGet the gene value objects for the members of the group param- Specified by:
getGenesInGroupin interfaceGeneSetService- Parameters:
object- can be just a wrapper to trigger security- Returns:
- gene value object
-
getGeneIdsInGroup
- Specified by:
getGeneIdsInGroupin interfaceGeneSetService
-
getSize
- Specified by:
getSizein interfaceGeneSetService
-
findGeneSetsByName
@Transactional(readOnly=true) public Collection<GeneSetValueObject> findGeneSetsByName(String query, @Nullable Long taxonId) throws SearchException - Specified by:
findGeneSetsByNamein 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:GeneSetServiceget the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Specified by:
getTaxonVOforGeneSetVOin interfaceGeneSetService- Parameters:
geneSetVO- gene set value object- Returns:
- the taxon or null if the gene set param was null
-
getTaxon
Description copied from interface:GeneSetServiceget the taxon for the gene set parameter, assumes that the taxon of the first gene will be representational of all the genes- Specified by:
getTaxonin interfaceGeneSetService- Parameters:
geneSet- gene set- Returns:
- a taxon, or null if the gene set has no member
-
getTaxa
Description copied from interface:GeneSetServiceObtain all the taxa for the members of a given gene set.- Specified by:
getTaxain interfaceGeneSetService
-
removeAll
@Transactional public int removeAll()- Specified by:
removeAllin interfaceGeneSetService
-