distance = result;
}
- // System.err.println("Made distances");// dbg
makeLeaves();
- // System.err.println("Made leaves");// dbg
noClus = cluster.size();
cluster();
- // System.err.println("Made clusters");// dbg
-
}
/**
}
/**
- * Calculate a distance matrix given the sequence input data and score model
- *
- * @return
- */
- public MatrixI findDistances(ScoreModelI scoreModel)
- {
- MatrixI result = null;
-
- if (scoreModel == null)
- {
- // Resolve substitution model
- scoreModel = ScoreModels.getInstance().forName(pwtype);
- if (scoreModel == null)
- {
- scoreModel = ScoreModels.getInstance().forName("BLOSUM62");
- }
- }
- if (scoreModel instanceof DistanceScoreModelI)
- {
- result = ((DistanceScoreModelI) scoreModel).findDistances(seqData);
- }
- else if (scoreModel instanceof SimilarityScoreModelI)
- {
- /*
- * compute similarity and invert it to give a distance measure
- */
- result = ((SimilarityScoreModelI) scoreModel)
- .findSimilarities(seqData);
- result.reverseRange(true);
- }
- else
- {
- System.err
- .println("Unexpected type of score model, can't compute distances");
- }
-
- return result;
- }
-
- /**
* DOCUMENT ME!
*/
public void makeLeaves()