X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FNJTree.java;h=40dfc9b105c39ee234b6e1a54cd5edb796bc782f;hb=2959d102cb701ba58489e7222cd101d0eb02ead6;hp=46a2ced5a3314098e258ca951919cd40841ff793;hpb=2493af6c253a5a33cf783b9beb76caaaf1c777ec;p=jalview.git diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index 46a2ced..40dfc9b 100755 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -60,6 +60,10 @@ public class NJTree Object leaves = null; int start; int end; + boolean hasDistances = true; // normal case for jalview trees + boolean hasBootstrap = false; // normal case for jalview trees + + private boolean hasRootDistance = true; /** * Creates a new NJTree object. @@ -81,6 +85,11 @@ public class NJTree public NJTree(SequenceI[] seqs, NewickFile treefile) { top = treefile.getTree(); + + hasDistances = treefile.HasDistances(); + hasBootstrap = treefile.HasBootstrap(); + hasRootDistance = treefile.HasRootDistance(); + maxheight = findHeight(top); SequenceIdMatcher algnIds = new SequenceIdMatcher(seqs); @@ -375,7 +384,7 @@ public class NJTree public void findNewNJDistances(SequenceNode tmpi, SequenceNode tmpj, float dist) { - + tmpi.dist = ((dist + ri) - rj) / 2; tmpj.dist = (dist - tmpi.dist); @@ -658,7 +667,7 @@ public class NJTree AlignSeq as = new AlignSeq(sequence[i], sequence[j], "pep"); as.calcScoreMatrix(); as.traceAlignment(); - as.printAlignment(); + as.printAlignment(System.out); distance[i][j] = (float) as.maxscore; if (max < distance[i][j]) @@ -1134,6 +1143,27 @@ public class NJTree { return top; } + /** + * + * @return true if tree has real distances + */ + public boolean isHasDistances() { + return hasDistances; + } + + /** + * + * @return true if tree has real bootstrap values + */ + public boolean isHasBootstrap() { + return hasBootstrap; + } + + public boolean isHasRootDistance() + { + return hasRootDistance; + } + }