Skip to content

Commit

Permalink
Updated README and added t itself to argmax_clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
niemasd committed Apr 5, 2018
1 parent aaa3341 commit 7ee995a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ optional arguments:

## Threshold-Free Approaches
* **Argmax Clusters:** Choose the threshold that maximizes the number of non-singleton clusters over all thresholds from 0 to *t*
* Currently, for the sake of speed, only every 0.0001 threshold is tested (i.e., 0, 0.001, 0.002, ..., *t*)

## Requirements
* [Biopython](http://biopython.org/)
2 changes: 1 addition & 1 deletion TreeCluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def argmax_clusters(method,tree,threshold,support):
from copy import deepcopy
assert threshold > 0, "Threshold must be positive"
#thresholds = pairwise_dists_below_thresh(deepcopy(tree),threshold)
thresholds = [i*threshold/NUM_THRESH for i in range(NUM_THRESH)]
thresholds = [i*threshold/NUM_THRESH for i in range(NUM_THRESH+1)]
best = None; best_num = -1; best_t = -1
for i,t in enumerate(thresholds):
print("%s%%"%str(i*100/len(thresholds)).rstrip('0'),end='\r',file=stderr)
Expand Down

0 comments on commit 7ee995a

Please sign in to comment.