return instance;
}
+ /**
+ * TODO: tests needed for logic for determining type of each discovered
+ * service. Then reimplement this routine !
+ *
+ * @return (MSA instances, one AAUI type instance, and the remaining all
+ * sequence analysis instances taking 1 sequence only)
+ */
List<ServiceWithParameters> getServiceInstances()
{
List<ServiceWithParameters> instances = new ArrayList<>();
for (SlivkaService service : services)
{
+ ServiceWithParameters newinstance = null;
for (String classifier : service.classifiers)
{
if (classifier.contains("Multiple sequence alignment"))
{
- instances
- .add(new SlivkaMsaServiceInstance(slivkaClient, service));
+ // MSA services always overwrite
+ newinstance = new SlivkaMsaServiceInstance(slivkaClient, service);
}
- else if (classifier.contains("Protein sequence analysis"))
+ if (classifier.contains("Protein sequence analysis"))
{
- instances.add(new SlivkaAnnotationServiceInstance(slivkaClient,
- service, false));
- }
- else if (classifier
+ if (newinstance == null)
+ {
+ newinstance = (new SlivkaAnnotationServiceInstance(
+ slivkaClient,
+
+ service, false));
+ }
+ }
+
+ if (classifier
.contains("Sequence alignment analysis (conservation)"))
{
- instances.add(new SlivkaAnnotationServiceInstance(slivkaClient,
- service, true));
+ // always overwrite other instances
+ newinstance = new SlivkaAnnotationServiceInstance(slivkaClient,
+ service, true);
}
-
+ }
+ if (newinstance != null)
+ {
+ instances.add(newinstance);
}
}
return instances;