private boolean HasBootstrap = false;
private boolean HasDistances = false;
private boolean RootHasDistance = false;
+
private String ErrorStringrange(String Error, String Er, int r, int p, String s) {
return ((Error==null) ? "" : Error)
+ Er +
super(inFile, type);
}
+ // File IO Flags
+ boolean ReplaceUnderscores = false;
public void parse() throws IOException
{
}
root = new SequenceNode();
+ SequenceNode realroot = null;
SequenceNode c = root;
int d = -1;
int cp = 0;
c.setLeft(new SequenceNode(null, c, 0, null));
c = (SequenceNode) c.left();
}
+ if (realroot==null) {
+ realroot = c;
+ }
nodename = null;
distance = -99999;
bootstrap = -99999;
{
if (nodename == null)
{
- nodename = uqnodename.stringMatched(1).replace('_', ' ');
+ if (ReplaceUnderscores) {
+ nodename = uqnodename.stringMatched(1).replace('_', ' ');
+ } else {
+ nodename = uqnodename.stringMatched(1);
+ }
}
else
{
cp + nbootstrap.matchedFrom(), nf);
}
}
-
+ boolean nodehasdistance=false;
if (ndist.search(fstring))
{
try
{
distance = (new Float(ndist.stringMatched(1))).floatValue();
HasDistances = true;
- if (c.parent()==root) {
- RootHasDistance = true;
- }
+ nodehasdistance = true;
}
catch (Exception e)
{
c.setName(nodename);
c.dist = (HasDistances) ? distance : 0;
c.setBootstrap((HasBootstrap) ? bootstrap : 0);
+ if (c==realroot) {
+ RootHasDistance = nodehasdistance; // JBPNote This is really UGLY!!!
+ }
}
else
{
}
root = (SequenceNode) root.right().detach(); // remove the imaginary root.
+ if (!RootHasDistance) {
+ root.dist = 0;
+ }
}
public NewickFile(SequenceNode newtree) {