info.bioinfweb.treegraph.document.io.newick
Class BranchLengthsScaler
java.lang.Object
info.bioinfweb.treegraph.document.io.newick.BranchLengthsScaler
public class BranchLengthsScaler
- extends Object
Sets the branch lengths scale of a tree so that the contained branched have a specific average
length. Additionally the small interval of the scale bar is set in a way that it equals about a
specified value.
- Since:
- 2.0.24
- Author:
- Ben Stöver
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sharedInstance
private static BranchLengthsScaler sharedInstance
count
private int count
sum
private double sum
BranchLengthsScaler
public BranchLengthsScaler()
getSharedInstance
public static BranchLengthsScaler getSharedInstance()
calculateAverage
private void calculateAverage(Node root)
setAverageScale
public void setAverageScale(Tree tree,
double averageLength,
float smallIntervalLength)
- Sets the branch lengths scale of a tree so that the contained branched have the specified average
length. Additionally the small interval of the scale bar is set in a way that it equals about a
specified value.
- Parameters:
tree
- averageLength
- the average length in millimeterssmallIntervalLength
- the approximate desired length of a small interval of the scale bar
in millimeters
setDefaultAverageScale
public void setDefaultAverageScale(Tree tree)
- Sets the branch lengths scale of a tree so that the contained branched have
BranchFormats.DEFAULT_MIN_LENGTH
as their average length. Additionally the small interval
of the scale bar is set in a way that it equals about ScaleBarFormats.DEFAULT_SMALL_INTERVAL_IN_MM
.
- Parameters:
tree
- - Since:
- 2.0.41