- } catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- System.out.println("Problem reading annotation file: " + ex);\r
- return false;\r
+ while (en.hasMoreElements())\r
+ {\r
+ groupRef = (String) en.nextElement();\r
+ boolean matched = false;\r
+ // Resolve group: TODO: add a getGroupByName method to alignments\r
+ Vector grps = al.getGroups();\r
+ for (int g = 0, gSize = grps.size(); g < gSize; g++)\r
+ {\r
+ theGroup = (SequenceGroup) grps.elementAt(g);\r
+ if (theGroup.getName().equals(groupRef))\r
+ {\r
+ if (matched)\r
+ {\r
+ // TODO: specify and implement duplication of alignment annotation\r
+ // for multiple group references.\r
+ System.err\r
+ .println("Ignoring 1:many group reference mappings for group name '"\r
+ + groupRef + "'");\r
+ }\r
+ else\r
+ {\r
+ matched = true;\r
+ Vector rowset = (Vector) groupRefRows.get(groupRef);\r
+ if (rowset != null && rowset.size() > 0)\r
+ {\r
+ AlignmentAnnotation alan = null;\r
+ for (int elm = 0, elmSize = rowset.size(); elm < elmSize; elm++)\r
+ {\r
+ alan = (AlignmentAnnotation) rowset.elementAt(elm);\r
+ alan.groupRef = theGroup;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ ((Vector) groupRefRows.get(groupRef)).removeAllElements();\r
+ }\r