reply = FileFormat.Phylip;
break;
}
- else
+ else if (!lineswereskipped && looksLikeJnetData(data))
{
- if (!lineswereskipped && looksLikeJnetData(data))
- {
reply = FileFormat.Jnet;
break;
- }
+
}
+ else // phylogenetic file
+ {
+ String identifier = data.toLowerCase();
+ String secondLine = source.nextLine().toLowerCase();
+ if (identifier.startsWith("<phyloxml")
+ || secondLine.startsWith("<phyloxml"))
+ {
+ reply = FileFormat.PhyloXML;
+ break;
+ }
+ // commented out, nexus parser is troublesome
+ // else if (((identifier.startsWith("nexus"))
+ // || (identifier.startsWith("#nexus"))
+ // || (identifier.startsWith("# nexus"))
+ // || (identifier.startsWith("begin"))))
+ // {
+ // reply = FileFormat.Nexus;
+ // break;
+ // }
+ }
lineswereskipped = true; // this means there was some junk before any
// key file signature
}