Class GoMetricImpl
java.lang.Object
ubic.gemma.core.ontology.GoMetricImpl
- All Implemented Interfaces:
GoMetric
-
Nested Class Summary
Nested classes/interfaces inherited from interface GoMetric
GoMetric.Metric -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeMatrixSimilarity(Gene gene1, Gene gene2, DoubleMatrix<Long, String> gene2TermMatrix, GoMetric.Metric metric) computeMaxSimilarity(Gene queryGene, Gene targetGene, Map<String, Double> GOProbMap, GoMetric.Metric metric) 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.computeSimilarity(Gene queryGene, Gene targetGene, Map<String, Double> GOProbMap, GoMetric.Metric metric) computeSimpleOverlap(Gene g, Gene coexpG, Map<Long, Collection<String>> geneGoMap) createVectorMatrix(Map<Long, Collection<String>> gene2go, boolean weight) getChildrenOccurrence(Map<String, Integer> termCountMap, String term) protected voidlogIds(String prefix, Collection<OntologyTerm> terms) voidsetGene2GOAssociationService(Gene2GOAssociationService gene2GOAssociationService) voidsetGeneOntologyService(GeneOntologyService geneOntologyService)
-
Constructor Details
-
GoMetricImpl
public GoMetricImpl()
-
-
Method Details
-
computeMatrixSimilarity
public Double computeMatrixSimilarity(Gene gene1, Gene gene2, DoubleMatrix<Long, String> gene2TermMatrix, GoMetric.Metric metric) - Specified by:
computeMatrixSimilarityin interfaceGoMetric
-
computeMaxSimilarity
public Double computeMaxSimilarity(Gene queryGene, Gene targetGene, Map<String, Double> GOProbMap, GoMetric.Metric metric) - Specified by:
computeMaxSimilarityin interfaceGoMetric- Parameters:
queryGene- query genetargetGene- target geneGOProbMap- go prob mapmetric- metric- 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:
computeMergedOverlapin interfaceGoMetric- Parameters:
sameGenes1- same genes 1sameGenes2- same genes 2geneGoMap- gene go map- 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:
computeSimilarityin interfaceGoMetric- Parameters:
queryGene- query genetargetGene- target geneGOProbMap- go prob mapmetric- metric- Returns:
- the overlap score between two genes
-
computeSimpleOverlap
- Specified by:
computeSimpleOverlapin 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:
createVectorMatrixin interfaceGoMetric- Parameters:
gene2go- Mapweight- weight- Returns:
- Sparse matrix of genes x GOTerms
-
getChildrenOccurrence
- Specified by:
getChildrenOccurrencein 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
- Specified by:
setGene2GOAssociationServicein interfaceGoMetric- Parameters:
gene2GOAssociationService- the gene2GOAssociationService to set
-
setGeneOntologyService
- Specified by:
setGeneOntologyServicein interfaceGoMetric- Parameters:
geneOntologyService- the geneOntologyService to set
-
logIds
-