+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
+ * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ *
+ * This program 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 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
package jalview.io.vamsas;
import java.io.IOException;
prov.getEntry(0).getParam(0).setName("treeType");
prov.getEntry(0).getParam(0).setType("utf8");
prov.getEntry(0).getParam(0).setContent("NJ"); // TODO: type of tree is a
- // general parameter
+ // general parameter
int ranges[] = tp.getTree().seqData.getVisibleContigs();
// VisibleContigs are with respect to alignment coordinates. Still need
// offsets
*/
public void UpdateSequenceTreeMap(TreePanel tp)
{
- if (tp == null || tree != null)
+ if (tp == null || tree == null)
return;
Vector leaves = new Vector();
+ if (tp.getTree() == null)
+ {
+ Cache.log.warn("Not updating SequenceTreeMap for "
+ + tree.getVorbaId());
+ return;
+ }
tp.getTree().findLeaves(tp.getTree().getTopNode(), leaves);
Treenode[] tn = tree.getTreenode(); // todo: select nodes for this
- // particular tree
+ // particular tree
int sz = tn.length;
int i = 0;
BinaryNode mappednode = findNodeSpec(node.getNodespec(), leaves);
if (mappednode != null && mappednode instanceof SequenceNode)
{
- SequenceNode leaf = (SequenceNode) leaves.elementAt(i++);
+ SequenceNode leaf = (SequenceNode) mappednode;
// check if we can make the specified association
Object jvseq = null;
int vrf = 0, refv = 0;
* construct treenode mappings for mapped sequences
*
* @param ntree
- * @param newick
+ * @param newick
* @return
*/
public Treenode[] makeTreeNodes(NJTree ntree, Newick newick)
* referenced in input data has already been associated with jalview objects.
*
* @param tp
- * @param alignFrame
+ * @param alignFrame
* @return Object[] { AlignmentView, AlignmentI - reference alignment for
* input }
*/
// is this the whole alignment or a specific set of sequences ?
if (vInput.getObjRefCount() == 0)
{
- if (tree.getV_parent()!=null && tree.getV_parent() instanceof uk.ac.vamsas.objects.core.Alignment)
+ if (tree.getV_parent() != null
+ && tree.getV_parent() instanceof uk.ac.vamsas.objects.core.Alignment)
{
javport = getViewport(tree.getV_parent());
jal = javport.getAlignment();
else if (vInput.getObjRef(0) instanceof uk.ac.vamsas.objects.core.AlignmentSequence)
{
// recover an AlignmentView for the input data
- javport = getViewport(((Vobject) vInput.getObjRef(0)).getV_parent());
+ javport = getViewport(((Vobject) vInput.getObjRef(0))
+ .getV_parent());
jal = javport.getAlignment();
jalview.datamodel.SequenceI[] seqs = new jalview.datamodel.SequenceI[vInput
.getObjRefCount()];
{
try
{
+ if (ntree == null)
+ {
+ return false;
+ }
ntree.parse();
if (ntree.getTree() != null)
{