{
start = av.getSelectionGroup().getStartRes();
end = av.getSelectionGroup().getEndRes() + 1;
- this.sequences = av.getSelectionGroup().getSequencesInOrder(
- av.getAlignment());
+ this.sequences = av.getSelectionGroup()
+ .getSequencesInOrder(av.getAlignment());
}
init(seqStrings, start, end);
{
return maxheight;
}
-
+
if ((nd.left() == null) && (nd.right() == null))
{
nd.height = ((SequenceNode) nd.parent()).height + nd.dist;
-
+
if (nd.height > maxheight)
{
return nd.height;
maxheight = 0;
nd.height = (float) 0.0;
}
-
+
maxheight = findHeight((SequenceNode) (nd.left()));
maxheight = findHeight((SequenceNode) (nd.right()));
}
-
+
return maxheight;
}
{
// if (_lycount<_lylimit)
// {
- // System.err.println("Warning: depth of _recount greater than number of nodes.");
+ // System.err.println("Warning: depth of _recount greater than number of
+ // nodes.");
// }
if (nd == null)
{
return;
}
// _lycount++;
-
+
if ((nd.left() != null) && (nd.right() != null))
{
-
+
_reCount((SequenceNode) nd.left());
_reCount((SequenceNode) nd.right());
-
+
SequenceNode l = (SequenceNode) nd.left();
SequenceNode r = (SequenceNode) nd.right();
-
+
nd.count = l.count + r.count;
nd.ycount = (l.ycount + r.ycount) / 2;
}
while (noClus > 2)
{
findMinDistance();
-
+
joinClusters(mini, minj);
-
+
noClus--;
}
-
+
int rightChild = done.nextClearBit(0);
int leftChild = done.nextClearBit(rightChild + 1);
-
+
joinClusters(leftChild, rightChild);
top = (node.elementAt(leftChild));
-
+
reCount(top);
findHeight(top);
findMaxDist(top);
protected void computeTree(ScoreModelI sm, SimilarityParamsI scoreOptions)
{
distances = sm.findDistances(seqData, scoreOptions);
-
+
makeLeaves();
-
+
noClus = clusters.size();
-
+
cluster();
}
{
return;
}
-
+
if ((nd.left() == null) && (nd.right() == null))
{
double dist = nd.dist;
-
+
if (dist > maxDistValue)
{
maxdist = nd;
protected double findr(int i, int j)
{
double tmp = 1;
-
+
for (int k = 0; k < noseqs; k++)
{
if ((k != i) && (k != j) && (!done.get(k)))
tmp = tmp + distances.getValue(i, k);
}
}
-
+
if (noClus > 2)
{
tmp = tmp / (noClus - 2);
}
-
+
return tmp;
}
sdata.addOperation(CigarArray.M, end - start + 1);
this.seqData = new AlignmentView(sdata, start);
}
-
+
/*
* count the non-null sequences
*/
noseqs = 0;
-
+
done = new BitSet();
-
+
for (SequenceI seq : sequences)
{
if (seq != null)
void joinClusters(final int i, final int j)
{
double dist = distances.getValue(i, j);
-
+
ri = findr(i, j);
rj = findr(j, i);
-
+
findClusterDistance(i, j);
-
+
SequenceNode sn = new SequenceNode();
-
+
sn.setLeft((node.elementAt(i)));
sn.setRight((node.elementAt(j)));
-
+
SequenceNode tmpi = (node.elementAt(i));
SequenceNode tmpj = (node.elementAt(j));
-
+
findNewDistances(tmpi, tmpj, dist);
-
+
tmpi.setParent(sn);
tmpj.setParent(sn);
-
+
node.setElementAt(sn, i);
-
+
/*
* move the members of cluster(j) to cluster(i)
* and mark cluster j as out of the game
void makeLeaves()
{
clusters = new Vector<BitSet>();
-
+
for (int i = 0; i < noseqs; i++)
{
SequenceNode sn = new SequenceNode();
-
+
sn.setElement(sequences[i]);
sn.setName(sequences[i].getName());
node.addElement(sn);