From 54b89d1e894c6d89adba7c37db1546b629712d38 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Tue, 9 Jan 2018 17:34:11 +0000 Subject: [PATCH] JAL-2805 Creating jalview sequence now requires the node itself (for the name) --- src/jalview/ext/archaeopteryx/TreeNode.java | 2 +- src/jalview/ext/forester/DataConversions.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jalview/ext/archaeopteryx/TreeNode.java b/src/jalview/ext/archaeopteryx/TreeNode.java index 69077dc..b43e9b4 100644 --- a/src/jalview/ext/archaeopteryx/TreeNode.java +++ b/src/jalview/ext/archaeopteryx/TreeNode.java @@ -32,7 +32,7 @@ public class TreeNode implements TreeNodeI if (aptxNode.getNodeData().getSequence() != null) { nodeSeq = DataConversions - .createJalviewSequence(aptxNode.getNodeData().getSequence()); + .createJalviewSequence(aptxNode); } originalNodes.put(aptxNode, this); wrappedNodes.put(this, aptxNode); diff --git a/src/jalview/ext/forester/DataConversions.java b/src/jalview/ext/forester/DataConversions.java index 4985f5f..c6819a5 100644 --- a/src/jalview/ext/forester/DataConversions.java +++ b/src/jalview/ext/forester/DataConversions.java @@ -6,6 +6,7 @@ import jalview.math.MatrixI; import org.forester.evoinference.matrix.distance.DistanceMatrix; import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException; +import org.forester.phylogeny.PhylogenyNode; public final class DataConversions { @@ -42,10 +43,13 @@ public final class DataConversions } public static SequenceI createJalviewSequence( - org.forester.phylogeny.data.Sequence foresterSeq) + PhylogenyNode foresterNode) { - String seq = foresterSeq.getMolecularSequence(); - SequenceI jalviewSeq = new Sequence(foresterSeq.getName(), seq, 1, + String seq = foresterNode.getNodeData().getSequence() + .getMolecularSequence(); + String seqName = foresterNode.getName(); + + SequenceI jalviewSeq = new Sequence(foresterNode.getName(), seq, 1, seq.length() + 1); return jalviewSeq.deriveSequence(); -- 1.7.10.2