From 41c664e5da66facb7c2af50a8ba81c327e0d1700 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Tue, 9 Jan 2018 14:23:43 +0000 Subject: [PATCH] JAL-2805 added check for sequences already being present in tree nodes --- .../treeviewer/LoadedTreeSequenceAssociation.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/jalview/ext/treeviewer/LoadedTreeSequenceAssociation.java b/src/jalview/ext/treeviewer/LoadedTreeSequenceAssociation.java index 4229b50..3711e81 100644 --- a/src/jalview/ext/treeviewer/LoadedTreeSequenceAssociation.java +++ b/src/jalview/ext/treeviewer/LoadedTreeSequenceAssociation.java @@ -59,9 +59,25 @@ public class LoadedTreeSequenceAssociation nodeSequence = algnIds.findIdMatch(nodeSequenceName); if (nodeSequence != null) { - + // is there already a sequence present for the node? + // If so, does it actually match Jalview's sequence? + if (treeNode.getSequence() != null) + { + if (treeNode.getSequence().getSequenceAsString() != nodeSequence + .getSequenceAsString()) + { + System.err.println( + "Sequence detected in tree node that does not match corresponding Jalview sequence:" + + nodeSequenceName); + // which sequence gets precedence? + + } + + } + else + { treeNode.setSequence(nodeSequence); - + } MappingUtils.putWithDuplicationCheck(alignmentWithNodes, nodeSequence, treeNode); MappingUtils.putWithDuplicationCheck(nodesWithAlignment, treeNode, -- 1.7.10.2