--- /dev/null
+package jalview.ext.forester.io;
+
+import jalview.datamodel.SequenceI;
+import jalview.ext.treeviewer.TreeI;
+import jalview.ext.treeviewer.TreeParserI;
+import jalview.io.AlignFile;
+import jalview.io.FileParse;
+
+import java.io.File;
+import java.io.IOException;
+
+public class NexusFile extends AlignFile
+{
+
+ public NexusFile(FileParse source) throws IOException
+ {
+ super(source);
+ }
+
+ @Override
+ public String print(SequenceI[] seqs, boolean jvsuffix)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void parse() throws IOException
+ {
+ TreeParserI parser = ForesterParser
+ .createNexusParser(new File(getDataName()));
+ TreeI[] trees = parser.parse();
+ for (TreeI tree : trees) {
+ for (SequenceI seq : tree.getNodeSequences()) {
+ seqs.add(seq);
+ }
+ }
+
+ }
+
+}
--- /dev/null
+package jalview.ext.forester.io;
+
+import jalview.datamodel.SequenceI;
+import jalview.ext.treeviewer.TreeI;
+import jalview.ext.treeviewer.TreeParserI;
+import jalview.io.AlignFile;
+import jalview.io.FileParse;
+
+import java.io.File;
+import java.io.IOException;
+
+public class PhyloXmlFile extends AlignFile
+{
+
+ public PhyloXmlFile(FileParse source) throws IOException
+ {
+ super(source);
+ }
+
+ @Override
+ public String print(SequenceI[] seqs, boolean jvsuffix)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void parse() throws IOException
+ {
+ TreeParserI parser = ForesterParser
+ .createPhyloXmlParser(new File(getDataName()));
+ TreeI[] trees = parser.parse();
+ for (SequenceI seq : trees[0].getNodeSequences())
+ {
+ seqs.add(seq);
+ }
+
+ }
+
+}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
-import jalview.ext.forester.io.ForesterParser;
+import jalview.ext.forester.io.NexusFile;
+import jalview.ext.forester.io.PhyloXmlFile;
import jalview.ext.jmol.JmolParser;
import jalview.structure.StructureImportSettings;
public AlignmentFileReaderI getReader(FileParse source)
throws IOException
{
- return ForesterParser.createNexusParser(source);
+ return new NexusFile(source);
}
@Override
public AlignmentFileReaderI getReader(FileParse source)
throws IOException
{
- return ForesterParser.createPhyloXmlParser(source);
+ return new PhyloXmlFile(source);
}
@Override