Class CoexpressionServiceImpl
- java.lang.Object
-
- ubic.gemma.persistence.service.association.coexpression.CoexpressionServiceImpl
-
- All Implemented Interfaces:
CoexpressionService
@Service public class CoexpressionServiceImpl extends Object implements CoexpressionService
- See Also:
CoexpressionService
-
-
Constructor Summary
Constructors Constructor Description CoexpressionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
countLinks(BioAssaySet ee, Gene gene)
Map<Gene,Integer>
countOldLinks(Collection<Gene> genes)
void
createOrUpdate(BioAssaySet bioAssaySet, List<NonPersistentNonOrderedCoexpLink> links, LinkCreator c, Set<Gene> genesTested)
Maintenance method.void
deleteLinks(BioAssaySet experiment)
Maintenance method.List<CoexpressionValueObject>
findCoexpressionRelationships(Gene gene, Collection<Long> bas, int maxResults, boolean quick)
Find links which are common to all of the given data sets.List<CoexpressionValueObject>
findCoexpressionRelationships(Gene gene, Collection<Long> bas, int stringency, int maxResults, boolean quick)
Search for coexpression across all available data sets, for the given genes considered individually, subject to a stringency constraint.Map<Long,List<CoexpressionValueObject>>
findCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int maxResults, boolean quick)
Find coexpression links for the genes that are common to all the given datasets (that is, the stringency is equal to the size of the set of datasets)Map<Long,List<CoexpressionValueObject>>
findCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, int maxResults, boolean quick)
Find coexpression links for the genes that are common to at least stringency of the given datasets.Map<Long,List<CoexpressionValueObject>>
findInterCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, boolean quick)
Return coexpression relationships among the given genes in the given data sets, in a map of query gene to coexpression objects.Collection<CoexpressionValueObject>
getCoexpression(BioAssaySet experiment, boolean quick)
GeneCoexpressionNodeDegreeValueObject
getNodeDegree(Gene g)
Map<Long,GeneCoexpressionNodeDegreeValueObject>
getNodeDegrees(Collection<Long> g)
boolean
hasLinks(BioAssaySet ee)
Check if a given dataset has coexpression links.Map<SupportDetails,Gene2GeneCoexpression>
initializeLinksFromOldData(Gene g, Map<Long,Gene> idMap, Map<NonPersistentNonOrderedCoexpLink,SupportDetails> linksSoFar, Set<Long> skipGenes)
void
updateNodeDegrees(Taxon t)
-
-
-
Method Detail
-
hasLinks
public boolean hasLinks(BioAssaySet ee)
Description copied from interface:CoexpressionService
Check if a given dataset has coexpression links.- Specified by:
hasLinks
in interfaceCoexpressionService
-
countLinks
@Transactional(readOnly=true) public Integer countLinks(BioAssaySet ee, Gene gene)
- Specified by:
countLinks
in interfaceCoexpressionService
- Parameters:
ee
- bio assay setgene
- gene- Returns:
- the number of links the gene has in the given data set ("node degree")
-
createOrUpdate
@Transactional public void createOrUpdate(BioAssaySet bioAssaySet, List<NonPersistentNonOrderedCoexpLink> links, LinkCreator c, Set<Gene> genesTested)
Description copied from interface:CoexpressionService
Maintenance method.- Specified by:
createOrUpdate
in interfaceCoexpressionService
- Parameters:
bioAssaySet
- should be all of them for the bioAssaySet (not a batch)links
- linksc
- link creatorgenesTested
- genes which were tested
-
deleteLinks
@Transactional public void deleteLinks(BioAssaySet experiment)
Description copied from interface:CoexpressionService
Maintenance method. Remove coexpression information from the database about the experiment in question (this does not remove the analysis object).- Specified by:
deleteLinks
in interfaceCoexpressionService
- Parameters:
experiment
- experiment
-
findCoexpressionRelationships
@Transactional(readOnly=true) public List<CoexpressionValueObject> findCoexpressionRelationships(Gene gene, Collection<Long> bas, int maxResults, boolean quick)
Description copied from interface:CoexpressionService
Find links which are common to all of the given data sets.- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionService
- Parameters:
gene
- genebas
- data sets the link must be supported by; that is, the stringency is implied by bas.size(). Assumed to be security-filtered.maxResults
- max resultsquick
- quick- Returns:
- coexpression results.
-
findCoexpressionRelationships
@Transactional(readOnly=true) public List<CoexpressionValueObject> findCoexpressionRelationships(Gene gene, Collection<Long> bas, int stringency, int maxResults, boolean quick)
Description copied from interface:CoexpressionService
Search for coexpression across all available data sets, for the given genes considered individually, subject to a stringency constraint.- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionService
- Parameters:
gene
- genebas
- assumed to be security-filtered.stringency
- the minimum number of data sets for which the coexpression must be observed, among the given datasets.maxResults
- max resultsquick
- quick- Returns:
- coexpression results.
-
findCoexpressionRelationships
@Transactional(readOnly=true) public Map<Long,List<CoexpressionValueObject>> findCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int maxResults, boolean quick)
Description copied from interface:CoexpressionService
Find coexpression links for the genes that are common to all the given datasets (that is, the stringency is equal to the size of the set of datasets)- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionService
- Parameters:
t
- taxongenes
- genesbas
- - assumed to already be security-filteredmaxResults
- max resultsquick
- quick- Returns:
- a map of gene IDs to coexpression results.
-
findCoexpressionRelationships
@Transactional(readOnly=true) public Map<Long,List<CoexpressionValueObject>> findCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, int maxResults, boolean quick)
Description copied from interface:CoexpressionService
Find coexpression links for the genes that are common to at least stringency of the given datasets.- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionService
- Parameters:
t
- taxongenes
- genesbas
- assumed to already be security-filteredstringency
- the minimum number of data sets for which the coexpression must be observed, among the given datasets.maxResults
- limit to the number of results per gene, but connections among the query genes (if there is more than one) are given priority and not subject to the limit.quick
- quick- Returns:
- a map of gene IDs to coexpression results.
-
findInterCoexpressionRelationships
@Transactional(readOnly=true) public Map<Long,List<CoexpressionValueObject>> findInterCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, boolean quick)
Description copied from interface:CoexpressionService
Return coexpression relationships among the given genes in the given data sets, in a map of query gene to coexpression objects.- Specified by:
findInterCoexpressionRelationships
in interfaceCoexpressionService
- Parameters:
t
- taxongenes
- genesbas
- data sets to be considered, presumed to be security filtered alreadystringency
- Must be less than or equal to the number of data sets datasets.quick
- quick- Returns:
- a map of gene IDs to coexpression results.
-
getCoexpression
@Transactional(readOnly=true) public Collection<CoexpressionValueObject> getCoexpression(BioAssaySet experiment, boolean quick)
- Specified by:
getCoexpression
in interfaceCoexpressionService
- Parameters:
experiment
- experimentquick
- quick- Returns:
- all the coexpression links for the given experiment, but not including flipped versions
-
updateNodeDegrees
@Transactional public void updateNodeDegrees(Taxon t)
- Specified by:
updateNodeDegrees
in interfaceCoexpressionService
-
getNodeDegree
@Transactional(readOnly=true) public GeneCoexpressionNodeDegreeValueObject getNodeDegree(Gene g)
- Specified by:
getNodeDegree
in interfaceCoexpressionService
-
getNodeDegrees
@Transactional(readOnly=true) public Map<Long,GeneCoexpressionNodeDegreeValueObject> getNodeDegrees(Collection<Long> g)
- Specified by:
getNodeDegrees
in interfaceCoexpressionService
-
initializeLinksFromOldData
@Transactional public Map<SupportDetails,Gene2GeneCoexpression> initializeLinksFromOldData(Gene g, Map<Long,Gene> idMap, Map<NonPersistentNonOrderedCoexpLink,SupportDetails> linksSoFar, Set<Long> skipGenes)
- Specified by:
initializeLinksFromOldData
in interfaceCoexpressionService
- Parameters:
g
- geneidMap
- id maplinksSoFar
- links so farskipGenes
- skip genes- Returns:
- links that were made
-
countOldLinks
@Transactional(readOnly=true) public Map<Gene,Integer> countOldLinks(Collection<Gene> genes)
- Specified by:
countOldLinks
in interfaceCoexpressionService
-
-