--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($Version-Rel$)
+ * Copyright (C) $Year-Rel$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.analysis;
+
+import jalview.api.analysis.SimilarityParamsI;
+
+/**
+ * @author kjvanderheide
+ *
+ */
+public class TreeCalculator
+{
+
+ /**
+ *
+ * @param treeAlgo
+ * @param substitutionMatrix
+ * @param params
+ */
+ public TreeCalculator(String treeAlgo, String substitutionMatrix,
+ SimilarityParamsI calculateParams)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+
+
+}
-/*******************************************************************************
+/*
* Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) 2017 The Jalview Authors
- *
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
- *
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
- *******************************************************************************/
-
+ */
package jalview.ext.archaeopteryx;
-/*******************************************************************************
+/*
* Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) 2017 The Jalview Authors
- *
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
- *
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
- *******************************************************************************/
-
+ */
package jalview.ext.archaeopteryx;
import jalview.analysis.TreeModel;
writer = new PrintWriter(newickFile);
writer.println(newickOutput);
- // System.out.println(writer.checkError());
writer.close();
String[] commandLineArgs = { "-open", newickFile.getCanonicalPath() };
NewickFile newickTree = new NewickFile(tree.getTopNode(),
tree.hasBootstrap(), tree.hasDistances(),
tree.hasRootDistance());
- /* System.out.println(newickTree.print(tree.hasBootstrap(),
- tree.hasDistances(), tree.hasRootDistance()));
-
- System.out.println(newickTree.print(newickTree.hasBootstrap(),
- newickTree.hasDistances(), newickTree.hasRootDistance()));*/
return newickTree;
}
-/*******************************************************************************
+/*
* Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) 2017 The Jalview Authors
- *
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
- *
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
- *******************************************************************************/
-
+ */
package jalview.ext.archaeopteryx;
interface TreeViewerBindingI
package jalview.gui;
import jalview.analysis.TreeBuilder;
+import jalview.analysis.TreeCalculator;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.analysis.scoremodels.SimilarityParams;
import jalview.api.analysis.ScoreModelI;
protected void calculate_actionPerformed()
{
boolean doPCA = pca.isSelected();
- String modelName = modelNames.getSelectedItem().toString();
+ String substitutionMatrix = modelNames.getSelectedItem().toString();
SimilarityParamsI params = getSimilarityParameters(doPCA);
if (doPCA)
{
- openPcaPanel(modelName, params);
+ openPcaPanel(substitutionMatrix, params);
}
else
{
- calculateTree();
- openTreePanel(modelName, params);
+
+ String treeAlgo = determineTreeAlgo();
+ TreeCalculator calculateTree = new TreeCalculator(treeAlgo,
+ substitutionMatrix,
+ params);
+
+ openTreePanel(treeAlgo, substitutionMatrix, params);
}
// closeFrame();
}
- protected void calculateTree()
- {
-
- }
protected String determineTreeAlgo() // to be modified & expanded
{
String treeAlgorithm = neighbourJoining.isSelected()
* Open a new Tree panel on the desktop
*
*/
- protected void openTreePanel(String modelName, SimilarityParamsI params)
+ protected void openTreePanel(String treeType, String substitutionMatrix,
+ SimilarityParamsI params)
{
/*
* gui validation shouldn't allow insufficient sequences here, but leave
*/
checkEnoughSequences(af.getViewport());
- String treeType = determineTreeAlgo();
- af.newTreePanel(treeType, modelName, params);
+
+ af.newTreePanel(treeType, substitutionMatrix, params);
}
/**
class TreeLoader extends Thread
{
- private NewickFile newtree;
+ private NewickFile newTree;
private AlignmentView odata = null;
public TreeLoader(NewickFile newickFile, AlignmentView inputData)
{
- this.newtree = newickFile;
+ this.newTree = newickFile;
this.odata = inputData;
- if (newickFile != null)
+ if (newTree != null)
{
// Must be outside run(), as Jalview2XML tries to
// update distance/bootstrap visibility at the same time
- showBootstrap(newickFile.hasBootstrap());
- showDistances(newickFile.hasDistances());
+ showBootstrap(newTree.hasBootstrap());
+ showDistances(newTree.hasDistances());
}
public void run()
{
- if (newtree != null)
+ if (newTree != null)
{
tree = new TreeModel(av.getAlignment().getSequencesArray(), odata,
- newtree);
+ newTree);
if (tree.getOriginalData() == null)
{
originalSeqData.setVisible(false);
}
- ArchaeopteryxInit archae = new ArchaeopteryxInit(newtree);
- archae.startArchaeopteryx();
+
}
else
tree = new TreeModel(njtree);
showDistances(true);
- ArchaeopteryxInit archae = new ArchaeopteryxInit(tree);
- archae.startArchaeopteryx();
+
}
+ ArchaeopteryxInit archae = new ArchaeopteryxInit(tree);
+ archae.startArchaeopteryx();
tree.reCount(tree.getTopNode());
tree.findHeight(tree.getTopNode());
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($Version-Rel$)
+ * Copyright (C) $Year-Rel$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.gui;
+
+/**
+ * @author kjvanderheide
+ *
+ */
+public class TreeParams implements OptsParametersContainerI
+{
+
+ @Override
+ public void refreshParamLayout()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void argSetModified(Object modifiedElement, boolean b)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}