From: jprocter Date: Wed, 5 Jan 2011 16:04:56 +0000 (+0000) Subject: todo and ensure old annotation/groups are removed before new ones loaded back X-Git-Tag: Release_2_7~325 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6d7e3b1dc29d9639f01d45eef7aff4e42302d1c9;p=jalview.git todo and ensure old annotation/groups are removed before new ones loaded back --- diff --git a/src/jalview/ws/rest/RestJob.java b/src/jalview/ws/rest/RestJob.java index 445c249..82b157d 100644 --- a/src/jalview/ws/rest/RestJob.java +++ b/src/jalview/ws/rest/RestJob.java @@ -11,6 +11,7 @@ import java.util.Map.Entry; import java.util.Set; import java.util.Vector; +import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentOrder; import jalview.datamodel.AlignmentView; @@ -96,6 +97,7 @@ public class RestJob extends AWsJob } else { + // TODO: move validation of input data to SeqGroupIndexVector if ((prm.getValue() instanceof SeqGroupIndexVector) && (_input.getGroups() != null && _input.getGroups() .size() > 0)) @@ -256,6 +258,19 @@ public class RestJob extends AWsJob context = new JalviewDataset(dsForIO, null, squniq, null); if (contextAl!=null) { + // TODO devise way of merging new annotation onto (identical) existing annotation that was used as input + // delete all input annotation + if (contextAl.getAlignmentAnnotation()!=null) { + for (AlignmentAnnotation alan: contextAl.getAlignmentAnnotation()) { + contextAl.deleteAnnotation(alan); + } + } + // TODO devise way of merging new groups onto (identical) existing groups when they were used as input to service + // delete all existing groups + if (contextAl.getGroups()!=null) + { + contextAl.deleteAllGroups(); + } context.addAlignment(contextAl); }