From: Mateusz Warowny Date: Fri, 9 Jul 2021 14:44:53 +0000 (+0200) Subject: JAL-3807 Fix SlivkaWSInstance not fetching alignments. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7e4b1da6e7cba557bb9d8e78fcd82b836d5f2d98;p=jalview.git JAL-3807 Fix SlivkaWSInstance not fetching alignments. --- diff --git a/src/jalview/ws/slivkaws/SlivkaJPredServiceInstance.java b/src/jalview/ws/slivkaws/SlivkaJPredServiceInstance.java index a614f02..00843fc 100644 --- a/src/jalview/ws/slivkaws/SlivkaJPredServiceInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaJPredServiceInstance.java @@ -36,7 +36,11 @@ public class SlivkaJPredServiceInstance extends SlivkaWSInstance try { files = client.getJobResults(jobId.getJobId()); for (RemoteFile f : files) { - return readAlignment(f); + if (f.getMimeType().equals("application/clustal") + || f.getMimeType().equals("application/fasta")) + { + return readAlignment(f); + } } } catch (IOException e) { diff --git a/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java b/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java index a04cff5..93c0bdb 100644 --- a/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaMsaServiceInstance.java @@ -1,17 +1,22 @@ package jalview.ws.slivkaws; -import java.io.IOError; -import java.io.IOException; -import java.rmi.ServerError; -import java.util.List; - import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import jalview.io.DataSourceType; +import jalview.io.FileFormat; +import jalview.io.FormatAdapter; import jalview.ws.api.JobId; import jalview.ws.api.MultipleSequenceAlignmentI; import jalview.ws.params.ArgumentI; import jalview.ws.params.InvalidArgumentException; import jalview.ws.params.WsParamSetI; + +import java.io.IOError; +import java.io.IOException; +import java.rmi.ServerError; +import java.util.List; + +import compbio.data.msa.Category; import uk.ac.dundee.compbio.slivkaclient.RemoteFile; import uk.ac.dundee.compbio.slivkaclient.SlivkaClient; import uk.ac.dundee.compbio.slivkaclient.SlivkaService; @@ -32,13 +37,16 @@ public class SlivkaMsaServiceInstance extends SlivkaWSInstance implements Multip @Override public AlignmentI getAlignmentFor(JobId jobId) throws InvalidArgumentException, ServerError, IOError { - List files; try { - files = client.getJobResults(jobId.getJobId()); + List files = client.getJobResults(jobId.getJobId()); for (RemoteFile f : files) { - return readAlignment(f); + if (f.getMimeType().equals("application/clustal") + || f.getMimeType().equals("application/fasta")) + { + return readAlignment(f); + } } } catch (IOException e) { diff --git a/src/jalview/ws/slivkaws/SlivkaWSInstance.java b/src/jalview/ws/slivkaws/SlivkaWSInstance.java index 8aa56fa..138b432 100644 --- a/src/jalview/ws/slivkaws/SlivkaWSInstance.java +++ b/src/jalview/ws/slivkaws/SlivkaWSInstance.java @@ -252,9 +252,9 @@ public abstract class SlivkaWSInstance extends ServiceWithParameters { final var mimetype = f.getMimeType(); FileFormat format; - if (mimetype == "application/clustal") + if (mimetype.equals("application/clustal")) format = FileFormat.Clustal; - else if (mimetype == "application/fasta") + else if (mimetype.equals("application/fasta")) format = FileFormat.Fasta; else return null;