import jalview.gui.AlignFrame;
import jalview.gui.JvSwingUtils;
import jalview.util.MessageManager;
-import jalview.ws.api.ServiceWithParameters;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.uimodel.AlignAnalysisUIText;
public class Jws2ClientFactory
{
static boolean registerAAConWSInstance(final JMenu wsmenu,
- final ServiceWithParameters service, final AlignFrame alignFrame)
+ final Jws2Instance service, final AlignFrame alignFrame)
{
- Jws2Instance jaba_service = (Jws2Instance) service;
- final AlignAnalysisUIText aaui = jaba_service.getAlignAnalysisUI(); // null
+ final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null
// ; //
// AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
if (aaui == null)
// public void run()
{
removeCurrentAAConWorkerFor(aaui, alignFrame);
- buildCurrentAAConWorkerFor(aaui, alignFrame, jaba_service);
+ buildCurrentAAConWorkerFor(aaui, alignFrame, service);
}
} // );
}
import jalview.ws.api.MultipleSequenceAlignmentI;
import jalview.ws.api.ServiceWithParameters;
import jalview.ws.gui.MsaWSThread;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.WsParamSetI;
public void attachWSMenuEntry(JMenu rmsawsmenu,
final ServiceWithParameters service, final AlignFrame alignFrame)
{
- if (Jws2ClientFactory.registerAAConWSInstance(rmsawsmenu, service,
- alignFrame))
+ if (service instanceof Jws2Instance
+ && Jws2ClientFactory.registerAAConWSInstance(rmsawsmenu, (Jws2Instance) service, alignFrame))
{
// Alignment dependent analysis calculation WS gui
return;
// TODO Auto-generated constructor stub
}
- public SequenceAnnotationWSClient(final Jws2Instance sh,
+ public SequenceAnnotationWSClient(final ServiceWithParameters sh,
AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
{
super(alignFrame, preset, null);
worker.updateParameters(this.preset, paramset);
}
}
- if (sh.getAction().toLowerCase().contains("disorder"))
+ if (!sh.isInteractiveUpdate())
{
// build IUPred style client. take sequences, returns annotation per
// sequence.
final ServiceWithParameters service,
final AlignFrame alignFrame)
{
- if (Jws2ClientFactory.registerAAConWSInstance(wsmenu, service,
- alignFrame))
+ if (service instanceof Jws2Instance
+ && Jws2ClientFactory.registerAAConWSInstance(wsmenu, (Jws2Instance) service, alignFrame))
{
// Alignment dependent analysis calculation WS gui
return;
}
boolean hasparams = service.hasParameters();
- // Assume name ends in WS
- String calcName = service.getName().substring(0,
- service.getName().length() - 2);
+ String calcName = service.getName();
+ if (calcName.endsWith("WS"))
+ {
+ // Remove "WS" suffix
+ calcName = calcName.substring(0, calcName.length() - 2);
+ }
JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage(
"label.calcname_with_default_settings", new String[]
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient((Jws2Instance) service, alignFrame,
+ new SequenceAnnotationWSClient(service, alignFrame,
null, false);
}
});
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient((Jws2Instance) service, alignFrame,
+ new SequenceAnnotationWSClient(service, alignFrame,
null, true);
}
});
@Override
public void actionPerformed(ActionEvent e)
{
- new SequenceAnnotationWSClient((Jws2Instance) service,
+ new SequenceAnnotationWSClient(service,
alignFrame, preset,
false);
}
{
public BooleanOption(String name, String descr, boolean required,
- boolean defVal, boolean val, URL link)
+ Boolean defVal, Boolean val, URL link)
{
- super(name, descr, required, (defVal ? name : null),
- (val ? name : null),
+ super(name, descr, required, (defVal != null && defVal ? name : null), (val != null && val ? name : null),
Arrays.asList(name), link);
}
import jalview.datamodel.SequenceI;
import jalview.datamodel.features.FeatureMatcherSetI;
import jalview.io.AnnotationFile;
+import jalview.io.DataSourceType;
+import jalview.io.FeaturesFile;
import jalview.ws.api.JobId;
import jalview.ws.api.SequenceAnnotationServiceI;
import jalview.ws.params.ArgumentI;
throw new IOError(e);
}
Alignment aln = new Alignment(seqs.toArray(new SequenceI[0]));
- BufferedReader in = new BufferedReader(new InputStreamReader(annotFile.getContent()));
- AnnotationFile f = new AnnotationFile();
- f.parseAnnotationFrom(aln, null, in);
+ BufferedReader readerIn = new BufferedReader(new InputStreamReader(annotFile.getContent()));
+ new AnnotationFile().parseAnnotationFrom(aln, null, readerIn);
+ if (featFile != null)
+ {
+ new FeaturesFile(featFile.getURL().toString(), DataSourceType.URL).parse(aln, featureColours, true);
+ }
return Arrays.asList(aln.getAlignmentAnnotation());
}
}
SlivkaDatastore(SlivkaService service) throws IOException {
defaultPreset = new SlivkaParamSet(service);
- presets.add(defaultPreset);
}
@Override
@Override
public boolean presetExists(String name)
{
- return name.equals(defaultPreset.getName());
+ for (WsParamSetI preset : presets)
+ {
+ if (preset.getName().equals(name))
+ {
+ return true;
+ }
+ }
+ return false;
}
@Override
package jalview.ws.slivkaws;
-import jalview.datamodel.AlignmentView;
import jalview.gui.AlignFrame;
import jalview.ws.WSMenuEntryProviderI;
import jalview.ws.jws2.MsaWSClient;
import jalview.ws.jws2.SequenceAnnotationWSClient;
-import java.awt.event.ActionEvent;
import java.io.IOError;
import java.io.IOException;
import java.net.URISyntaxException;
import javax.swing.JMenu;
-import javax.swing.JMenuItem;
import uk.ac.dundee.compbio.slivkaclient.SlivkaClient;
import uk.ac.dundee.compbio.slivkaclient.SlivkaService;
{
private static SlivkaWSDiscoverer instance = null;
- private SlivkaClient client;
+ private SlivkaClient slivkaClient;
private SlivkaWSDiscoverer()
{
try
{
- client = new SlivkaClient("gjb-www-1.cluster.lifesci.dundee.ac.uk", 3203);
+ slivkaClient = new SlivkaClient("gjb-www-1.cluster.lifesci.dundee.ac.uk", 3203);
} catch (URISyntaxException e)
{
throw new RuntimeException(e);
slivkaMenu.add(alignmentMenu);
try
{
- for (SlivkaService service : client.getServices())
+ for (SlivkaService service : slivkaClient.getServices())
{
msaClassifier:
{
}
continue;
}
- SlivkaMsaServiceInstance instance = new SlivkaMsaServiceInstance(client, service);
- JMenuItem defaultEntry = new JMenuItem(String.format("%s with defaults", service.label));
- defaultEntry.addActionListener((ActionEvent evt) -> {
- AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- if (msa != null)
- {
- new MsaWSClient(instance, alignFrame.getTitle(), msa, false, true,
- alignFrame.getViewport().getAlignment().getDataset(), alignFrame);
- }
- });
- alignmentMenu.add(defaultEntry);
-
- JMenuItem customEntry = new JMenuItem(String.format("%s with custom parameters", service.label));
- customEntry.addActionListener((ActionEvent evt) -> {
- AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- if (msa != null)
- {
- try
- {
- SlivkaParamSet paramSet = new SlivkaParamSet(service);
- new MsaWSClient(instance, paramSet, null, true, alignFrame.getTitle(), msa, false, true,
- alignFrame.getViewport().getAlignment().getDataset(), alignFrame);
- } catch (IOException exc)
- {
- throw new IOError(exc);
- }
- }
- });
- alignmentMenu.add(customEntry);
-
+ SlivkaMsaServiceInstance instance = new SlivkaMsaServiceInstance(slivkaClient, service);
+ MsaWSClient client = new MsaWSClient();
+ client.attachWSMenuEntry(alignmentMenu, instance, alignFrame);
alignmentMenu.addSeparator();
}
} catch (IOException e)
slivkaMenu.add(disorderMenu);
try
{
- for (SlivkaService service : client.getServices())
+ for (SlivkaService service : slivkaClient.getServices())
{
msaClassifier:
{
}
continue;
}
- JMenuItem menuEntry = new JMenuItem(String.format("%s with custom parameters", service.label));
- disorderMenu.add(menuEntry);
- SlivkaAnnotationServiceInstance serviceInstance = new SlivkaAnnotationServiceInstance(client, service);
- menuEntry.addActionListener((ActionEvent evt) -> {
- try
- {
- SlivkaParamSet paramSet = new SlivkaParamSet(service);
- SequenceAnnotationWSClient client = new SequenceAnnotationWSClient();
- client.initSequenceAnnotationWSClient(serviceInstance, alignFrame, paramSet, true);
- } catch (IOException e)
- {
- throw new IOError(e);
- }
-
- });
+ SlivkaAnnotationServiceInstance serviceInstance = new SlivkaAnnotationServiceInstance(slivkaClient, service);
+ SequenceAnnotationWSClient client = new SequenceAnnotationWSClient();
+ client.attachWSMenuEntry(disorderMenu, serviceInstance, alignFrame);
+ disorderMenu.addSeparator();
}
} catch (IOException e)
{
@Override
public final ParamDatastoreI getParamStore()
{
+ if (store == null)
+ {
+ initParamStore(null);
+ }
return store;
}