1 // run an alignment on the current alignFrame
2 import jalview.ws.jws2.*;
3 import jalview.datamodel.*;
5 // First get the JABA service discoverer and see if there are any services.
6 jalview.ws.jws2.Jws2Discoverer disc = jalview.ws.jws2.Jws2Discoverer.getDiscoverer();
7 while (disc.isRunning()) {
10 if (!disc.isRunning() && !disc.hasServices())
12 // discoverer is not running, and has no services - so run it again.
16 for (jalview.ws.jws2.Jws2Discoverer.Jws2Instance service: disc.getServices()) {
18 if (service.serviceType.indexOf("uscle")>-1) {
19 // now - go through the services if any, and find a Muscle service
22 msaf = currentAlFrame;
24 // currentAlFrame is not defined - so we were run as an interactive script from the Groovy console
25 // in that case, just pick the first alignmentFrame in the stack.
26 msaf = Jalview.getAlignframes()[0]
28 // Finally start Jalview's JabaWS MSA Client with the alignment from msaf
29 new MsaWSClient(service, msaf.getTitle(), msaf.gatherSequencesForAlignment(), false,
30 true, msaf.getViewport().getAlignment()