package jalview.ext.forester.io;
+import jalview.api.FeatureSettingsModelI;
+import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceI;
import jalview.ext.archaeopteryx.Tree;
import jalview.ext.treeviewer.TreeI;
import jalview.ext.treeviewer.TreeParserI;
+import jalview.io.AlignmentFileReaderI;
+import jalview.io.DataSourceType;
+import jalview.io.FileParse;
import java.io.IOException;
import org.forester.io.parsers.PhylogenyParser;
+import org.forester.io.parsers.nexus.NexusPhylogeniesParser;
+import org.forester.io.parsers.phyloxml.PhyloXmlParser;
import org.forester.phylogeny.Phylogeny;
-public class ForesterParser implements TreeParserI
+public class ForesterParser implements TreeParserI, AlignmentFileReaderI
{
private final PhylogenyParser parser;
- private SequenceI[] seqs;
-
- public ForesterParser(PhylogenyParser foresterParser)
+ protected ForesterParser(PhylogenyParser foresterParser, FileParse source)
{
parser = foresterParser;
}
{
return parser.getName();
}
+
+ @Override
+ public SequenceI[] getSeqsAsArray()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void addAnnotations(AlignmentI al)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void addGroups(AlignmentI al)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setSeqs(SequenceI[] sequencesArray)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean hasWarningMessage()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public String getWarningMessage()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getInFile()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public DataSourceType getDataSourceType()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public static ForesterParser createNexusParser(FileParse source)
+ {
+ return new ForesterParser(new NexusPhylogeniesParser(), source);
+ }
+
+ public static ForesterParser createPhyloXmlParser(FileParse source)
+ {
+ // support non-xsd validating?
+ return new ForesterParser(
+ PhyloXmlParser.createPhyloXmlParserXsdValidating(), source);
+ }
}
\ No newline at end of file
+++ /dev/null
-package jalview.ext.forester.io;
-
-import jalview.api.FeatureSettingsModelI;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SequenceI;
-import jalview.io.AlignmentFileReaderI;
-import jalview.io.DataSourceType;
-import jalview.io.FileParse;
-
-public class ForesterReader implements AlignmentFileReaderI
-{
-
- public ForesterReader(FileParse source)
- {
- // if (source.getDataSourceType() == DataSourceType.URL)
- // {
- // ParserUtils.createParserDependingOnUrlContents(url,
- // AptxInit.APTX_CONFIG.isValidatePhyloXmlAgainstSchema());
- //
- // }
- // else
- // {
- // ParserUtils.createParserDependingOnFileType(file,
- // AptxInit.APTX_CONFIG.isValidatePhyloXmlAgainstSchema());
- // }
- }
-
- @Override
- public SequenceI[] getSeqsAsArray()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void addAnnotations(AlignmentI al)
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addGroups(AlignmentI al)
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setSeqs(SequenceI[] sequencesArray)
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean hasWarningMessage()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public String getWarningMessage()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getInFile()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public DataSourceType getDataSourceType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public FeatureSettingsModelI getFeatureColourScheme()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
+++ /dev/null
-// package jalview.ext.forester.io;
-//
-// import jalview.api.FeatureSettingsModelI;
-// import jalview.datamodel.AlignmentI;
-// import jalview.datamodel.SequenceI;
-// import jalview.io.AlignmentFileReaderI;
-// import jalview.io.DataSourceType;
-//
-// import org.forester.io.parsers.nexus.NexusPhylogeniesParser;
-//
-// public class NexusParser extends ForesterParser
-// implements AlignmentFileReaderI
-// {
-// NexusPhylogeniesParser nxParser;
-//
-// public NexusParser()
-// {
-// nxParser = new NexusPhylogeniesParser();
-//
-// }
-//
-// @Override
-// public SequenceI[] getSeqsAsArray()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public void addAnnotations(AlignmentI al)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public void addGroups(AlignmentI al)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public void setSeqs(SequenceI[] sequencesArray)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public boolean hasWarningMessage()
-// {
-// // TODO Auto-generated method stub
-// return false;
-// }
-//
-// @Override
-// public String getWarningMessage()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public String getInFile()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public DataSourceType getDataSourceType()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public FeatureSettingsModelI getFeatureColourScheme()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-//
-//
-// }
\ No newline at end of file
+++ /dev/null
-// package jalview.ext.forester.io;
-//
-// import jalview.api.FeatureSettingsModelI;
-// import jalview.datamodel.AlignmentI;
-// import jalview.datamodel.SequenceI;
-// import jalview.io.AlignmentFileReaderI;
-// import jalview.io.DataSourceType;
-//
-// import org.forester.io.parsers.PhylogenyParser;
-// import org.forester.io.parsers.phyloxml.PhyloXmlParser;
-//
-// public class PhyloXMLParser extends ForesterParser
-// implements AlignmentFileReaderI
-// {
-// PhyloXmlParser phxmlParser = PhyloXmlParser
-// .createPhyloXmlParserXsdValidating();
-//
-// public PhyloXMLParser(PhylogenyParser foresterParser)
-// {
-// super(foresterParser);
-// }
-//
-// @Override
-// public SequenceI[] getSeqsAsArray()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public void addAnnotations(AlignmentI al)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public void addGroups(AlignmentI al)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public void setSeqs(SequenceI[] sequencesArray)
-// {
-// // TODO Auto-generated method stub
-//
-// }
-//
-// @Override
-// public boolean hasWarningMessage()
-// {
-// // TODO Auto-generated method stub
-// return false;
-// }
-//
-// @Override
-// public String getWarningMessage()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public String getInFile()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public DataSourceType getDataSourceType()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// @Override
-// public FeatureSettingsModelI getFeatureColourScheme()
-// {
-// // TODO Auto-generated method stub
-// return null;
-// }
-//
-// }
\ No newline at end of file
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
-import jalview.ext.forester.io.ForesterReader;
+import jalview.ext.forester.io.ForesterParser;
import jalview.ext.jmol.JmolParser;
import jalview.structure.StructureImportSettings;
public AlignmentFileReaderI getReader(FileParse source)
throws IOException
{
- return new ForesterReader(source);
+ return ForesterParser.createNexusParser(source);
}
@Override
public AlignmentFileWriterI getWriter(AlignmentI al)
{
- // TODO Auto-generated method stub
+ // handle within Aptx?
return null;
}
public AlignmentFileReaderI getReader(FileParse source)
throws IOException
{
- return new ForesterReader(source);
+ return ForesterParser.createPhyloXmlParser(source);
}
@Override
public AlignmentFileWriterI getWriter(AlignmentI al)
{
- // TODO Auto-generated method stub
+ // handle within Aptx?
return null;
}