Skip to content

Commit

Permalink
tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
rambaut committed Jan 23, 2025
1 parent 5c57913 commit 404e0c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/dr/app/tools/treeannotator/CladeSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,17 @@ public int getCommonCladeCount(CladeSystem referenceCladeSystem) {
return count;
}

public void embiggenBiClades() {
public void embiggenBiClades(final int minCladeSize, final int minCladeCount) {
List<Clade> allClades = new ArrayList<>(cladeMap.values());
allClades.addAll(tipClades.values());
Clade[] clades = new Clade[allClades.size()];
clades = (Clade[])allClades.toArray(clades);

// sort by number of trees containing clade
Arrays.sort(clades, (o1, o2) -> o2.getCount() - o1.getCount());
int minCount = 3;
int n = 0;
// find the point at which the count drops below minCount
while (clades[n].getCount() > minCount - 1 && n < clades.length) {
while (clades[n].getCount() > minCladeCount - 1 && n < clades.length) {
n++;
}

Expand All @@ -406,9 +405,7 @@ public void embiggenBiClades() {
}
sizeIndices[0] = clades.length;

int minSize = 1;

n = sizeIndices[minSize - 1];
n = sizeIndices[minCladeSize - 1];

long x = (((((long)n) - 1) * n) / 2);

Expand Down
2 changes: 1 addition & 1 deletion src/dr/app/tools/treeannotator/HIPSTRTreeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public MutableTree getHIPSTRTree(CladeSystem cladeSystem, TaxonList taxonList, d

credibilityCache.clear();

cladeSystem.embiggenBiClades();
cladeSystem.embiggenBiClades(1, 1);

score = findHIPSTRTree(rootClade, penaltyThreshold);

Expand Down

0 comments on commit 404e0c2

Please sign in to comment.