package org.cipres.kepler.testcase; // import org.cipres.kepler.registry.Globals; public class TestRecIDCM3Workflow { /** * test input file name * You may want to change it to the path of your test nexus file */ public final static String TEST_NEXUS_INFILE = "C://work//Cipres-Kepler//dist//jar//cipres//help//sampleFiles//TestNexusFile.nex"; /** * @main test program */ public static void main(String[] args) { // Step 1: initializer // TODO: this is never read //TestInitializerActor initializer = new TestInitializerActor(); // Step 2: nexus file reader TestNexusFileReaderActor nexusFileReader = new TestNexusFileReaderActor(); if (args.length > 0) nexusFileReader.setNexusFileName(args[1]); else nexusFileReader.setNexusFileName(TEST_NEXUS_INFILE); // Step 3: phylodataset TestPhyloDataReaderActor phyloDataReader = new TestPhyloDataReaderActor(); phyloDataReader.setNexusData(nexusFileReader.getNexusFileContent()); // Branch 1: Step 3.1.1 : tree parser for the original tree TestTreeParserActor treeParserOriginal = new TestTreeParserActor(); treeParserOriginal.setTree(phyloDataReader.getTree()); // Branch 1: Step 3.1.2 : display original tree info System.out.println("Original tree score: "+treeParserOriginal.getTreeScore()); System.out.println("Original tree expression: "+treeParserOriginal.getTreeNewick()); System.out.println("Display original tree with TreeViz:"); TestTreeVizForesterActor treeVizOriginal = new TestTreeVizForesterActor(); treeVizOriginal.setTreeNewick(treeParserOriginal.getTreeNewick()); treeVizOriginal.showTree(); // Branch 2: Step 3.2.1 : RecIDCM3 TestRecIDCM3Actor recIDCM3 = new TestRecIDCM3Actor(); recIDCM3.setDataMatrix(phyloDataReader.getDataMatrix()); recIDCM3.setTree(phyloDataReader.getTree()); // Branch 2: Step 3.2.2 : tree parser for the improved tree TestTreeParserActor treeParserImproved = new TestTreeParserActor(); treeParserImproved.setTree(recIDCM3.getFinalTree()); // Branch 2: Step 3.2.3 : display improved tree info System.out.println("Improved tree name: "+treeParserImproved.getTreeName()); System.out.println("Improved tree score: "+treeParserImproved.getTreeScore()); System.out.println("Improved tree leaf set: "+treeParserImproved.getTreeLeafSet()); System.out.println("Improved tree expression: "+treeParserImproved.getTreeNewick()); System.out.println("Display improved tree with TreeViz:"); TestTreeVizForesterActor treeVizImproved = new TestTreeVizForesterActor(); treeVizImproved.setTreeNewick(treeParserImproved.getTreeNewick()); treeVizImproved.showTree(); System.out.println("Workflow is finished!"); } }