From 99ab39d360a99ec101152070146b63773a1d6453 Mon Sep 17 00:00:00 2001 From: pvtroshin Date: Wed, 8 Jun 2011 16:03:25 +0000 Subject: [PATCH] More work to disorder prediction client & services. git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4236 e3abac25-378b-4346-85de-24260fe3988d --- TODO.txt | 3 - .../data/sequence/ClustalAlignmentUtil.java | 12 +-- datamodel/compbio/data/sequence/Range.java | 2 +- datamodel/compbio/data/sequence/Score.java | 33 +++--- datamodel/compbio/data/sequence/ScoreManager.java | 37 +++---- datamodel/compbio/data/sequence/SequenceUtil.java | 2 +- .../data/sequence/ClustalAlignmentUtilTester.java | 113 ++++++++++---------- .../compbio/data/sequence/SequenceUtilTester.java | 8 +- .../compbio/ws/client/AAConWSClientExample.java | 6 +- webservices/compbio/ws/client/AAConClient.java | 17 +-- webservices/compbio/ws/client/IOHelper.java | 30 +++--- webservices/compbio/ws/client/Jws2Client.java | 15 +-- webservices/compbio/ws/server/AAConWS.java | 9 +- webservices/compbio/ws/server/WSUtil.java | 30 +++++- .../compbio/ws/server/resource/TcoffeeWS.wsdl | 36 +++---- 15 files changed, 192 insertions(+), 161 deletions(-) diff --git a/TODO.txt b/TODO.txt index 74a7d13..539954e 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,9 +4,6 @@ webservices - 1 week client - 1 week docs - 1 week -make sure that aacon checks its input (must be alignment) and log errors/throws -exceptions if the input is not correct or absent! - Cluster stats: +cancelled should not be reported as incomplete! -Remove hyperlinks from tasks which workdirs were removed diff --git a/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java b/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java index 2d1a616..2656046 100644 --- a/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java +++ b/datamodel/compbio/data/sequence/ClustalAlignmentUtil.java @@ -24,9 +24,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; +import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -207,12 +205,10 @@ public final class ClustalAlignmentUtil { * @param alignment * @throws IOException */ - public static void writeClustalAlignment(final OutputStream outStream, + public static void writeClustalAlignment(final Writer out, final Alignment alignment) throws IOException { List seqs = alignment.getSequences(); - PrintWriter out = new PrintWriter(new OutputStreamWriter(outStream)); - out.write("CLUSTAL\n\n\n"); int max = 0; @@ -249,10 +245,10 @@ public final class ClustalAlignmentUtil { // display at most 30 characters in the name, keep the names // 6 spaces away from the alignment for longest sequence names, // and more than this for shorter names - out.format( + out.write(String.format( "%-" + maxidLength + "s" + spacer, (name.length() > maxNameLength ? name.substring(0, - maxidLength) : name)); + maxidLength) : name))); int start = i * oneLineAlignmentLength; int end = start + oneLineAlignmentLength; diff --git a/datamodel/compbio/data/sequence/Range.java b/datamodel/compbio/data/sequence/Range.java index 1fabc07..a22ab8c 100644 --- a/datamodel/compbio/data/sequence/Range.java +++ b/datamodel/compbio/data/sequence/Range.java @@ -26,7 +26,7 @@ public class Range implements Comparable { @Override public String toString() { - return "[" + from + ", " + to + "]"; + return from + "-" + to; } @Override diff --git a/datamodel/compbio/data/sequence/Score.java b/datamodel/compbio/data/sequence/Score.java index f28bd0d..804ef8c 100644 --- a/datamodel/compbio/data/sequence/Score.java +++ b/datamodel/compbio/data/sequence/Score.java @@ -1,13 +1,10 @@ package compbio.data.sequence; -import java.io.BufferedWriter; import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; +import java.io.Writer; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Locale; -import java.util.Set; import java.util.TreeSet; import javax.xml.bind.annotation.XmlAccessType; @@ -24,7 +21,7 @@ import compbio.util.annotation.Immutable; */ @XmlAccessorType(XmlAccessType.FIELD) @Immutable -public class Score { +public class Score implements Comparable { static final NumberFormat NUMBER_FORMAT = NumberFormat .getNumberInstance(Locale.UK); @@ -41,7 +38,7 @@ public class Score { private Score() { // JaXB default constructor - method = null; + method = ""; } /** @@ -193,20 +190,32 @@ public class Score { * @throws NullPointerException * if the output stream is null */ - public static void write(Set scores, OutputStream output) + public static void write(TreeSet scores, Writer writer) throws IOException { - if (output == null) { - throw new NullPointerException("OutputStream must be provided!"); + if (writer == null) { + throw new NullPointerException("Writer must be provided!"); } - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - output)); for (Score score : scores) { writer.write("#" + score.method + " "); - for (Float scoreVal : score.getScores()) { + int count = score.ranges.size(); + for (Range range : score.ranges) { + count--; + writer.write(range.toString()); + if (count != 0) { + writer.write(", "); + } + } + for (Float scoreVal : score.scores) { writer.write(NUMBER_FORMAT.format(scoreVal) + " "); } writer.write("\n"); + writer.flush(); } writer.flush(); } + + @Override + public int compareTo(Score o) { + return this.method.compareTo(o.method); + } } diff --git a/datamodel/compbio/data/sequence/ScoreManager.java b/datamodel/compbio/data/sequence/ScoreManager.java index 7ddf894..4be41d5 100644 --- a/datamodel/compbio/data/sequence/ScoreManager.java +++ b/datamodel/compbio/data/sequence/ScoreManager.java @@ -1,15 +1,13 @@ package compbio.data.sequence; -import java.io.BufferedWriter; import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; +import java.io.Writer; import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -47,9 +45,9 @@ public class ScoreManager { public static ScoreManager newInstanceSingleScore( Map seqScoresMap) { - Map> multipleScoresMap = new HashMap>(); + Map> multipleScoresMap = new TreeMap>(); for (Map.Entry seqScore : seqScoresMap.entrySet()) { - Set scores = new HashSet(); + Set scores = new TreeSet(); scores.add(seqScore.getValue()); multipleScoresMap.put(seqScore.getKey(), scores); } @@ -57,13 +55,15 @@ public class ScoreManager { } public static ScoreManager newInstanceSingleSequence(Set data) { - return new ScoreManager(ScoreManager.SINGLE_ENTRY_KEY, data); + return new ScoreManager(ScoreManager.SINGLE_ENTRY_KEY, + new TreeSet(data)); } - public Map> asMap() { - Map> seqScoresMap = new HashMap>(); + public Map> asMap() { + Map> seqScoresMap = new TreeMap>(); for (ScoreHolder sch : this.seqScores) { - Set oldValue = seqScoresMap.put(sch.id, sch.scores); + TreeSet oldValue = seqScoresMap.put(sch.id, new TreeSet( + sch.scores)); if (oldValue != null) { throw new IllegalStateException( "Cannot represent this ScoreManager instance " @@ -98,13 +98,10 @@ public class ScoreManager { return null; } - public void writeOut(OutputStream outStream) throws IOException { - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - outStream)); + public void writeOut(Writer outStream) throws IOException { for (ScoreHolder oneSeqScores : seqScores) { oneSeqScores.writeOut(outStream); } - writer.flush(); } @Override @@ -137,7 +134,7 @@ public class ScoreManager { public static class ScoreHolder { public String id; - public HashSet scores; + public TreeSet scores; private ScoreHolder() { // JAXB Default constructor should not be used otherwise @@ -145,14 +142,12 @@ public class ScoreManager { ScoreHolder(String id, Set scores) { this.id = id; - this.scores = new HashSet(scores); + this.scores = new TreeSet(scores); } - public void writeOut(OutputStream outStream) throws IOException { - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - outStream)); + public void writeOut(Writer writer) throws IOException { writer.write(">" + id + "\n"); - Score.write(scores, outStream); + Score.write(scores, writer); } public Score getScoreByMethod(Enum method) { diff --git a/datamodel/compbio/data/sequence/SequenceUtil.java b/datamodel/compbio/data/sequence/SequenceUtil.java index 4d61d2a..e737575 100644 --- a/datamodel/compbio/data/sequence/SequenceUtil.java +++ b/datamodel/compbio/data/sequence/SequenceUtil.java @@ -610,7 +610,7 @@ public final class SequenceUtil { * Also possible FastaSequence fs = new FastaSequence(sequenceName, * seqbuffer.toString()); */ - HashSet scores = new HashSet(); + Set scores = new TreeSet(); scores.add(new Score(GlobProtResult.Disorder, disorderR)); scores.add(new Score(GlobProtResult.GlobDoms, domsR)); scores.add(new Score(GlobProtResult.Dydx, dydxScore)); diff --git a/testsrc/compbio/data/sequence/ClustalAlignmentUtilTester.java b/testsrc/compbio/data/sequence/ClustalAlignmentUtilTester.java index addba28..812cd6f 100644 --- a/testsrc/compbio/data/sequence/ClustalAlignmentUtilTester.java +++ b/testsrc/compbio/data/sequence/ClustalAlignmentUtilTester.java @@ -25,8 +25,9 @@ import static org.testng.AssertJUnit.fail; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; +import java.io.Writer; import org.testng.annotations.Test; @@ -34,68 +35,68 @@ import compbio.metadata.AllTestSuit; public class ClustalAlignmentUtilTester { - @Test() - public void testReadClustalFile() { - try { - readWriteClustal("TO1381.aln"); - } catch (FileNotFoundException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); + @Test() + public void testReadClustalFile() { + try { + readWriteClustal("TO1381.aln"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } - static void readWriteClustal(String fname) throws IOException, - UnknownFileFormatException { - FileInputStream fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH - + fname); - Alignment seqAl = ClustalAlignmentUtil.readClustalFile(fio); - assertTrue(seqAl != null); - assertTrue(seqAl.getSize() == 3); - assertNotNull(seqAl.getSequences()); - assertEquals(3, seqAl.getSequences().size()); + static void readWriteClustal(String fname) throws IOException, + UnknownFileFormatException { + FileInputStream fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH + + fname); + Alignment seqAl = ClustalAlignmentUtil.readClustalFile(fio); + assertTrue(seqAl != null); + assertTrue(seqAl.getSize() == 3); + assertNotNull(seqAl.getSequences()); + assertEquals(3, seqAl.getSequences().size()); - // Now try to write the alignment read - FileOutputStream os = new FileOutputStream(AllTestSuit.TEST_DATA_PATH - + fname + ".written"); - ClustalAlignmentUtil.writeClustalAlignment(os, seqAl); - fio.close(); - os.close(); + // Now try to write the alignment read + Writer os = new FileWriter(AllTestSuit.TEST_DATA_PATH + fname + + ".written"); + ClustalAlignmentUtil.writeClustalAlignment(os, seqAl); + fio.close(); + os.close(); - fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH + fname - + ".written"); - Alignment readseqs = ClustalAlignmentUtil.readClustalFile(fio); - assertTrue(readseqs != null); - assertTrue(readseqs.getSize() == 3); - fio.close(); - } + fio = new FileInputStream(AllTestSuit.TEST_DATA_PATH + fname + + ".written"); + Alignment readseqs = ClustalAlignmentUtil.readClustalFile(fio); + assertTrue(readseqs != null); + assertTrue(readseqs.getSize() == 3); + fio.close(); + } - @Test() - public void testReadClustalFileShortNames() { - try { - readWriteClustal("TO1381s.aln"); - } catch (FileNotFoundException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); + @Test() + public void testReadClustalFileShortNames() { + try { + readWriteClustal("TO1381s.aln"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } - @Test() - public void testReadClustalFileLongNames() { - try { - readWriteClustal("TO1381L.aln"); - } catch (FileNotFoundException e) { - e.printStackTrace(); - fail(e.getMessage()); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); + @Test() + public void testReadClustalFileLongNames() { + try { + readWriteClustal("TO1381L.aln"); + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + fail(e.getMessage()); + } } - } } diff --git a/testsrc/compbio/data/sequence/SequenceUtilTester.java b/testsrc/compbio/data/sequence/SequenceUtilTester.java index 3e351bf..7db01ee 100644 --- a/testsrc/compbio/data/sequence/SequenceUtilTester.java +++ b/testsrc/compbio/data/sequence/SequenceUtilTester.java @@ -24,6 +24,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.PrintWriter; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -193,7 +194,8 @@ public class SequenceUtilTester { Map> aseqs = SequenceUtil.readDisembl(fio); assertNotNull(aseqs); assertEquals(aseqs.size(), 3); - // System.out.println(aseqs); + ScoreManager sman = ScoreManager.newInstance(aseqs); + for (String fs : aseqs.keySet()) { assertTrue(" Foobar_dundeefriends Foobar dundeefriends " .contains(fs)); @@ -255,6 +257,10 @@ public class SequenceUtilTester { } assertEquals(scores.size(), 5); } + + ScoreManager sm = ScoreManager.newInstanceSingleSequence(scores); + sm.writeOut(new PrintWriter(System.out, true)); + for (Score score : scores) { if (score.getMethod() diff --git a/testsrc/compbio/ws/client/AAConWSClientExample.java b/testsrc/compbio/ws/client/AAConWSClientExample.java index 307d144..23eaf36 100644 --- a/testsrc/compbio/ws/client/AAConWSClientExample.java +++ b/testsrc/compbio/ws/client/AAConWSClientExample.java @@ -3,6 +3,8 @@ package compbio.ws.client; import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; import java.util.List; import compbio.data.msa.SequenceAnnotation; @@ -108,7 +110,9 @@ public class AAConWSClientExample { // } /* Output the alignment to standard out */ - IOHelper.writeOut(System.out, result); + Writer writer = new PrintWriter(System.out, true); + IOHelper.writeOut(writer, result); + writer.close(); // Score.write(result, System.out); /* Alternatively, you can record retrieved alignment into the file */ diff --git a/webservices/compbio/ws/client/AAConClient.java b/webservices/compbio/ws/client/AAConClient.java index 4619c60..3fe638e 100644 --- a/webservices/compbio/ws/client/AAConClient.java +++ b/webservices/compbio/ws/client/AAConClient.java @@ -30,7 +30,8 @@ import static compbio.ws.client.Constraints.pseparator; import java.io.Closeable; import java.io.File; import java.io.IOException; -import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import java.util.List; @@ -116,13 +117,13 @@ public class AAConClient { if (inputFile != null) { System.out.println("Calculating conservation..."); result = analize(inputFile, msaws, preset, customOptions); - OutputStream outStream = null; + Writer outStream = null; if (outFile != null) { - outStream = IOHelper.getOutStream(outFile); + outStream = IOHelper.getWriter(outFile); } else { // this stream is going to be closed later which is fine as // std.out will not be - outStream = System.out; + outStream = new PrintWriter(System.out, true); } writeOut(outStream, result); // stream is closed in the method no need to close it here @@ -152,17 +153,17 @@ public class AAConClient { * @param result * the AACon scores to output */ - static void writeOut(OutputStream outStream, ScoreManager result) { + static void writeOut(Writer writer, ScoreManager result) { try { - result.writeOut(outStream); + result.writeOut(writer); } catch (IOException e) { System.err .println("Problems writing output file! Stack trace is below: "); e.printStackTrace(); } finally { - if (outStream != null) { + if (writer != null) { try { - outStream.close(); + writer.close(); } catch (IOException ignored) { // e.printStackTrace(); } diff --git a/webservices/compbio/ws/client/IOHelper.java b/webservices/compbio/ws/client/IOHelper.java index 8fbf763..88b695a 100644 --- a/webservices/compbio/ws/client/IOHelper.java +++ b/webservices/compbio/ws/client/IOHelper.java @@ -4,11 +4,10 @@ import static compbio.ws.client.Constraints.pseparator; import java.io.BufferedReader; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.FileReader; +import java.io.FileWriter; import java.io.IOException; -import java.io.OutputStream; +import java.io.Writer; import java.util.ArrayList; import java.util.List; @@ -74,14 +73,9 @@ public class IOHelper { return params; } - static OutputStream getOutStream(File file) { + static Writer getWriter(File file) throws IOException { assert file != null && file.exists(); - try { - return new FileOutputStream(file); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - return null; + return new FileWriter(file); } /** @@ -92,17 +86,17 @@ public class IOHelper { * @param align * the alignment to output */ - static void writeOut(OutputStream outStream, Alignment align) { + static void writeOut(Writer writer, Alignment align) { try { - ClustalAlignmentUtil.writeClustalAlignment(outStream, align); + ClustalAlignmentUtil.writeClustalAlignment(writer, align); } catch (IOException e) { System.err .println("Problems writing output file! Stack trace is below: "); e.printStackTrace(); } finally { - if (outStream != null) { + if (writer != null) { try { - outStream.close(); + writer.close(); } catch (IOException ignored) { // e.printStackTrace(); } @@ -117,17 +111,17 @@ public class IOHelper { * @param result * the AACon scores to output */ - static void writeOut(OutputStream outStream, ScoreManager results) { + static void writeOut(Writer writer, ScoreManager results) { try { - results.writeOut(outStream); + results.writeOut(writer); } catch (IOException e) { System.err .println("Problems writing output file! Stack trace is below: "); e.printStackTrace(); } finally { - if (outStream != null) { + if (writer != null) { try { - outStream.close(); + writer.close(); } catch (IOException ignored) { // e.printStackTrace(); } diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index ceb9501..f3ca471 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -33,7 +33,8 @@ import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; @@ -151,25 +152,25 @@ public class Jws2Client { } Alignment alignment = null; if (inputFile != null) { - OutputStream outStream = null; + Writer writer = null; if (outFile != null) { - outStream = IOHelper.getOutStream(outFile); + writer = IOHelper.getWriter(outFile); } else { // this stream is going to be closed later which is fine as // std.out will not be - outStream = System.out; + writer = new PrintWriter(System.out, true); } if (service.getServiceType() == SequenceAnnotation.class) { ScoreManager result = analize(inputFile, ((SequenceAnnotation) msaws), preset, customOptions); - IOHelper.writeOut(outStream, result); + IOHelper.writeOut(writer, result); } else { alignment = align(inputFile, (MsaWS) msaws, preset, customOptions); - IOHelper.writeOut(outStream, alignment); + IOHelper.writeOut(writer, alignment); } - outStream.close(); + writer.close(); } boolean listParameters = CmdHelper.listParameters(cmd); diff --git a/webservices/compbio/ws/server/AAConWS.java b/webservices/compbio/ws/server/AAConWS.java index fab12b8..1625ded 100644 --- a/webservices/compbio/ws/server/AAConWS.java +++ b/webservices/compbio/ws/server/AAConWS.java @@ -123,7 +123,7 @@ public class AAConWS implements SequenceAnnotation { return aaconOptions; } - String analize(List sequences, + private String analize(List sequences, ConfiguredExecutable confExec, Logger log, String method, Limit limit) throws JobSubmissionException { if (limit != null && limit.isExceeded(sequences)) { @@ -140,7 +140,8 @@ public class AAConWS implements SequenceAnnotation { public String analize(List sequences) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException { - WSUtil.validateFastaInput(sequences); + + WSUtil.validateAAConInput(sequences); ConfiguredExecutable confAAcon = init(sequences); // set default conservation method to fastest - SHENKIN @@ -155,7 +156,7 @@ public class AAConWS implements SequenceAnnotation { List> options) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException, WrongParameterException { - WSUtil.validateFastaInput(sequences); + WSUtil.validateAAConInput(sequences); ConfiguredExecutable confAACon = init(sequences); // Could not do that! Space separated values // will all be treated as keys! thus duplicates removed @@ -172,7 +173,7 @@ public class AAConWS implements SequenceAnnotation { Preset preset) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException, WrongParameterException { - WSUtil.validateFastaInput(sequences); + WSUtil.validateAAConInput(sequences); if (preset == null) { throw new WrongParameterException("Preset must be provided!"); } diff --git a/webservices/compbio/ws/server/WSUtil.java b/webservices/compbio/ws/server/WSUtil.java index 9895289..6f33f24 100644 --- a/webservices/compbio/ws/server/WSUtil.java +++ b/webservices/compbio/ws/server/WSUtil.java @@ -52,11 +52,18 @@ public final class WSUtil { } public static final void validateFastaInput(List sequences) - throws InvalidParameterException { + throws JobSubmissionException { if (sequences == null || sequences.isEmpty()) { - throw new InvalidParameterException( + throw new JobSubmissionException( "List of fasta sequences required but not provided! "); } + for (FastaSequence fs : sequences) { + if (fs.getLength() == 0) { + throw new JobSubmissionException( + "Sequence must not be empty! Sequence: " + fs.getId() + + " was empty"); + } + } } public static JobStatus getJobStatus(String jobId) { @@ -111,6 +118,25 @@ public final class WSUtil { return oList; } + public static void validateAAConInput(List sequences) + throws JobSubmissionException { + validateFastaInput(sequences); + int len = 0; + for (FastaSequence fs : sequences) { + if (len == 0) { + len = fs.getLength(); + continue; + } + if (fs.getLength() != len) { + throw new JobSubmissionException( + "All sequences must be of the same length. Please align " + + "the sequences prior to submission! The first sequence length is : " + + len + " but the sequence '" + fs.getId() + + "' length is " + fs.getLength()); + } + } + } + /* * UNUSED * diff --git a/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl b/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl index f8d2b22..1ee9039 100644 --- a/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl +++ b/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl @@ -15,11 +15,11 @@ - - + + - - + + @@ -33,11 +33,11 @@ - - + + - - + + @@ -93,14 +93,6 @@ - - - - - - - - @@ -109,6 +101,14 @@ + + + + + + + + @@ -159,7 +159,7 @@ - + @@ -180,7 +180,7 @@ - + -- 1.7.10.2