Package ubic.gemma.core.ontology
Class GoMetricImpl
- java.lang.Object
-
- ubic.gemma.core.ontology.GoMetricImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.core.ontology.GoMetric
GoMetric.Metric
-
-
Constructor Summary
Constructors Constructor Description GoMetricImpl()
-
Method Summary
-
-
-
Method Detail
-
computeMatrixSimilarity
public Double computeMatrixSimilarity(Gene gene1, Gene gene2, DoubleMatrix<Long,String> gene2TermMatrix, GoMetric.Metric metric)
- Specified by:
computeMatrixSimilarity
in interfaceGoMetric
-
computeMaxSimilarity
public Double computeMaxSimilarity(Gene queryGene, Gene targetGene, Map<String,Double> GOProbMap, GoMetric.Metric metric)
- Specified by:
computeMaxSimilarity
in interfaceGoMetric
- Parameters:
metric
- metricGOProbMap
- go prob mapqueryGene
- query genetargetGene
- target gene- Returns:
- the MAX overlap score between two genes
-
computeMergedOverlap
public Double computeMergedOverlap(List<Gene> sameGenes1, List<Gene> sameGenes2, Map<Long,Collection<String>> geneGoMap)
Tailored to handle computing overlap between two gene lists which may contain duplicate genes of the same name but different IDs. If gene lists do not contain duplicates (size = 1) the result will be the same as that of computing simple overlap.- Specified by:
computeMergedOverlap
in interfaceGoMetric
- Parameters:
geneGoMap
- gene go mapsameGenes1
- same genes 1sameGenes2
- same genes 2- Returns:
- number of overlapping terms between merged sets of GO terms for duplicate gene lists
-
computeSimilarity
public Double computeSimilarity(Gene queryGene, Gene targetGene, Map<String,Double> GOProbMap, GoMetric.Metric metric)
- Specified by:
computeSimilarity
in interfaceGoMetric
- Parameters:
metric
- metricGOProbMap
- go prob mapqueryGene
- query genetargetGene
- target gene- Returns:
- the overlap score between two genes
-
computeSimpleOverlap
public Double computeSimpleOverlap(Gene g, Gene coexpG, Map<Long,Collection<String>> geneGoMap)
- Specified by:
computeSimpleOverlap
in interfaceGoMetric
- Parameters:
g
- gcoexpG
- coexp ggeneGoMap
- gene go map- Returns:
- number of overlapping terms
-
createVectorMatrix
public DoubleMatrix<Long,String> createVectorMatrix(Map<Long,Collection<String>> gene2go, boolean weight)
- Specified by:
createVectorMatrix
in interfaceGoMetric
- Parameters:
gene2go
- Mapweight
- weight- Returns:
- Sparse matrix of genes x GOTerms
-
getChildrenOccurrence
public Integer getChildrenOccurrence(Map<String,Integer> termCountMap, String term)
- Specified by:
getChildrenOccurrence
in interfaceGoMetric
- Parameters:
termCountMap
- each GO term uri mapped to the number of its occurrence in the corpusterm
- the uri of the query GO term- Returns:
- the number of times the query GO term occurs in addition to the number of times its children occur in the corpus
-
setGene2GOAssociationService
public void setGene2GOAssociationService(Gene2GOAssociationService gene2GOAssociationService)
- Specified by:
setGene2GOAssociationService
in interfaceGoMetric
- Parameters:
gene2GOAssociationService
- the gene2GOAssociationService to set
-
setGeneOntologyService
public void setGeneOntologyService(GeneOntologyService geneOntologyService)
- Specified by:
setGeneOntologyService
in interfaceGoMetric
- Parameters:
geneOntologyService
- the geneOntologyService to set
-
logIds
protected void logIds(String prefix, Collection<OntologyTerm> terms)
-
-