+ /*
+ * replace the feature by deleting it and adding a new one
+ * (to ensure integrity of SequenceFeatures data store)
+ */
+ sequences[0].deleteFeature(sf);
+ SequenceFeature newSf = new SequenceFeature(newType,
+ newDescription, newBegin, newEnd, sf.getScore(),
+ newFeatureGroup);
+ // ensure any additional properties are copied
+ if (sf.otherDetails != null)
+ {
+ newSf.otherDetails = new HashMap<String, Object>(sf.otherDetails);
+ }
+ ffile.parseDescriptionHTML(newSf, false);
+ // add any additional links not parsed from description
+ if (sf.links != null)
+ {
+ for (String link : sf.links)
+ {
+ newSf.addLink(link);
+ }
+ }
+ // amend features only gets one sequence to act on
+ sequences[0].addSequenceFeature(newSf);