Class CoexpressionDaoImpl
java.lang.Object
ubic.gemma.persistence.service.association.coexpression.CoexpressionDaoImpl
- All Implemented Interfaces:
CoexpressionDao
Manages and queries coexpression 'links' between genes.
- Author:
- klc, paul
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountLinks
(Gene gene, ExpressionExperiment ee) countOldLinks
(Collection<Gene> genes) void
createOrUpdate
(ExpressionExperiment ee, List<NonPersistentNonOrderedCoexpLink> links, LinkCreator c, Set<Gene> genesTested) void
deleteLinks
(Taxon t, ExpressionExperiment experiment) findCoexpressionRelationships
(Gene gene, Collection<Long> bas, int maxResults, boolean quick) Find coexpression links for a gene that are common to all the given datasets.findCoexpressionRelationships
(Taxon taxon, Collection<Long> genes, Collection<Long> bas, int maxResults, boolean quick) Find coexpression links for the genes that are common to all the given datasets, so stringency = bas.size().findCoexpressionRelationships
(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, int maxResults, boolean quick) findInterCoexpressionRelationships
(Taxon taxon, Collection<Long> genes, Collection<Long> bas, int stringency, boolean quick) Return coexpression relationships among the given genes, limited to the given data sets.getCoexpression
(Taxon taxon, ExpressionExperiment experiment, boolean quick) getRawCoexpressionFromDbViaGenes
(Collection<Long> geneIds, Taxon t, int stringency) boolean
hasLinks
(Taxon taxon, ExpressionExperiment ee) initializeFromOldData
(Gene gene, Map<Long, Gene> geneIdMap, Map<NonPersistentNonOrderedCoexpLink, SupportDetails> linksSoFar, Set<Long> skipGenes) int
queryAndCache
(Gene gene) void
updateModifiedSupportDetails
(ExpressionExperiment experiment, Collection<SupportDetails> supportDetailsToDelete, Collection<SupportDetails> supportDetailsToUpdate) This is a maintenance method.void
updateRelativeNodeDegrees
(Map<Long, List<Double>> relRanksPerGenePositive, Map<Long, List<Double>> relRanksPerGeneNegative)
-
Constructor Details
-
CoexpressionDaoImpl
public CoexpressionDaoImpl()
-
-
Method Details
-
hasLinks
- Specified by:
hasLinks
in interfaceCoexpressionDao
-
countLinks
- Specified by:
countLinks
in interfaceCoexpressionDao
-
createOrUpdate
public void createOrUpdate(ExpressionExperiment ee, List<NonPersistentNonOrderedCoexpLink> links, LinkCreator c, Set<Gene> genesTested) - Specified by:
createOrUpdate
in interfaceCoexpressionDao
- Parameters:
ee
- bio assay setlinks
- in gene orderc
- link creatorgenesTested
- genes tested
-
deleteLinks
- Specified by:
deleteLinks
in interfaceCoexpressionDao
-
findCoexpressionRelationships
public List<CoexpressionValueObject> findCoexpressionRelationships(Gene gene, Collection<Long> bas, int maxResults, boolean quick) Description copied from interface:CoexpressionDao
Find coexpression links for a gene that are common to all the given datasets. That is the stringency is bas.size().- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionDao
- Parameters:
gene
- genebas
- bio assaysmaxResults
- max resultsquick
- quick- Returns:
- coexpression VO
-
findCoexpressionRelationships
public Map<Long,List<CoexpressionValueObject>> findCoexpressionRelationships(Taxon taxon, Collection<Long> genes, Collection<Long> bas, int maxResults, boolean quick) Description copied from interface:CoexpressionDao
Find coexpression links for the genes that are common to all the given datasets, so stringency = bas.size().- Specified by:
findCoexpressionRelationships
in interfaceCoexpressionDao
- Parameters:
taxon
- taxongenes
- genesbas
- bio assaysmaxResults
- max resultsquick
- quick- Returns:
- map of ids to coexp. VOs
-
findCoexpressionRelationships
public Map<Long,List<CoexpressionValueObject>> findCoexpressionRelationships(Taxon t, Collection<Long> genes, Collection<Long> bas, int stringency, int maxResults, boolean quick) - Specified by:
findCoexpressionRelationships
in interfaceCoexpressionDao
- Parameters:
t
- taxongenes
- genesbas
- limit on which data sets to query, or null (or empty) for no limit.stringency
- minimum number of the datasets the link must be supported bymaxResults
- maximum results per gene.quick
- quick- Returns:
- map of ids to coexp. VOs
-
findInterCoexpressionRelationships
public Map<Long,List<CoexpressionValueObject>> findInterCoexpressionRelationships(Taxon taxon, Collection<Long> genes, Collection<Long> bas, int stringency, boolean quick) Description copied from interface:CoexpressionDao
Return coexpression relationships among the given genes, limited to the given data sets.- Specified by:
findInterCoexpressionRelationships
in interfaceCoexpressionDao
- Parameters:
taxon
- taxongenes
- genesbas
- bio assaysstringency
- stringencyquick
- quick- Returns:
- map of ids to coexp. VOs
-
updateNodeDegree
public GeneCoexpressionNodeDegreeValueObject updateNodeDegree(Gene g, GeneCoexpressionNodeDegree nd) Description copied from interface:CoexpressionDao
This is a maintenance method. This requires doing a coexpression query for the gene, and updating (or, if need be, creating) the associated GeneCoexpressionNodeDegree object.- Specified by:
updateNodeDegree
in interfaceCoexpressionDao
- Parameters:
g
- genend
- node degree- Returns:
- updated value object
-
getCoexpression
public Collection<CoexpressionValueObject> getCoexpression(Taxon taxon, ExpressionExperiment experiment, boolean quick) - Specified by:
getCoexpression
in interfaceCoexpressionDao
- Parameters:
taxon
- taxonexperiment
- experimentquick
- quick- Returns:
- links, but not including flipped versions
-
queryAndCache
- Specified by:
queryAndCache
in interfaceCoexpressionDao
- Parameters:
gene
- gene- Returns:
- number of links that were cached
-
initializeFromOldData
public Map<SupportDetails,Gene2GeneCoexpression> initializeFromOldData(Gene gene, Map<Long, Gene> geneIdMap, Map<NonPersistentNonOrderedCoexpLink, SupportDetails> linksSoFar, Set<Long> skipGenes) - Specified by:
initializeFromOldData
in interfaceCoexpressionDao
-
countOldLinks
- Specified by:
countOldLinks
in interfaceCoexpressionDao
-
updateRelativeNodeDegrees
public void updateRelativeNodeDegrees(Map<Long, List<Double>> relRanksPerGenePositive, Map<Long, List<Double>> relRanksPerGeneNegative) - Specified by:
updateRelativeNodeDegrees
in interfaceCoexpressionDao
-
updateModifiedSupportDetails
public void updateModifiedSupportDetails(ExpressionExperiment experiment, Collection<SupportDetails> supportDetailsToDelete, Collection<SupportDetails> supportDetailsToUpdate) -
getRawCoexpressionFromDbViaGenes
public List<Object[]> getRawCoexpressionFromDbViaGenes(Collection<Long> geneIds, Taxon t, int stringency)
-