diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/enrich/impl/HypergeometricEnrichmentEngine.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/enrich/impl/HypergeometricEnrichmentEngine.java index 8ea2139..3ea8b81 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/enrich/impl/HypergeometricEnrichmentEngine.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/enrich/impl/HypergeometricEnrichmentEngine.java @@ -230,7 +230,7 @@ protected EWAHCompressedBitmap getIndividualsBM(EnrichmentQuery q) { return kb.getIndividualsBM(q.getClassId()); else if (q.getIndividualIds() != null) { Set ixs = q.getIndividualIds().stream().map( x -> kb.getIndividualIndex(x)).collect(Collectors.toSet()); - return EWAHUtils.converIndexSetToBitmap(ixs); + return EWAHUtils.convertIndexSetToBitmap(ixs); } else { return null; diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/AbstractProfileMatcher.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/AbstractProfileMatcher.java index ff52df6..beabc70 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/AbstractProfileMatcher.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/AbstractProfileMatcher.java @@ -86,7 +86,7 @@ protected EWAHCompressedBitmap getDirectProfileBM(ProfileQuery q) { for (String cid : q.getQueryClassIds()) { positions.add(knowledgeBase.getClassIndex(cid)); } - return EWAHUtils.converIndexSetToBitmap(positions); + return EWAHUtils.convertIndexSetToBitmap(positions); } // given an array of class IDs c1...cn, return an array S1...Sn, @@ -114,7 +114,7 @@ protected EWAHCompressedBitmap getNegatedProfileBM(ProfileQuery q) { int ci = knowledgeBase.getClassIndex(id); bits.addAll( knowledgeBase.getSubClasses(ci).getPositions() ); } - return EWAHUtils.converIndexSetToBitmap(bits); + return EWAHUtils.convertIndexSetToBitmap(bits); } protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) { @@ -124,7 +124,7 @@ protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) { int ci = knowledgeBase.getClassIndex(id); bits.add(ci); } - return EWAHUtils.converIndexSetToBitmap(bits); + return EWAHUtils.convertIndexSetToBitmap(bits); } protected Match createMatch(String matchId, String matchLabel, double s) { diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightThreeStateProfileMatcher.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightThreeStateProfileMatcher.java index 1605240..14f8087 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightThreeStateProfileMatcher.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightThreeStateProfileMatcher.java @@ -64,7 +64,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) { } } - return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents)); + return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents)); } // any negated query node that has at least one negated parent; @@ -82,7 +82,7 @@ private EWAHCompressedBitmap getQueryNegatedNoTransition(EWAHCompressedBitmap ne } } - return EWAHUtils.converIndexSetToBitmap(nodes); + return EWAHUtils.convertIndexSetToBitmap(nodes); } @@ -148,10 +148,10 @@ public MatchSet findMatchProfileImpl(ProfileQuery q) { } } - EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.converIndexSetToBitmap(nodesQuPt); - EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.converIndexSetToBitmap(nodesQuPu); - EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.converIndexSetToBitmap(nodesQfPtu); - EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.converIndexSetToBitmap(nodesQfPu); + EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPt); + EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPu); + EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPtu); + EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPu); // include subclasses diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightTwoStateProfileMatcher.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightTwoStateProfileMatcher.java index dec218d..9e5d464 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightTwoStateProfileMatcher.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/matcher/impl/NaiveBayesFixedWeightTwoStateProfileMatcher.java @@ -97,7 +97,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) { } } - return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents)); + return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents)); } /** diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/stats/ICStatsCalculator.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/stats/ICStatsCalculator.java index a36dd8d..a13fdcf 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/stats/ICStatsCalculator.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/compute/stats/ICStatsCalculator.java @@ -205,7 +205,7 @@ private EWAHCompressedBitmap getDirectProfileBM(Set classIds) { for (String cid : classIds) { positions.add(knowledgeBase.getClassIndex(cid)); } - return EWAHUtils.converIndexSetToBitmap(positions); + return EWAHUtils.convertIndexSetToBitmap(positions); } } diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/BackgroundData.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/BackgroundData.java index 673d5e8..d63358b 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/BackgroundData.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/BackgroundData.java @@ -74,7 +74,7 @@ public EWAHCompressedBitmap[] createRandom(int n) { for (int j=0; j(thing)); + EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet(thing)); EWAHCompressedBitmap liftAll = new EWAHCompressedBitmap(); EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[numLevels]; diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/LiftOneSimulatedData.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/LiftOneSimulatedData.java index 84b52dc..d4fe60b 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/LiftOneSimulatedData.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/LiftOneSimulatedData.java @@ -41,7 +41,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts) private EWAHCompressedBitmap[] createAttributeSetsRecursive(EWAHCompressedBitmap atts, EWAHCompressedBitmap[] derivedAtts) { int thing = this.getKnowledgeBase().getRootIndex(); //is this OWL:Thing? - EWAHCompressedBitmap thingBM = EWAHUtils.converIndexSetToBitmap(new HashSet(thing)); + EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet(thing)); EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[atts.cardinality()]; List aList = atts.getPositions(); diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RandomChooseNSimulatedData.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RandomChooseNSimulatedData.java index b07d890..4adf51b 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RandomChooseNSimulatedData.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RandomChooseNSimulatedData.java @@ -97,7 +97,7 @@ private EWAHCompressedBitmap[] makeSetofRandomSubsets(EWAHCompressedBitmap atts) //do this in a while loop instead of for loop while ((subsetCounter < numSets) ) { //&& (subsetTries < 7*maxNumSets) Set randomSet = makeRandomSubset(atts, setLength); - sets.add(EWAHUtils.converIndexSetToBitmap(randomSet)); + sets.add(EWAHUtils.convertIndexSetToBitmap(randomSet)); // LOG.info("Set size="+sets.size()); subsetCounter++; } diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByCategorySimulatedData.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByCategorySimulatedData.java index 2b2db90..ec1c104 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByCategorySimulatedData.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByCategorySimulatedData.java @@ -232,7 +232,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts) j++; } //make BM from set - bm = EWAHUtils.converIndexSetToBitmap(s); + bm = EWAHUtils.convertIndexSetToBitmap(s); double finalSumIC= calc.getICStatsForAttributesByBM(bm).getSum(); LOG.info("finalIC= "+(finalSumIC)+" targetIC="+(sumIC-categorySumIC)+" removed |n|="+(atts.cardinality()-bm.cardinality())); if (bm.cardinality() > 0) { diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByICThresholdSimulatedData.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByICThresholdSimulatedData.java index e9d96a1..2e9d9d8 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByICThresholdSimulatedData.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/eval/data/RemoveByICThresholdSimulatedData.java @@ -62,7 +62,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts) } } if (s.size() > 0) { - attrSets[0] = EWAHUtils.converIndexSetToBitmap(s); + attrSets[0] = EWAHUtils.convertIndexSetToBitmap(s); } return attrSets; diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHKnowledgeBaseStore.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHKnowledgeBaseStore.java index 62a429c..81c0a2c 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHKnowledgeBaseStore.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHKnowledgeBaseStore.java @@ -216,7 +216,7 @@ public EWAHCompressedBitmap getDirectTypes(int individualIndex, int classIndex) * @return all classes directly instantiated by individual, that are subclasses of classIndex */ public EWAHCompressedBitmap getDirectTypes(Set clsIndices, int classIndex) { - EWAHCompressedBitmap bm = EWAHUtils.converIndexSetToBitmap(clsIndices); + EWAHCompressedBitmap bm = EWAHUtils.convertIndexSetToBitmap(clsIndices); EWAHCompressedBitmap subclasses = getSubClasses(classIndex); return bm.and(subclasses); } @@ -267,7 +267,7 @@ public EWAHCompressedBitmap getDirectIndividuals(int classIndex) { * @param superClasses */ public void setSuperClasses(int clsIndex, Set superClasses) { - storedSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses); + storedSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses); } /** @@ -278,7 +278,7 @@ public void setSuperClasses(int clsIndex, Set superClasses) { * @param superClasses */ public void setDirectSuperClasses(int clsIndex, Set superClasses) { - storedDirectSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses); + storedDirectSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses); } @@ -304,7 +304,7 @@ public void setStoredDirectSubClasses( */ public void setDirectSubClasses(int clsIndex, Set subClasses) { - storedDirectSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses); + storedDirectSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses); } /** @@ -313,7 +313,7 @@ public void setDirectSubClasses(int clsIndex, */ public void setSubClasses(int clsIndex, Set subClasses) { - storedSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses); + storedSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses); } @@ -327,7 +327,7 @@ public void setSubClasses(int clsIndex, * @param types */ public void setTypes(int individualIndex, Set types) { - storedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types); + storedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types); } /** @@ -339,7 +339,7 @@ public void setTypes(int individualIndex, Set types) { * @param types */ public void setDirectTypes(int individualIndex, Set types) { - storedDirectTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types); + storedDirectTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types); } /** @@ -347,7 +347,7 @@ public void setDirectTypes(int individualIndex, Set types) { * @param types */ public void setNegatedTypes(int individualIndex, Set types) { - storedNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types); + storedNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types); } /** @@ -355,7 +355,7 @@ public void setNegatedTypes(int individualIndex, Set types) { * @param types */ public void setDirectNegatedTypes(int individualIndex, Set types) { - storedDirectNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types); + storedDirectNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types); } @@ -370,7 +370,7 @@ public void setDirectNegatedTypes(int individualIndex, Set types) { * @param individuals */ public void setDirectIndividuals(int classIndex, Set individuals) { - storedDirectIndividuals[classIndex] = EWAHUtils.converIndexSetToBitmap(individuals); + storedDirectIndividuals[classIndex] = EWAHUtils.convertIndexSetToBitmap(individuals); } diff --git a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHUtils.java b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHUtils.java index c2bcdee..81e9965 100644 --- a/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHUtils.java +++ b/owlsim-core/src/main/java/org/monarchinitiative/owlsim/kb/ewah/EWAHUtils.java @@ -19,7 +19,7 @@ public class EWAHUtils { * @param bits - set of bits * @return Bitmap representation of set of ints */ - public static EWAHCompressedBitmap converIndexSetToBitmap(Set bits) { + public static EWAHCompressedBitmap convertIndexSetToBitmap(Set bits) { EWAHCompressedBitmap bm = new EWAHCompressedBitmap(); ArrayList bitlist = new ArrayList(bits); Collections.sort(bitlist); // EWAH assumes sorted, otherwise silent failure diff --git a/owlsim-core/src/test/java/org/monarchinitiative/owlsim/compute/eval/data/SimulatedDataTest.java b/owlsim-core/src/test/java/org/monarchinitiative/owlsim/compute/eval/data/SimulatedDataTest.java index 24e8c63..db36a14 100644 --- a/owlsim-core/src/test/java/org/monarchinitiative/owlsim/compute/eval/data/SimulatedDataTest.java +++ b/owlsim-core/src/test/java/org/monarchinitiative/owlsim/compute/eval/data/SimulatedDataTest.java @@ -257,7 +257,7 @@ public void testLiftOneAnnotations() throws Exception { } //for each individual, the things removed == original LOG.info("i= "+i+" orig="+origBM.toString()+" removed="+removedCBits.toString()+" in "+derivedBMs.length+" sets"); - Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.converIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.converIndexSetToBitmap(removedCBits))==0); + Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.convertIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.convertIndexSetToBitmap(removedCBits))==0); } }