+ * Answers a (possibly empty) list of feature types known to the Feature
+ * Renderer which share a top level Sequence Ontology parent with the current
+ * feature type. The current type is not included.
+ *
+ * @return
+ */
+ protected List<String> findSequenceOntologyPeers(String featureType)
+ {
+ List<String> peers = new ArrayList<>();
+
+ /*
+ * first find the SO term (if any) that is the root
+ * parent of the current type
+ */
+ SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+ String[] roots = Cache.getDefault("SO_ROOTS", SO_ROOTS).split(",");
+ rootSOTerm = null;
+ for (String root : roots)
+ {
+ if (so.isA(featureType, root.trim()))
+ {
+ rootSOTerm = root;
+ break;
+ }
+ }
+ if (rootSOTerm == null)
+ {
+ /*
+ * feature type is not an SO term
+ */
+ return peers;
+ }
+
+ List<String> types = fr.getRenderOrder();
+ for (String type : types)
+ {
+ if (!type.equals(featureType) && so.isA(type, rootSOTerm))
+ {
+ peers.add(type);
+ }
+
+ }
+ Collections.sort(peers); // sort for ease of reading in tooltip
+ return peers;
+ }
+
+ /**