From: Jim Procter Date: Wed, 25 Sep 2013 15:28:31 +0000 (+0100) Subject: JAL-1365 refactored core methods from RNAAliFold and AACon service clients to a commo... X-Git-Tag: Jalview_2_9~200^2~21^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=44396db56b65458459eb38b399a52e0962b5bdab;p=jalview.git JAL-1365 refactored core methods from RNAAliFold and AACon service clients to a common Alignment Analysis client class --- diff --git a/src/jalview/ws/jws2/AAConClient.java b/src/jalview/ws/jws2/AAConClient.java index 7f3847b..3d50026 100644 --- a/src/jalview/ws/jws2/AAConClient.java +++ b/src/jalview/ws/jws2/AAConClient.java @@ -48,23 +48,6 @@ public class AAConClient extends JabawsAlignCalcWorker initViewportParams(); } - protected void initViewportParams() - { - ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor( - getCalcId(), - new AAConSettings(true, service, this.preset, - (arguments != null) ? JabaParamStore - .getJwsArgsfromJaba(arguments) : null), true); - } - - @Override - public void updateParameters(WsParamSetI newpreset, - java.util.List newarguments) - { - super.updateParameters(newpreset, newarguments); - initViewportParams(); - }; - public String getServiceActionText() { return "calculating Amino acid consensus using AACon service"; @@ -114,17 +97,13 @@ public class AAConClient extends JabawsAlignCalcWorker } } + @Override public String getCalcId() { - return SequenceAnnotationWSClient.AAConCalcId; + return CALC_ID; } + private static String CALC_ID="jabaws2.AACon"; - public static void removeAAConsAnnotation(AlignmentPanel alignPanel) { - for (AlignmentAnnotation aa : alignPanel.getAlignment().findAnnotation( - SequenceAnnotationWSClient.AAConCalcId)) - { - alignPanel.getAlignment().deleteAnnotation(aa); - } } } diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index 3c19dc5..8db1358 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -41,7 +41,7 @@ import compbio.data.sequence.Score; import compbio.data.sequence.ScoreManager.ScoreHolder; import compbio.metadata.Argument; -public class AADisorderClient extends JabawsAlignCalcWorker implements +public class AADisorderClient extends JabawsCalcWorker implements AlignCalcWorkerI { diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java index 720e76a..baafc8a 100644 --- a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java @@ -17,614 +17,65 @@ */ package jalview.ws.jws2; -import jalview.analysis.AlignSeq; -import jalview.analysis.SeqsetUtils; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.Annotation; -import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.gui.IProgressIndicator; import jalview.workers.AlignCalcWorker; -import jalview.ws.jws2.dm.JabaWsParamSet; +import jalview.ws.jws2.dm.AAConSettings; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; -import java.util.Map; import compbio.data.msa.SequenceAnnotation; -import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.Score; -import compbio.data.sequence.ScoreManager; import compbio.metadata.Argument; -import compbio.metadata.ChunkHolder; -import compbio.metadata.JobStatus; -import compbio.metadata.JobSubmissionException; -import compbio.metadata.Option; -import compbio.metadata.ResultNotAvailableException; -import compbio.metadata.WrongParameterException; -public abstract class JabawsAlignCalcWorker extends AlignCalcWorker +public abstract class JabawsAlignCalcWorker extends JabawsCalcWorker { - Jws2Instance service; - - @SuppressWarnings("unchecked") - protected SequenceAnnotation aaservice; - - protected ScoreManager scoremanager; - - protected WsParamSetI preset; - - protected List arguments; public JabawsAlignCalcWorker(AlignViewportI alignViewport, AlignmentViewPanel alignPanel) { super(alignViewport, alignPanel); } - - IProgressIndicator guiProgress; - + + + + public JabawsAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame, WsParamSetI preset, List paramset) { - this(alignFrame.getCurrentView(), alignFrame.alignPanel); - this.guiProgress = alignFrame; - this.preset = preset; - this.arguments = paramset; - this.service = service; - aaservice = (SequenceAnnotation) service.service; - - } - - public WsParamSetI getPreset() - { - return preset; - } - - public List getArguments() - { - return arguments; - } - - /** - * reconfigure and restart the AAConClient. This method will spawn a new - * thread that will wait until any current jobs are finished, modify the - * parameters and restart the conservation calculation with the new values. - * - * @param newpreset - * @param newarguments - */ - public void updateParameters(final WsParamSetI newpreset, - final List newarguments) - { - preset = newpreset; - arguments = newarguments; - calcMan.startWorker(this); - } - - public List