private com.stevesoft.pat.Regex[] NodeSafeName = new com.stevesoft.pat.Regex[]
{ new com.stevesoft.pat.Regex().perlCode("m/[\\[,:'()]/"), // test for
- // requiring
- // quotes
+ // requiring
+ // quotes
new com.stevesoft.pat.Regex().perlCode("s/'/''/"), // escaping quote
- // characters
+ // characters
new com.stevesoft.pat.Regex().perlCode("s/\\/w/_/") // unqoted whitespace
- // transformation
+ // transformation
};
char QuoteChar = '\'';
String commentString2 = null; // comments after simple node props
float DefDistance = (float) 0.001; // @param Default distance for a node -
- // very very small
+ // very very small
int DefBootstrap = -1; // @param Default bootstrap for a node
float distance = DefDistance;
int bootstrap = DefBootstrap;
boolean ascending = false; // flag indicating that we are leaving the
- // current node
+ // current node
com.stevesoft.pat.Regex majorsyms = new com.stevesoft.pat.Regex(
"[(\\['),;]");
if (uqnodename.search(fstring)
&& ((uqnodename.matchedFrom(1) == 0) || (fstring
.charAt(uqnodename.matchedFrom(1) - 1) != ':'))) // JBPNote
- // HACK!
+ // HACK!
{
if (nodename == null)
{
if (c == realroot)
{
RootHasDistance = nodehasdistance; // JBPNote This is really
- // UGLY!!! Ensure root node gets
- // its given distance
+ // UGLY!!! Ensure root node gets
+ // its given distance
}
parseNHXNodeProps(c, commentString2);
commentString2 = null;
nodename = null;
distance = DefDistance;
bootstrap = DefBootstrap;
- commentString2=null;
+ commentString2 = null;
}
if (nextcp == 0)
{
// tree is output
if (commentString != null && commentString.startsWith("&&NHX"))
{
- StringTokenizer st = new StringTokenizer(commentString.substring(5),":");
+ StringTokenizer st = new StringTokenizer(commentString.substring(5),
+ ":");
while (st.hasMoreTokens())
{
String tok = st.nextToken();
- int colpos=tok.indexOf("=");
+ int colpos = tok.indexOf("=");
- if (colpos>-1)
+ if (colpos > -1)
{
String code = tok.substring(0, colpos);
- String value = tok.substring(colpos+1);
- try {
+ String value = tok.substring(colpos + 1);
+ try
+ {
// parse out code/value pairs
if (code.toLowerCase().equals("b"))
{
- int v=-1;
+ int v = -1;
Float iv = new Float(value);
v = iv.intValue(); // jalview only does integer bootstraps
- // currently
+ // currently
c.setBootstrap(v);
HasBootstrap = true;
}
// more codes here.
- }
- catch (Exception e)
+ } catch (Exception e)
{
- System.err.println("Couldn't parse code '"+code+"' = '"+value+"'");
+ System.err.println("Couldn't parse code '" + code + "' = '"
+ + value + "'");
e.printStackTrace(System.err);
}
}
}
}
-
-
+
}
/**