{
SequenceIdMatcher algnIds = new SequenceIdMatcher(alignSequences);
-
-
List<PhylogenyNode> leaves = tree.getExternalNodes();
SequenceI nodeSequence;
String nodeSequenceName;
.createForesterSequence(nodeSequence, true);
treeNode.getNodeData().setSequence(foresterNodeSeq);
- alignmentWithNodes.put(nodeSequence, treeNode);
- nodesWithAlignment.put(treeNode, nodeSequence);
+ ExternalTreeBuilderI.putWithDuplicationCheck(alignmentWithNodes,
+ nodeSequence, treeNode);
+ ExternalTreeBuilderI.putWithDuplicationCheck(nodesWithAlignment,
+ treeNode, nodeSequence);
+
+
}
}
public String generateTreeName();
+ /**
+ * probably move
+ *
+ * @param map
+ * @param key
+ * @param value
+ * @return
+ */
+ static <K, V> Map<K, V> putWithDuplicationCheck(Map<K, V> map, K key,
+ V value)
+ {
+ if (!map.containsKey(key))
+ {
+ map.put(key, value);
+ }
+ else
+ {
+ jalview.bin.Cache.log.warn(
+ "Attempt to add duplicate entry detected for map with key: "
+ + key.toString() + " and value: " + value.toString());
+ }
+
+ return map;
+
+ }
+
}