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 GeneSetValueObjectcreateDatabaseEntity(GeneSetValueObject geneSetVo)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 object)Collection<GeneValueObject>getGenesInGroup(GeneSetValueObject object)Get the gene value objects for the members of the group paramintgetSize(GeneSetValueObject object)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 setsCollection<GeneSet>loadAll(Taxon tax)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)DatabaseBackedGeneSetValueObjectloadValueObject(GeneSet geneSet)DatabaseBackedGeneSetValueObjectloadValueObjectByIdLite(Long id)List<DatabaseBackedGeneSetValueObject>loadValueObjectsByIds(Collection<Long> ids)Load value objects by a given collection of IDs.List<DatabaseBackedGeneSetValueObject>loadValueObjectsByIdsLite(Collection<Long> genesetIds)intremoveAll()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 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:GeneSetServiceReturn all sets that contain the given gene.GeneSetDao- Specified by:
findByGenein interfaceGeneSetService- Parameters:
gene- gene- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
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:
BaseVoEnabledDao.loadValueObject(Identifiable)
-
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
@Transactional(readOnly=true) public Collection<GeneSet> findByName(String name)
- Specified by:
findByNamein 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:
findByNamein 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:
loadAllin 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: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:
GeneSetDao for security filtering
-
loadMyGeneSets
@Transactional(readOnly=true) public Collection<GeneSet> loadMyGeneSets(Taxon tax)
- Specified by:
loadMyGeneSetsin 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:
loadMySharedGeneSetsin interfaceGeneSetService- Parameters:
tax- taxon- Returns:
- gene sets
- See Also:
GeneSetDao for security filtering
-
createDatabaseEntity
@Transactional public GeneSetValueObject createDatabaseEntity(GeneSetValueObject geneSetVo)
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
@Transactional(readOnly=true) public Collection<GeneSetValueObject> findGeneSetsByGene(Long geneId)
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
@Transactional public void updateDatabaseEntityMembers(Long groupId, Collection<Long> geneIds)
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
@Transactional public void deleteDatabaseEntity(DatabaseBackedGeneSetValueObject geneSetVO)
Description copied from interface:GeneSetServiceSecurity is handled within method, when the set is loaded- Specified by:
deleteDatabaseEntityin interfaceGeneSetService- Parameters:
geneSetVO- gene set VO
-
deleteDatabaseEntities
@Transactional public void deleteDatabaseEntities(Collection<DatabaseBackedGeneSetValueObject> vos)
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, 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
@Transactional(readOnly=true) public Collection<Long> getGeneIdsInGroup(GeneSetValueObject object)
- Specified by:
getGeneIdsInGroupin interfaceGeneSetService
-
getSize
@Transactional(readOnly=true) public int getSize(GeneSetValueObject object)
- 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
@Transactional(readOnly=true) public Taxon getTaxon(GeneSet geneSet)
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
@Transactional(readOnly=true) public Set<Taxon> getTaxa(GeneSet geneSet)
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
-
-