import jalview.io.AnnotationFile;
import jalview.io.DataSourceType;
import jalview.io.FeaturesFile;
+import jalview.util.MessageManager;
import jalview.ws.api.JobId;
import jalview.ws.api.SequenceAnnotationServiceI;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.WsParamSetI;
+import jalview.ws.uimodel.AlignAnalysisUIText;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
public class SlivkaAnnotationServiceInstance extends SlivkaWSInstance implements SequenceAnnotationServiceI
{
- public SlivkaAnnotationServiceInstance(SlivkaClient client, SlivkaService service)
+ public SlivkaAnnotationServiceInstance(SlivkaClient client,
+ SlivkaService service, boolean conservation)
{
- super(client, service, "Annotations disorder");
+ super(client, service, !conservation ? "Annotations disorder"
+ : "Alignment Conservation");
+ if (conservation)
+ {
+ setAlignAnalysisUI(new AlignAnalysisUIText(getServiceType(),
+ SlivkaAnnotationServiceInstance.class,
+ "Slivka.AACons", false, true, true, true, true, 2,
+ MessageManager.getString("label.aacon_calculations"),
+ MessageManager.getString("tooltip.aacon_calculations"),
+ MessageManager.getString("label.aacon_settings"),
+ MessageManager.getString("tooltip.aacon_settings")));
+ }
}
@Override
return instance;
}
+ private void addMsaServiceClient(JMenu alignmentMenu,
+ SlivkaService service, AlignFrame alignFrame)
+ {
+ SlivkaMsaServiceInstance instance = new SlivkaMsaServiceInstance(
+ slivkaClient, service);
+ MsaWSClient client = new MsaWSClient();
+ client.attachWSMenuEntry(alignmentMenu, instance, alignFrame);
+ alignmentMenu.addSeparator();
+ }
+
+ private void addDisorderServiceClient(JMenu disorderMenu,
+ SlivkaService service, AlignFrame alignFrame)
+ {
+ SlivkaAnnotationServiceInstance serviceInstance = new SlivkaAnnotationServiceInstance(
+ slivkaClient, service, false);
+ SequenceAnnotationWSClient client = new SequenceAnnotationWSClient();
+ client.attachWSMenuEntry(disorderMenu, serviceInstance, alignFrame);
+ disorderMenu.addSeparator();
+ }
+
+ private void addConservationServiceClient(JMenu conservationMenu,
+ SlivkaService service, AlignFrame alignFrame)
+ {
+ SlivkaAnnotationServiceInstance serviceInstance = new SlivkaAnnotationServiceInstance(
+ slivkaClient, service, true);
+ SequenceAnnotationWSClient client = new SequenceAnnotationWSClient();
+ client.attachWSMenuEntry(conservationMenu, serviceInstance, alignFrame);
+ conservationMenu.addSeparator();
+ }
+
@Override
public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
{
JMenu alignmentMenu = new JMenu("Sequence Alignment");
slivkaMenu.add(alignmentMenu);
- try
- {
- for (SlivkaService service : slivkaClient.getServices())
- {
- msaClassifier:
- {
- for (String classifier : service.classifiers)
- {
- if (classifier.contains("Multiple sequence alignment"))
- {
- break msaClassifier;
- }
- }
- continue;
- }
- SlivkaMsaServiceInstance instance = new SlivkaMsaServiceInstance(slivkaClient, service);
- MsaWSClient client = new MsaWSClient();
- client.attachWSMenuEntry(alignmentMenu, instance, alignFrame);
- alignmentMenu.addSeparator();
- }
- } catch (IOException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
JMenu disorderMenu = new JMenu("Protein sequence analysis");
slivkaMenu.add(disorderMenu);
+ JMenu conservationMenu = new JMenu("Conservation");
+ slivkaMenu.add(conservationMenu);
try
{
for (SlivkaService service : slivkaClient.getServices())
{
- msaClassifier:
+ for (String classifier : service.classifiers)
{
- for (String classifier : service.classifiers)
+ if (classifier.contains("Multiple sequence alignment"))
+ {
+ addMsaServiceClient(alignmentMenu, service, alignFrame);
+ }
+ else if (classifier.contains("Protein sequence analysis"))
{
- if (classifier.contains("Protein sequence analysis"))
- {
- break msaClassifier;
- }
+ addDisorderServiceClient(disorderMenu, service, alignFrame);
}
- continue;
+ else if (classifier
+ .contains("Sequence alignment analysis (conservation)"))
+ {
+ addConservationServiceClient(conservationMenu, service,
+ alignFrame);
+ }
+
}
- SlivkaAnnotationServiceInstance serviceInstance = new SlivkaAnnotationServiceInstance(slivkaClient, service);
- SequenceAnnotationWSClient client = new SequenceAnnotationWSClient();
- client.attachWSMenuEntry(disorderMenu, serviceInstance, alignFrame);
- disorderMenu.addSeparator();
}
} catch (IOException e)
{