public interface OwlSim
Individual: g1 Types: gene, expressed_in some hand Individual: g2 Types: gene, expressed_in some toeHere the only *named* class commonly instantiated between g1 and g2 is 'gene'. OWLReasoners do not return anonymous class expressions. The input ontology should be pre-processed to pre-generate named classes such as
"X gene" EquivalentTo expressed_in some XIf we assume a property chain
expressed_in o part_of -> expressed_inAnd a typical partonomy Then g1 and g2 will both instantiate "expressed_in some autopod" See the "--mpi" command in OWLTools for building these views Note that for some applications, it may be best to model entities such as genes and diseases as classes. However, to compare these effectively, the representation should be translated to individuals.
OWLReasoner.getTypes(OWLNamedIndividual, boolean)
- to find all of the attributes possessed
by an entity - may be direct or indirect. The inverse operation is Inst(c)
OWLReasoner.getSuperClasses(OWLClassExpression, boolean)
- to find all the ancestors (subsumers) of an attribute - direct and indirect.
The inverse operation is SubBy(c)
OWLReasoner.getEquivalentClasses(OWLClassExpression)
- find all all equivalent attributes/
Note that OWLSim is cycle-safe - cycles over SubClassOf are permitted, these are the same as an equivalence axiom between the classes
getNamedReflexiveSubsumers(OWLClass)
. We write this here as
RSub(c). i.e.
RSub(c) = Sub(c) ∪ Eq(c)The use of an OWLReasoner could be replaced with a basic graph traversal algorithm, but it's useful to use a reasoner here, as the ontology may not have been pre-reasoned
CS(c,d) = RSub(c) ∪ RSub(d)The Lowest Common Subsumer is the set of common subsumers that are not redundant with other common subsumers:
LCS(c,d) = { a : a ∈ CS(c,d), not [ &E; a' : a' ∈ CS(c,d), c' in Sub(c) ] }This is implemented by
getLowestCommonSubsumerWithIC(OWLClass, OWLClass)
IC(c) = -log2( Pr(c) )Where the probability Pr of a class c is the frequency of that class (number of instances that instantiate it) divided by the number of instances in the corpus:
Pr(c) = | Inst(c) | / | Inst(RootClass) |Here the semantics of Inst(c) are provided by
OWLReasoner.getInstances(OWLClassExpression, boolean)
getLowestCommonSubsumerWithIC(OWLClass, OWLClass)
getSimilarityMaxIC(OWLNamedIndividual, OWLNamedIndividual)
. This
is the same method as described in Lord et al 2003.
Other methods
Modifier and Type | Interface and Description |
---|---|
static class |
OwlSim.ScoreAttributeSetPair
A pair consisting of a set of equal-scoring attributes, and a score
|
static class |
OwlSim.Stat |
static class |
OwlSim.StatsPerIndividual |
Modifier and Type | Method and Description |
---|---|
org.semanticweb.owlapi.model.OWLOntology |
cacheInformationContentInOntology()
Generates an ontology containing annotation assertion axioms connecting
a class to an IC value.
|
List<EnrichmentResult> |
calculateAllByAllEnrichment() |
List<EnrichmentResult> |
calculateAllByAllEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass,
org.semanticweb.owlapi.model.OWLClass pc1,
org.semanticweb.owlapi.model.OWLClass pc2)
For every c ∈ sample set, test c against all classes ∈ enriched class set.
|
void |
calculateCombinedScore(ElementPairScores eps,
double maxIC,
double bmaAsymIC) |
void |
calculateCombinedScores(List<ElementPairScores> scoreSets,
double maxIC,
double bmaAsymIC) |
List<EnrichmentResult> |
calculateEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass,
org.semanticweb.owlapi.model.OWLClass sampleSetClass)
|
void |
calculateMetricStats(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> iset,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> jset) |
double |
calculateOverallAnnotationSufficiencyForAttributeSet(Set<org.semanticweb.owlapi.model.OWLClass> atts) |
double |
calculateOverallAnnotationSufficiencyForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) |
EnrichmentResult |
calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass,
org.semanticweb.owlapi.model.OWLClass sampleSetClass,
org.semanticweb.owlapi.model.OWLClass enrichedClass)
Pairwise enrichment test
|
double |
calculateSubgraphAnnotationSufficiencyForAttributeSet(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLClass c) |
List<SimResultRenderer.AttributesSimScores> |
compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c,
Set<org.semanticweb.owlapi.model.OWLClass> ds) |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
computeAttributeSetSimilarityStats(Set<org.semanticweb.owlapi.model.OWLClass> goodAtts) |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
computeAttributeSetSimilarityStatsForSubgraph(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLClass n) |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
computeIndividualStats(org.semanticweb.owlapi.model.OWLNamedIndividual i)
This will compute the individual summary statistics over the
set of anntoated classes to an individual i.
|
void |
computeSystemStats()
This function will compute the IC-based summary statistics over the set of
individuals for direct annotations.
|
void |
computeSystemStatsForSubgraph(org.semanticweb.owlapi.model.OWLClass c) |
Double[][] |
computeTFIDFMatrix(int[][] subsetMatrix,
int numIndividualsInSubset,
int[][] backgroundMatrix,
int numIndividualsInBackground) |
int[][] |
convertCountMatrixToFrequency(int[][] matrix,
int normalizationFactor) |
void |
createElementAttributeMapFromOntology()
This must be called prior to calculation of any similarity metrics.
|
void |
dispose()
call when owlsim object is no longer required
|
List<ElementPairScores> |
findMatches(org.semanticweb.owlapi.model.OWLNamedIndividual i,
String targetIdSpace) |
List<ElementPairScores> |
findMatches(org.semanticweb.owlapi.model.OWLNamedIndividual i,
String targetIdSpace,
double minSimJPct,
double minMaxIC) |
List<ElementPairScores> |
findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace)
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using
getGroupwiseSimilarity
with default cutoffs. |
List<ElementPairScores> |
findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace,
double minSimJPct,
double minMaxIC)
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using
getGroupwiseSimilarity
with minSimJPct and minMaxIC cutoffs. |
List<ElementPairScores> |
findMatchesWithin(org.semanticweb.owlapi.model.OWLNamedIndividual i,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargets) |
Set<org.semanticweb.owlapi.model.OWLClass> |
getAllAttributeClasses()
returns all attribute classes - i.e.
|
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> |
getAllElements() |
double |
getAsymmetricAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
SimJASym(c,d) = | anc(c) ∩ anc(d) | / | anc(d) |
|
int |
getAsymmetricAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
Equivalent to
getAsymmetricAttributeJaccardSimilarity(OWLClass, OWLClass) * 100 |
double |
getAsymmetricElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(j) |
|
int |
getAsymmetricElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Equivalent to
getAsymmetricElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual) * 100 |
double |
getAttributeGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
sums of IC of the intersection attributes/ sum of IC of union attributes.
|
double |
getAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
|
int |
getAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
Equivalent to
getAttributeJaccardSimilarity(OWLClass, OWLClass) * 100 |
Set<org.semanticweb.owlapi.model.OWLClass> |
getAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e)
Gets all attribute classes used to describe individual element e.
|
double |
getAttributeSimilarity(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b,
SimpleOwlSim.Metric metric)
This method provides a generic wrapper onto other attribute-based similarity
methods
Compares two classes (attributes) according to the specified metric
|
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c) |
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c,
Double cutoff,
int numIndividualsInBackground) |
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c,
int numIndividualsInBackground) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts,
int matchCutoff) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i,
int matchCutoff) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForMatches(List<ElementPairScores> matches,
Set<org.semanticweb.owlapi.model.OWLClass> atts) |
double |
getConditionalProbability(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
int |
getCorpusSize()
The number of entities in the entire set being analyzed.
|
double |
getElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
sums of IC of the intersection attributes/ sum of IC of union attributes.
|
double |
getElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(i) ∪ Type(j) |
|
int |
getElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Equivalent to
getElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual) * 100 |
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> |
getElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
inferred
|
Map<org.semanticweb.owlapi.model.OWLNamedIndividual,Set<org.semanticweb.owlapi.model.OWLClass>> |
getElementToAttributesMap() |
EnrichmentConfig |
getEnrichmentConfig() |
Double |
getEntropy() |
Double |
getEntropy(Set<org.semanticweb.owlapi.model.OWLClass> cset) |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i)
Compare a named individual
i to itself. |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Compare two named individuals
(i,j) . |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
double minSimJ,
double minMaxIC)
Compare two named individuals
i , filtering on
minSimJ and minMaxIC |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Compare a set of attributes against the named individual
i . |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
double minSimJPct,
double minMaxIC)
Compare a set of attributes against the named individual
i . |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs,
Set<org.semanticweb.owlapi.model.OWLClass> objBs) |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs,
Set<org.semanticweb.owlapi.model.OWLClass> objBs,
double minSimJPct,
double minMaxIC) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getInferredAttributes(org.semanticweb.owlapi.model.OWLNamedIndividual i) |
Double |
getInformationContentForAttribute(org.semanticweb.owlapi.model.OWLClass c)
IC = -(log
getNumElementsForAttribute(OWLClass) / corpus size) / log(2) |
OwlSim.ScoreAttributeSetPair |
getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
Resnick similarity measure, together with all LCSs (MICAs) that
have this as IC
|
OwlSim.ScoreAttributeSetPair |
getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass i,
org.semanticweb.owlapi.model.OWLClass j,
Double thresh) |
OwlSim.ScoreAttributeSetPair |
getLowestCommonSubsumerWithLinScore(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
OwlSimMetadata |
getMetadata() |
HashMap<String,org.apache.commons.math3.stat.descriptive.SummaryStatistics> |
getMetricStats(OwlSim.Stat stat) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
CS(a,b) = { c : c ∈ RSub(a), c ∈ RSub(b) }
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLNamedIndividual a,
org.semanticweb.owlapi.model.OWLNamedIndividual b)
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
|
int |
getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
| CS(i,j) | = | { c : c ∈ Type(i), c ∈ Type(j) } |
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedLowestCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
CSredundant(a,b) = { c : c ∈ CS(a,b), &E; c' : c' ∈ CS(a,b), c' &in Sub(c) }
LCS(a,b) = CS(a,b) - CSredundant
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedReflexiveSubsumers(org.semanticweb.owlapi.model.OWLClass a) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedSubsumers(org.semanticweb.owlapi.model.OWLClass a) |
int |
getNumElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
|{e : e ∈ Inst(c)}|
|
AttributePairScores |
getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
Deprecated.
|
org.semanticweb.owlapi.reasoner.OWLReasoner |
getReasoner() |
String |
getShortId(org.semanticweb.owlapi.model.OWLClass c) |
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverage(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
SimpleOwlSim.Metric metric,
SimpleOwlSim.Direction dir)
Deprecated.
|
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Deprecated.
|
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
SimpleOwlSim.Metric metric)
See: Pesquita et al
|
OwlSim.ScoreAttributeSetPair |
getSimilarityMaxIC(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Find the inferred attribute shared by both i and j that has highest IC.
|
Properties |
getSimProperties() |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
getSimStatistics(String stat) |
SimStats |
getSimStats() |
org.semanticweb.owlapi.model.OWLOntology |
getSourceOntology() |
int[][] |
getSubsetCoannotationMatrix(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> individualSubset) |
OwlSim.StatsPerIndividual |
getSummaryStatistics()
Fetch the pre-computed summary values
|
OwlSim.StatsPerIndividual |
getSummaryStatistics(org.semanticweb.owlapi.model.OWLClass c)
OwlSim.StatsPerIndividual summary statistic calculations using OWLClass c as the root node |
org.apache.commons.math3.stat.descriptive.StatisticalSummaryValues |
getSystemStats() |
int[][] |
initCoannotationMatrix(int[][] coaMatrix) |
void |
loadLCSCache(String fileName)
Loads a pregenerated IC cache.
|
void |
populateFullCoannotationMatrix() |
void |
precomputeAttributeAllByAll()
For implementations that use a cache, this performs an all by all comparison
of all attributes and caches the results.
|
void |
saveLCSCache(String fileName)
Saves the contents of the LCS-IC cache
Assumes that this has already been filled by comparing all classes by all classes.
|
void |
saveLCSCache(String fileName,
Double thresholdIC)
As
saveLCSCache(String) , but do not write a line for any LCS
whose IC falls below the threshold. |
void |
saveState(String fileName)
Experimental: save internal state of object
|
void |
setCorpusSize(int size)
Sets the number of entities in domain.
|
void |
setDisableLCSCache(boolean isDisableLCSCache)
if set, the cache is neither read nor written to.
|
void |
setEnrichmentConfig(EnrichmentConfig enrichmentConfig) |
void |
setInformationContentFromOntology(org.semanticweb.owlapi.model.OWLOntology o)
Populate the IC cache from an ontology of class-IC mappings.
|
void |
setNoLookupForLCSCache(boolean b)
Ff set, the cache is written to but not read from.
|
void |
setSimProperties(Properties simProperties) |
void |
showTimings()
Writes timing information using log4j.
|
static final String[] metrics
org.semanticweb.owlapi.model.OWLOntology getSourceOntology()
org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedSubsumers(org.semanticweb.owlapi.model.OWLClass a)
a
- Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getInferredAttributes(org.semanticweb.owlapi.model.OWLNamedIndividual i)
i
- Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedReflexiveSubsumers(org.semanticweb.owlapi.model.OWLClass a)
a
- Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
CS(a,b) = { c : c ∈ RSub(a), c ∈ RSub(b) }NOT CACHED. Always returns a copy of the CS list
a
- b
- UnknownOWLClassException
int getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
| CS(i,j) | = | { c : c ∈ Type(i), c ∈ Type(j) } |
a
- b
- UnknownOWLClassException
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLNamedIndividual a, org.semanticweb.owlapi.model.OWLNamedIndividual b) throws UnknownOWLClassException
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
a
- b
- UnknownOWLClassException
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedLowestCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
CSredundant(a,b) = { c : c ∈ CS(a,b), &E; c' : c' ∈ CS(a,b), c' &in Sub(c) } LCS(a,b) = CS(a,b) - CSredundant
a
- b
- UnknownOWLClassException
double getAttributeSimilarity(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b, SimpleOwlSim.Metric metric) throws UnknownOWLClassException
a
- b
- metric
- UnknownOWLClassException
double getAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
a
- b
- UnknownOWLClassException
double getElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(i) ∪ Type(j) |Here Type(i) is the set of all (direct and indirect) inferred types for an individual.
i
- j
- UnknownOWLClassException
double getAsymmetricElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(j) |
i
- j
- UnknownOWLClassException
double getAsymmetricAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
SimJASym(c,d) = | anc(c) ∩ anc(d) | / | anc(d) |If c is subsumed by d then the score is 1. i.e.
c ∈ Sub(d) → SimJASym(c,d) = 1
c
- d
- UnknownOWLClassException
double getElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
i
- j
- UnknownOWLClassException
double getAttributeGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
c
- d
- UnknownOWLClassException
OwlSim.ScoreAttributeSetPair getSimilarityMaxIC(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
MaxIC(i,j) = max { IC(c) : c ∈ LCS(i,j) } CMaxIC(i,j) = { c : c ∈ LCS(i,j), IC(c) = MaxIC(i,j) }As a convenience, this method also returns the LCS class as well as the IC This is the same metric used by Lord et al in Investigating semantic similarity measures across the Gene Ontology: the relationship between sequence and annotation.
i
- j
- UnknownOWLClassException
@Deprecated OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j)
i
- j
- @Deprecated AttributePairScores getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
c
- d
- UnknownOWLClassException
OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, SimpleOwlSim.Metric metric)
BMAM(i,j) = avg { s : c ∈ Attr(i), max { s : d ∈ Attr(j), s = M(c,d) } }
i
- j
- metric
- @Deprecated OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverage(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, SimpleOwlSim.Metric metric, SimpleOwlSim.Direction dir)
i
- j
- metric
- dir
- int getAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
getAttributeJaccardSimilarity(OWLClass, OWLClass)
* 100a
- b
- UnknownOWLClassException
int getElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
getElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual)
* 100i
- j
- UnknownOWLClassException
int getAsymmetricAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b) throws UnknownOWLClassException
getAsymmetricAttributeJaccardSimilarity(OWLClass, OWLClass)
* 100a
- b
- UnknownOWLClassException
int getAsymmetricElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
getAsymmetricElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual)
* 100i
- j
- UnknownOWLClassException
Set<org.semanticweb.owlapi.model.OWLClass> getAllAttributeClasses()
void createElementAttributeMapFromOntology() throws UnknownOWLClassException
UnknownOWLClassException
void precomputeAttributeAllByAll() throws UnknownOWLClassException
UnknownOWLClassException
Set<org.semanticweb.owlapi.model.OWLClass> getAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e) throws UnknownOWLClassException
e
- UnknownOWLClassException
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> getElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
c
- UnknownOWLClassException
int getNumElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
c
- UnknownOWLClassException
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> getAllElements()
int getCorpusSize()
void setCorpusSize(int size)
size
- Double getInformationContentForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
getNumElementsForAttribute(OWLClass)
/ corpus size) / log(2)c
- UnknownOWLClassException
Double getEntropy() throws UnknownOWLClassException
UnknownOWLClassException
Double getEntropy(Set<org.semanticweb.owlapi.model.OWLClass> cset) throws UnknownOWLClassException
cset
- UnknownOWLClassException
List<SimResultRenderer.AttributesSimScores> compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c, Set<org.semanticweb.owlapi.model.OWLClass> ds) throws UnknownOWLClassException
c
- - query classds
- - target class setUnknownOWLClassException
List<ElementPairScores> findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace) throws UnknownOWLClassException, Exception
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using getGroupwiseSimilarity
with default cutoffs.
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
atts
- targetIdSpace
- Exception
UnknownOWLClassException
List<ElementPairScores> findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace, double minSimJPct, double minMaxIC) throws Exception
getGroupwiseSimilarity
with minSimJPct
and minMaxIC
cutoffs.atts
- targetIdSpace
- minSimJPct
- minMaxIC
- Exception
ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws Exception
Compare a named individual i
to itself.
For efficiency, the phenoDigm score should be calculated in the calling
function.
This will use no cutoff (-1,-1).
atts
- targetIdSpace
- Exception
ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws Exception
(i,j)
.
This will default to using the following cutoffs:
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
i
- j
- Exception
ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJ, double minMaxIC) throws Exception
Compare two named individuals i
, filtering on
minSimJ
and minMaxIC
While an initial combinedScore
is populated in the returned
ElementPairScores
object, it should be properly set in
the calling function with calculateCombinedScore
and
i.maxIC and i.bmaAsymIC
atts
- targetIdSpace
- Exception
ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws Exception
Compare a set of attributes against the named individual i
.
For efficiency, the phenoDigm score should be calculated in the calling
function.
This will default to using the following cutoffs:
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
atts
- targetIdSpace
- Exception
ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJPct, double minMaxIC) throws Exception
i
.
For efficiency, the phenoDigm score should be calculated in the calling
function.
If no cutoffs are desired, set minSimJPct
and minMaxIC
= -1
atts
- targetIdSpace
- Exception
ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs, Set<org.semanticweb.owlapi.model.OWLClass> objBs) throws Exception
Exception
ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs, Set<org.semanticweb.owlapi.model.OWLClass> objBs, double minSimJPct, double minMaxIC) throws Exception
Exception
List<ElementPairScores> findMatches(org.semanticweb.owlapi.model.OWLNamedIndividual i, String targetIdSpace) throws Exception
i
- targetIdSpace
- Exception
List<ElementPairScores> findMatches(org.semanticweb.owlapi.model.OWLNamedIndividual i, String targetIdSpace, double minSimJPct, double minMaxIC) throws Exception
i
- targetIdSpace
- Exception
List<ElementPairScores> findMatchesWithin(org.semanticweb.owlapi.model.OWLNamedIndividual i, Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargets) throws Exception
Exception
OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
c
- d
- UnknownOWLClassException
OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithLinScore(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
UnknownOWLClassException
OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass i, org.semanticweb.owlapi.model.OWLClass j, Double thresh) throws UnknownOWLClassException
i
- j
- thresh
- UnknownOWLClassException
void saveState(String fileName) throws IOException
fileName
- IOException
void saveLCSCache(String fileName) throws IOException
fileName
- IOException
void saveLCSCache(String fileName, Double thresholdIC) throws IOException
saveLCSCache(String)
, but do not write a line for any LCS
whose IC falls below the threshold.
Use this if you expect the size of the cache to be large. If not set,
the number of lines will be |A| x |A|fileName
- thresholdIC
- IOException
void loadLCSCache(String fileName) throws IOException
fileName
- IOException
org.semanticweb.owlapi.model.OWLOntology cacheInformationContentInOntology() throws org.semanticweb.owlapi.model.OWLOntologyCreationException, UnknownOWLClassException
org.semanticweb.owlapi.model.OWLOntologyCreationException
UnknownOWLClassException
void setInformationContentFromOntology(org.semanticweb.owlapi.model.OWLOntology o)
o
- void setNoLookupForLCSCache(boolean b)
b
- void setDisableLCSCache(boolean isDisableLCSCache)
setNoLookupForLCSCache(boolean)
isDisableLCSCache
- void dispose()
void setSimProperties(Properties simProperties)
simProperties
- Properties getSimProperties()
SimStats getSimStats()
void showTimings()
Map<org.semanticweb.owlapi.model.OWLNamedIndividual,Set<org.semanticweb.owlapi.model.OWLClass>> getElementToAttributesMap()
EnrichmentConfig getEnrichmentConfig()
void setEnrichmentConfig(EnrichmentConfig enrichmentConfig)
enrichmentConfig
- List<EnrichmentResult> calculateAllByAllEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass, org.semanticweb.owlapi.model.OWLClass pc1, org.semanticweb.owlapi.model.OWLClass pc2) throws org.apache.commons.math.MathException, UnknownOWLClassException
calculatePairwiseEnrichment(OWLClass, OWLClass, OWLClass)
}populationClass
- pc1
- - sample set root classpc2
- - enriched set root classorg.apache.commons.math.MathException
UnknownOWLClassException
List<EnrichmentResult> calculateAllByAllEnrichment() throws org.apache.commons.math.MathException, UnknownOWLClassException
org.apache.commons.math.MathException
UnknownOWLClassException
List<EnrichmentResult> calculateEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass, org.semanticweb.owlapi.model.OWLClass sampleSetClass) throws org.apache.commons.math.MathException, UnknownOWLClassException
populationClass
- sampleSetClass
- org.apache.commons.math.MathException
UnknownOWLClassException
EnrichmentResult calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass populationClass, org.semanticweb.owlapi.model.OWLClass sampleSetClass, org.semanticweb.owlapi.model.OWLClass enrichedClass) throws org.apache.commons.math.MathException, UnknownOWLClassException
populationClass
- sampleSetClass
- enrichedClass
- org.apache.commons.math.MathException
UnknownOWLClassException
double getConditionalProbability(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
c
- d
- UnknownOWLClassException
org.apache.commons.math3.stat.descriptive.SummaryStatistics computeIndividualStats(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws UnknownOWLClassException
i
- UnknownOWLClassException
void computeSystemStats() throws UnknownOWLClassException
UnknownOWLClassException
org.apache.commons.math3.stat.descriptive.StatisticalSummaryValues getSystemStats()
OwlSim.StatsPerIndividual getSummaryStatistics()
SummaryStatistics
org.apache.commons.math3.stat.descriptive.SummaryStatistics getSimStatistics(String stat)
void calculateMetricStats(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> iset, Set<org.semanticweb.owlapi.model.OWLNamedIndividual> jset) throws Exception
Exception
HashMap<String,org.apache.commons.math3.stat.descriptive.SummaryStatistics> getMetricStats(OwlSim.Stat stat)
double calculateOverallAnnotationSufficiencyForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws UnknownOWLClassException
UnknownOWLClassException
double calculateOverallAnnotationSufficiencyForAttributeSet(Set<org.semanticweb.owlapi.model.OWLClass> atts) throws UnknownOWLClassException
UnknownOWLClassException
void computeSystemStatsForSubgraph(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
UnknownOWLClassException
OwlSim.StatsPerIndividual getSummaryStatistics(org.semanticweb.owlapi.model.OWLClass c)
OwlSim.StatsPerIndividual
summary statistic calculations using OWLClass
c as the root nodec
- OWLClass
OwlSim.StatsPerIndividual
double calculateSubgraphAnnotationSufficiencyForAttributeSet(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
UnknownOWLClassException
org.apache.commons.math3.stat.descriptive.SummaryStatistics computeAttributeSetSimilarityStatsForSubgraph(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLClass n)
org.apache.commons.math3.stat.descriptive.SummaryStatistics computeAttributeSetSimilarityStats(Set<org.semanticweb.owlapi.model.OWLClass> goodAtts)
void calculateCombinedScore(ElementPairScores eps, double maxIC, double bmaAsymIC)
OwlSimMetadata getMetadata()
String getShortId(org.semanticweb.owlapi.model.OWLClass c)
Double[][] computeTFIDFMatrix(int[][] subsetMatrix, int numIndividualsInSubset, int[][] backgroundMatrix, int numIndividualsInBackground) throws UnknownOWLClassException
UnknownOWLClassException
List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c, int numIndividualsInBackground) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c, Double cutoff, int numIndividualsInBackground) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i, int matchCutoff) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts, int matchCutoff) throws Exception
Exception
List<FastOwlSim.ClassCount> getCoAnnotatedClassesForMatches(List<ElementPairScores> matches, Set<org.semanticweb.owlapi.model.OWLClass> atts) throws Exception
Exception
int[][] getSubsetCoannotationMatrix(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> individualSubset) throws Exception
Exception
void populateFullCoannotationMatrix() throws Exception
Exception
int[][] convertCountMatrixToFrequency(int[][] matrix, int normalizationFactor)
int[][] initCoannotationMatrix(int[][] coaMatrix)
void calculateCombinedScores(List<ElementPairScores> scoreSets, double maxIC, double bmaAsymIC)
Copyright © 2010–2016. All rights reserved.