/* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ 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.AnnotatedCollectionI; 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.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 { 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