From: Sasha Sherstnev Date: Fri, 6 Sep 2013 16:23:22 +0000 (+0100) Subject: Merge branch 'JABAWS_Release_2_5' into develop X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4b647613e686c4edffd44702d86662c6facb2d5a;p=jabaws.git Merge branch 'JABAWS_Release_2_5' into develop Conflicts: .project WEB-INF/sun-jaxws.xml conf/Executable.properties testsrc/compbio/data/sequence/SequenceUtilTester.java webservices/compbio/data/msa/Category.java webservices/compbio/ws/client/Jws2Client.java webservices/compbio/ws/client/Services.java webservices/compbio/ws/client/WSTester.java webservices/compbio/ws/server/WSUtil.java webservices/compbio/ws/server/resource/AAConWS.wsdl webservices/compbio/ws/server/resource/AAConWS_schema1.xsd webservices/compbio/ws/server/resource/ClustalWS.wsdl webservices/compbio/ws/server/resource/ClustalWS_schema1.xsd webservices/compbio/ws/server/resource/DisemblWS.wsdl webservices/compbio/ws/server/resource/DisemblWS_schema1.xsd webservices/compbio/ws/server/resource/GlobPlotWS.wsdl webservices/compbio/ws/server/resource/GlobPlotWS_schema1.xsd webservices/compbio/ws/server/resource/IUPredWS.wsdl webservices/compbio/ws/server/resource/IUPredWS_schema1.xsd webservices/compbio/ws/server/resource/JronnWS.wsdl webservices/compbio/ws/server/resource/JronnWS_schema1.xsd webservices/compbio/ws/server/resource/MafftWS.wsdl webservices/compbio/ws/server/resource/MafftWS_schema1.xsd webservices/compbio/ws/server/resource/MuscleWS.wsdl webservices/compbio/ws/server/resource/MuscleWS_schema1.xsd webservices/compbio/ws/server/resource/RegistryWS.wsdl webservices/compbio/ws/server/resource/RegistryWS_schema1.xsd webservices/compbio/ws/server/resource/TcoffeeWS.wsdl webservices/compbio/ws/server/resource/TcoffeeWS_schema1.xsd wsbuild.xml --- 4b647613e686c4edffd44702d86662c6facb2d5a diff --cc WEB-INF/sun-jaxws.xml index 1aade67,e39eaed..e8b759b --- a/WEB-INF/sun-jaxws.xml +++ b/WEB-INF/sun-jaxws.xml @@@ -1,55 -1,42 +1,45 @@@ - - - - - - - - - - - - - + + + + + + + + + + + + + ++ diff --cc WEB-INF/web.xml index 7fd7ea2,bf30cbf..6a3cea7 --- a/WEB-INF/web.xml +++ b/WEB-INF/web.xml @@@ -160,24 -161,13 +160,30 @@@ com.sun.xml.ws.transport.http.servlet.WSServlet 1 + + + RNAalifoldWS + com.sun.xml.ws.transport.http.servlet.WSServlet + 1 + + + Apache-Axis Servlet + AxisServlet + org.apache.axis.transport.http.AxisServlet + + + Axis Admin Servlet + AdminServlet + org.apache.axis.transport.http.AdminServlet + 100 + + + JpredWS + com.sun.xml.ws.transport.http.servlet.WSServlet + 1 + + listings @@@ -278,28 -268,11 +284,32 @@@ IUPredWS /IUPredWS + + + RNAalifoldWS + /RNAalifoldWS + + + AxisServlet + /servlet/AxisServlet + + + AxisServlet + *.jws + + + AxisServlet + /services/* + + + AdminServlet + /servlet/AdminServlet + + + JpredWS + /JpredWS + diff --cc datamodel/compbio/data/sequence/SequenceUtil.java index 3a84873,d1140cf..376193f --- a/datamodel/compbio/data/sequence/SequenceUtil.java +++ b/datamodel/compbio/data/sequence/SequenceUtil.java @@@ -30,8 -32,8 +32,9 @@@ import java.io.InputStreamReader import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; + import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Map; diff --cc testsrc/compbio/data/sequence/SequenceUtilTester.java index 25c81a1,7f98180..9468cda --- a/testsrc/compbio/data/sequence/SequenceUtilTester.java +++ b/testsrc/compbio/data/sequence/SequenceUtilTester.java @@@ -140,42 -133,9 +133,38 @@@ public class SequenceUtilTester } } - // This method tests the loading of horizontally formatted Jronn output file + // Potential Bug :- Sequence names are shortened to 2-3 letters + @Test + public void testReadFastaWriteClustal() { + + try { + FileInputStream fio = new FileInputStream( + AllTestSuit.TEST_DATA_PATH + "TO1381.fasta"); + assertNotNull(fio); + List fseqs = SequenceUtil.readFasta(fio); + assertNotNull(fseqs); + fio.close(); + + char gapChar = '-'; + FileOutputStream fou = new FileOutputStream( + AllTestSuit.TEST_DATA_PATH + "TO1381.aln.written"); + SequenceUtil.writeClustal(fou, fseqs, gapChar); + fou.close(); + + } catch (FileNotFoundException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getLocalizedMessage()); + } - } - - ++ } + - - + /** + * This test tests the loading of horizontally formatted Jronn output file + */ @Test - public void loadJronnFile() { + public void LoadJronnFile() { FileInputStream fio; try { @@@ -439,5 -380,17 +409,18 @@@ fail(e.getMessage()); } } + @Test + public void ReadJpredResults() { + try { + InputStream inStream = new FileInputStream(AllTestSuit.TEST_DATA_PATH + "Jpred.test1.out"); + List result = SequenceUtil.readJpredFile(inStream); + inStream.close(); + assertNotNull(result); + assertEquals(result.size(), 19); + } catch (IOException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } } + diff --cc testsrc/compbio/metadata/AllTestSuit.java index bbb7fbd,f60075b..8e9d9aa --- a/testsrc/compbio/metadata/AllTestSuit.java +++ b/testsrc/compbio/metadata/AllTestSuit.java @@@ -64,15 -43,9 +43,11 @@@ public class AllTestSuit public static final String RUNNER_TEST_LOGGER = "RunnerLogger"; public static final String test_input = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "TO1381.fasta"; - public static final String test_alignment_input = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "TO1381.fasta.aln"; - public static final String test_input_real = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "50x500Protein.fasta"; - public static final String test_input_dna = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "3dnaseqs.fasta"; - public static final String test_input_large = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "1000x3000Dna.fasta"; + + public static final String test_input_aln = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "unfolded_RF00031.aln"; } diff --cc webservices/compbio/data/msa/Category.java index 3de1b31,59bcf30..fa9968b --- a/webservices/compbio/data/msa/Category.java +++ b/webservices/compbio/data/msa/Category.java @@@ -34,8 -35,8 +35,8 @@@ public class Category public static final String CATEGORY_ALIGNMENT = "Alignment"; public static final String CATEGORY_DISORDER = "Protein Disorder"; public static final String CATEGORY_CONSERVATION = "Conservation"; - public static final String CATEGORY_RNASTRUCT = "RNA Structure Prediction"; + public static final String CATEGORY_PREDICTION = "Prediction"; - + public String name; Set services; @@@ -71,20 -72,16 +72,17 @@@ disorder_services.add(Services.GlobPlotWS); disorder_services.add(Services.IUPredWS); disorder_services.add(Services.JronnWS); - Category disorder = new Category(CATEGORY_DISORDER, disorder_services); + Set conservation_services = new HashSet(); conservation_services.add(Services.AAConWS); + Category conservation = new Category(CATEGORY_CONSERVATION, conservation_services); - Category conservation = new Category(CATEGORY_CONSERVATION, - conservation_services); + Set prediction_services = new HashSet(); + prediction_services.add(Services.JpredWS); ++ prediction_services.add(Services.RNAalifoldWS); + Category prediction = new Category(CATEGORY_PREDICTION, prediction_services); - Set rnastruct_services = new HashSet(); - rnastruct_services.add(Services.RNAalifoldWS); - - Category rnastruct = new Category(CATEGORY_RNASTRUCT, - rnastruct_services); - Set categories = new HashSet(); categories.add(alignment); categories.add(disorder); diff --cc webservices/compbio/ws/client/Jws2Client.java index 5a72802,94854d4..96343db --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@@ -509,18 -459,8 +460,8 @@@ public class Jws2Client } return alignment; } - + /** - * Prints Jws2Client usage information to standard out - * - * @param exitStatus - */ - static void printUsage(int exitStatus) { - System.out.println(Constraints.help_text); - System.exit(exitStatus); - } - - /** * Starts command line client, if no parameter are supported print help. Two * parameters are required for successful call the JWS2 host name and a * service name. diff --cc webservices/compbio/ws/client/Services.java index 2d2cdc8,2720eb7..a4e101d --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@@ -39,8 -39,7 +39,7 @@@ public enum Services * Make sure this class has NO references to runners or engines as it is a * part of minimal client package. Such things should go into ServicesUtil */ - MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, - JronnWS, DisemblWS, GlobPlotWS, IUPredWS, RNAalifoldWS; - MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS, JpredWS; ++ MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS, JpredWS, RNAalifoldWS; public static Services getService(String servName) { servName = servName.trim().toLowerCase(); @@@ -78,10 -76,8 +76,9 @@@ case DisemblWS : case GlobPlotWS : case IUPredWS : + case RNAalifoldWS : return SequenceAnnotation.class; - - // deliberate leaking + case JpredWS : case ClustalWS : case ClustalOWS : case MafftWS : @@@ -89,13 -85,33 +86,35 @@@ case ProbconsWS : case TcoffeeWS : return MsaWS.class; - ++ default : - throw new RuntimeException("Unrecognised Web Service Type " - + this + " - Should never happened!"); + throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!"); } } + + String getServiceNamespace() { + switch (this) { - case JpredWS : ++ case RNAalifoldWS : + case AAConWS : + case JronnWS : + case DisemblWS : + case GlobPlotWS : + case IUPredWS : - case ClustalOWS : + return JABAService.V2_SERVICE_NAMESPACE; ++ case ClustalOWS : ++ case JpredWS : + case ClustalWS : + case MafftWS : + case MuscleWS : + case ProbconsWS : + case TcoffeeWS : + return JABAService.SERVICE_NAMESPACE; + default : + throw new RuntimeException("Unrecognised JABAWS Namespace for service " + this +"!"); + } + } + JABAService getInterface(Service service) { assert service != null; @@@ -128,11 -145,8 +148,10 @@@ return PROBCONS_INFO; case TcoffeeWS : return TCOFFEE_INFO; + case RNAalifoldWS : + return RNAALIFOLD_INFO; default : - throw new RuntimeException("Unrecognised Web Service Type " - + this + " - Should never happened!"); + throw new RuntimeException("Unrecognised Web Service Type " + this + " - Should never happen!"); } } @@@ -191,17 -216,8 +221,16 @@@ MafftWS, "Katoh, Toh 2010 (Bioinformatics 26:1899-1900)\r\n" + "Parallelization of the MAFFT multiple sequence alignment program. ", - "6.8.57", "http://mafft.cbrc.jp/alignment/software/").toString();; + "6.8.57", "http://mafft.cbrc.jp/alignment/software/").toString(); - // TODO reference + public static final String RNAALIFOLD_INFO = new ServiceInfo( + RNAalifoldWS, + "Ivo L. Hofacker, Martin Fekete, and Peter F. Stadler 'Secondary Structure Prediction" + + " for Aligned RNA Sequences'. J.Mol.Biol. 319: 1059-1066, 2002. Stephan H. Bernhart," + + " Ivo L. Hofacker, Sebastian Will, Andreas R. Gruber, and Peter F. Stadler. " + + "'RNAalifold: Improved consensus structure prediction for RNA alignments'. BMC Bioinformatics, 9:474, 2008.\r\n", - "2.1.2", "http://www.tbi.univie.ac.at/RNA/").toString();; - ++ "2.1.2", "http://www.tbi.univie.ac.at/RNA/").toString(); ++ @XmlAccessorType(XmlAccessType.FIELD) static class ServiceInfo { Services service; @@@ -236,4 -251,4 +264,4 @@@ public static void main(String[] args) { System.out.println(MUSCLE_INFO); } --} ++} diff --cc webservices/compbio/ws/client/ServicesUtil.java index 9873875,26f1467..7084028 --- a/webservices/compbio/ws/client/ServicesUtil.java +++ b/webservices/compbio/ws/client/ServicesUtil.java @@@ -54,12 -56,8 +57,10 @@@ public class ServicesUtil return Jronn.class; case IUPredWS : return IUPred.class; + case RNAalifoldWS : + return RNAalifold.class; default : - throw new RuntimeException( - "Unknown web service implementation class for service: " - + service); + throw new RuntimeException("Unknown web service implementation class for service: " + service); } } diff --cc webservices/compbio/ws/client/WSTester.java index 483c162,bae843b..226af80 --- a/webservices/compbio/ws/client/WSTester.java +++ b/webservices/compbio/ws/client/WSTester.java @@@ -61,27 -62,22 +62,25 @@@ import compbio.util.Util public class WSTester { /** - * Sequences to be used as input for all WS + * Test sequences to be used as input for WS */ - public static final String fastaInput = ">Foo\n" - + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV" - + "\n>Bar\n" - + "ASDAAPEHPGIALWLHALEDAGQAEAAAAYTRAHQLLPEEPYITAQLLNAVA\n"; - - public static final String fastaAlignment = ">Foo\n" - + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV--------\n" - + ">Bar\n" - + "ASDAAPEH------------PGIALWLHALE-DAGQAEAAA---AYTRAHQLLPEEPYITAQLLNAVA\n" - + ""; - - public static final String fastaRNAAlignment = ">Foo\n" - + "C-UUGCGUUAAUGAGAACAGAAACG-UAAA--CUAUAA-CCUAG-G-GGUUUCUGUUGGAUGGUUG----GCAAC\n" - + ">Bar\n" - + "G-UGGCGCUUAUGACGCAGUUGUCU-UAAA-CUCGAAC--UCGA-GCGGGCAAUUGCUGAU-UACGAUUAACCAC\n"; + public static final String fastaInput2records = + ">Foo\nMTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV\n" + + ">Bar\nASDAAPEHPGIALWLHALEDAGQAEAAAAYTRAHQLLPEEPYITAQLLNAVA\n"; + public static final String fastaInput1record = + ">Foo\nMTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV\n"; + public static final String fastaAlignment = + ">Foo\nMTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV--------\n" + + ">Bar\nASDAAPEH------------PGIALWLHALE-DAGQAEAAA---AYTRAHQLLPEEPYITAQLLNAVA\n"; ++ public static final String fastaRNAAlignment = ++ ">Foo\nC-UUGCGUUAAUGAGAACAGAAACG-UAAA--CUAUAA-CCUAG-G-GGUUUCUGUUGGAUGGUUG----GCAAC\n" ++ + ">Bar\nG-UGGCGCUUAUGACGCAGUUGUCU-UAAA-CUCGAAC--UCGA-GCGGGCAAUUGCUGAU-UACGAUUAACCAC\n"; + /** + * Status strings + */ private static final String FAILED = "FAILED"; private static final String OK = "OK"; - private static final String UNSUPPORTED = "UNSUPPORTED"; /** @@@ -262,11 -241,9 +258,11 @@@ SequenceAnnotation wservice, Services service) throws Exception { writer.print("Calling analyse........."); - List input = loadSeqs(); + List input = loadSeqs(2); - if (service == Services.AAConWS) { + if (service == Services.AAConWS ) { input = loadAlignment(); + } else if (service == Services.RNAalifoldWS) { + input = loadRNAAlignment(); } boolean success = testDefaultAnalyse(input, wservice, null, null); diff --cc webservices/compbio/ws/server/WSUtil.java index da4182c,e6dd02d..07d005d --- a/webservices/compbio/ws/server/WSUtil.java +++ b/webservices/compbio/ws/server/WSUtil.java @@@ -190,11 -189,8 +208,9 @@@ public final class WSUtil throws ResultNotAvailableException { WSUtil.validateJobId(jobId); AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId); - ConfiguredExecutable aacon = (ConfiguredExecutable) asyncEngine - .getResults(jobId); - + ConfiguredExecutable aacon = (ConfiguredExecutable) asyncEngine.getResults(jobId); ScoreManager mas = aacon.getResults(); + log.trace(jobId + " getConservation : " + mas); return mas; } diff --cc wsbuild.xml index c614ba6,485ad24..9408d8e --- a/wsbuild.xml +++ b/wsbuild.xml @@@ -28,7 -29,7 +29,8 @@@ + + @@@ -160,21 -172,7 +173,20 @@@ - + + + + + + @@@ -231,15 -229,6 +243,14 @@@ package="compbio.ws.client.stub" target="2.1" quiet="false"> - + + +