From a66674ad9520261789bbfe8401f88b37ae2a71a2 Mon Sep 17 00:00:00 2001 From: pvtroshin Date: Mon, 29 Nov 2010 22:05:57 +0000 Subject: [PATCH] AAConWS further work git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@3406 e3abac25-378b-4346-85de-24260fe3988d --- .classpath | 2 +- TODO.txt | 10 +++ WEB-INF/sun-jaxws.xml | 4 + WEB-INF/web.xml | 20 +++-- binaries/aaconservation.jar | Bin 136881 -> 135965 bytes .../data/sequence/MultiAnnotatedSequence.java | 5 +- runner/compbio/runner/conservation/AACon.java | 8 +- .../compbio/data/sequence/SequenceUtilTester.java | 2 +- .../compbio/runner/conservation/AAConTester.java | 1 + webservices/compbio/data/msa/Annotation.java | 5 +- webservices/compbio/data/msa/MsaWS.java | 2 +- webservices/compbio/ws/server/AAConWS.java | 82 ++++++++++++++------ wsbuild.xml | 17 +++- 13 files changed, 114 insertions(+), 44 deletions(-) diff --git a/.classpath b/.classpath index cff7667..7833d32 100644 --- a/.classpath +++ b/.classpath @@ -7,11 +7,11 @@ - + diff --git a/TODO.txt b/TODO.txt index 6e70077..b6d15ed 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,9 +1,19 @@ TODO: +Publish jabaws-discuss contact information + +Output file parsing for stat reporting +cluster engine stat of www-jws2 user + +integrate the above to tweak the size of the local job + +Add AACon ws Add iupred ws http://iupred.enzim.hu/ Add globprot ws Add ronn ws +Philogeny Mrbayes + Philip + USE CASE - TURN ALIGNMENT INTO PROFILE AND SEARCH SEQUENCE DATABASE USECASE - Receive user alignment - use hmmerbuild to turn it to profile diff --git a/WEB-INF/sun-jaxws.xml b/WEB-INF/sun-jaxws.xml index 13510ed..994abef 100644 --- a/WEB-INF/sun-jaxws.xml +++ b/WEB-INF/sun-jaxws.xml @@ -20,4 +20,8 @@ name='ProbconsWS' implementation='compbio.ws.server.ProbconsWS' url-pattern='/ProbconsWS'/> + diff --git a/WEB-INF/web.xml b/WEB-INF/web.xml index 090a978..ae99a94 100644 --- a/WEB-INF/web.xml +++ b/WEB-INF/web.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> - Jalview Web Services - Jalview Web Services v2.0 + JABAWS + JAva Bioinformatics Analysis Web Services (JABAWS) compbio.ws.server.ShutdownEngines @@ -48,6 +48,12 @@ + + AAConWS + com.sun.xml.ws.transport.http.servlet.WSServlet + + + ClustalWS /ClustalWS @@ -72,7 +78,11 @@ ProbconsWS /ProbconsWS - + + + AAConWS + /AAConWS + @@ -107,13 +117,13 @@ BASIC - JWS2 admins + JABAWS administrators - The role that is required to log in and view JWS2 internals + The role that is required to log in and view JABAWS internals admin diff --git a/binaries/aaconservation.jar b/binaries/aaconservation.jar index 375b8e9c38acd810f9ed42dfdea3c09c5ad0b275..db61ab7f219009b86a656b21d0aa855afd384f40 100644 GIT binary patch delta 3923 zcmZ8kc|4Te`<~~Ru^VHu6A777%1*LI7>ukD)hkrgSYOMOn8=otWO<^+HkQg7Q7Kw1 zsmKyp5~3(s(!vORXP&7(zxOwP%(?FCT=#un&vVY_bIwy$#(lMjTfokm1I>$K{o-81 zQw0bdv994&x;Th~8Kzl7^2itjDI?=GNR>5KcR`MbpjwH;f(?Sud)c5Jqs4`2Fald7 z5umB0E`$JI-9~8yY0&kje6i>C^DOYx@rwKD`Uw7_QiXhp?Iz|BkY`YxTprA*I?V^2R6Px+* zA(suZKJu~a6wiMF+^n7)C8a;BbHASEp!q7@ZQWtN=09t8=A55gC8kO}Oz@FPY%OjL z4@r*5nSK{nmYR_%xOxto()Gx^xOK|g^sBg})P9+Qv*-L%y4uZCTBi;cy!QHbt7}qi zxqoU=e3e4^Dn8UNJ}=He;XjdVq8+c_f|Gh8<8|qrP>Ncx1!Hci;c?VsA#RF=Y#7Z0 zx1((!PVIBv$=O2w+2Z1;QyrUP^zXt!+)}#9y!q4=JneGFM-8jx$@B{q#DN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+&mD&Ra? zU<&G<99VvsjSk3yiRuG~5B8$l-|VsmIFAlkg1jbpn+|A$M=fw3Jz#^a>GwCisO`Yf z0@y+L3q8;QdhcO525=69eT1(b*oR->W`_NC&>~FF2=u|nRoI4c|DK@u4#COaAPyMC Zu&=fA#~)htx8M~> { private EnumMap> annotations; diff --git a/runner/compbio/runner/conservation/AACon.java b/runner/compbio/runner/conservation/AACon.java index f514e24..5a1d752 100644 --- a/runner/compbio/runner/conservation/AACon.java +++ b/runner/compbio/runner/conservation/AACon.java @@ -20,11 +20,12 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +import java.util.HashMap; import java.util.List; -import java.util.Map; import org.apache.log4j.Logger; +import compbio.conservation.Method; import compbio.engine.client.CommandBuilder; import compbio.engine.client.Executable; import compbio.engine.client.SkeletalExecutable; @@ -63,10 +64,9 @@ public class AACon extends SkeletalExecutable { addParameters(Arrays.asList("-jar", getLibPath(), "-d=" + STAT_FILE, "-f=RESULT_NO_ALIGNMENT")); } - - @SuppressWarnings("unchecked") + // HashMap @Override - public Map getResults(String workDirectory) + public HashMap getResults(String workDirectory) throws ResultNotAvailableException { // MultiAnnotatedSequence annotations = null; try { diff --git a/testsrc/compbio/data/sequence/SequenceUtilTester.java b/testsrc/compbio/data/sequence/SequenceUtilTester.java index b726d88..742fa24 100644 --- a/testsrc/compbio/data/sequence/SequenceUtilTester.java +++ b/testsrc/compbio/data/sequence/SequenceUtilTester.java @@ -184,6 +184,6 @@ public class SequenceUtilTester { public void testReadResults() throws FileNotFoundException { InputStream inStream = new FileInputStream(AllTestSuit.TEST_DATA_PATH + "aacon_results.txt"); - System.out.println(SequenceUtil.readResults(inStream)); +// /System.out.println(SequenceUtil.readResults(inStream)); } } diff --git a/testsrc/compbio/runner/conservation/AAConTester.java b/testsrc/compbio/runner/conservation/AAConTester.java index fbb9720..da924f0 100644 --- a/testsrc/compbio/runner/conservation/AAConTester.java +++ b/testsrc/compbio/runner/conservation/AAConTester.java @@ -256,6 +256,7 @@ public class AAConTester { assertNotNull(annotations); assertEquals(annotations.getAnnotations().size(), 3); assertEquals(al1.getResults(), annotations); + } catch (JobSubmissionException e) { e.printStackTrace(); fail(e.getLocalizedMessage()); diff --git a/webservices/compbio/data/msa/Annotation.java b/webservices/compbio/data/msa/Annotation.java index c73c0bc..45c1a68 100644 --- a/webservices/compbio/data/msa/Annotation.java +++ b/webservices/compbio/data/msa/Annotation.java @@ -7,7 +7,6 @@ import javax.jws.WebParam; import javax.jws.WebService; import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.MultiAnnotatedSequence; import compbio.metadata.JobSubmissionException; import compbio.metadata.LimitExceededException; import compbio.metadata.Option; @@ -26,7 +25,7 @@ import compbio.metadata.WrongParameterException; * @param * executable type / web service type */ -@WebService(targetNamespace = "http://a.data.compbio/01/12/2010/") +@WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/") public interface Annotation extends JManagement, Metadata { /** @@ -170,6 +169,6 @@ public interface Annotation extends JManagement, Metadata { * thrown if jobId is empty or cannot be recognised e.g. in * invalid format */ - MultiAnnotatedSequence getResult(@WebParam(name = "jobId") String jobId) + String getResult(@WebParam(name = "jobId") String jobId) throws ResultNotAvailableException; } diff --git a/webservices/compbio/data/msa/MsaWS.java b/webservices/compbio/data/msa/MsaWS.java index d5b64f8..cea5cdf 100644 --- a/webservices/compbio/data/msa/MsaWS.java +++ b/webservices/compbio/data/msa/MsaWS.java @@ -44,7 +44,7 @@ import compbio.metadata.WrongParameterException; * @param * executable type / web service type */ -@WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/") +@WebService(targetNamespace = "http://msa.data.compbio/01/01/2010/") public interface MsaWS extends JManagement, Metadata { /** diff --git a/webservices/compbio/ws/server/AAConWS.java b/webservices/compbio/ws/server/AAConWS.java index cf382df..d65827e 100644 --- a/webservices/compbio/ws/server/AAConWS.java +++ b/webservices/compbio/ws/server/AAConWS.java @@ -1,6 +1,7 @@ package compbio.ws.server; import java.io.File; +import java.util.Arrays; import java.util.List; import javax.annotation.Resource; @@ -9,11 +10,8 @@ import javax.xml.ws.WebServiceContext; import org.apache.log4j.Logger; -import compbio.conservation.Method; import compbio.data.msa.Annotation; import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.JalviewAnnotation; -import compbio.data.sequence.MultiAnnotatedSequence; import compbio.engine.AsyncExecutor; import compbio.engine.Configurator; import compbio.engine.client.ConfiguredExecutable; @@ -33,7 +31,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.conservation.AACon; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "MuscleWS") +@WebService(endpointInterface = "compbio.data.msa.Annotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "AAConWS") public class AAConWS implements Annotation { // Ask for resource injection @@ -53,39 +51,40 @@ public class AAConWS implements Annotation { ConfiguredExecutable init(List sequences) throws JobSubmissionException { AACon aacon = new AACon(); - aacon.setInput("fasta.in").setOutput("fasta.out"); + aacon.setInput("fasta.in").setOutput("aacon.out"); return Configurator.configureExecutable(aacon, sequences); } + // HashMap @SuppressWarnings("unchecked") - public MultiAnnotatedSequence getResult(String jobId) - throws ResultNotAvailableException { + public String getResult(String jobId) throws ResultNotAvailableException { WSUtil.validateJobId(jobId); AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId); ConfiguredExecutable aacon = (ConfiguredExecutable) asyncEngine .getResults(jobId); - MultiAnnotatedSequence mas = aacon.getResults(); + // MultiAnnotatedSequence mas = aacon.getResults(); // log(jobId, "getResults"); - return mas; + return "";// new HashMap(); } - @SuppressWarnings("unchecked") - public JalviewAnnotation getJalviewAnnotation(String jobId) - throws ResultNotAvailableException { - MultiAnnotatedSequence result = getResult(jobId); - - // log(jobId, "getResults"); - return result.toJalviewAnnotation(); - } + /* + * @SuppressWarnings("unchecked") public JalviewAnnotation + * getJalviewAnnotation(String jobId) throws ResultNotAvailableException { + * MultiAnnotatedSequence result = getResult(jobId); // TODO // + * log(jobId, "getResults"); return result.toJalviewAnnotation(); } + */ + @Override public Limit getLimit(String presetName) { return new AACon().getLimit(presetName); } + @Override public LimitsManager getLimits() { return new AACon().getLimits(); } + @Override public ChunkHolder pullExecStatistics(String jobId, long position) { WSUtil.validateJobId(jobId); String file = Configurator.getWorkDirectory(jobId) + File.separator @@ -93,30 +92,53 @@ public class AAConWS implements Annotation { return WSUtil.pullFile(file, position); } + @Override public boolean cancelJob(String jobId) { WSUtil.validateJobId(jobId); return WSUtil.cancelJob(jobId); } + @Override public JobStatus getJobStatus(String jobId) { WSUtil.validateJobId(jobId); return WSUtil.getJobStatus(jobId); } + @Override public PresetManager getPresets() { return aaconPresets; } + @Override public RunnerConfig getRunnerOptions() { return aaconOptions; } + String analize(List sequences, + ConfiguredExecutable confExec, Logger log, String method, + Limit limit) throws JobSubmissionException { + if (limit != null && limit.isExceeded(sequences)) { + throw LimitExceededException.newLimitExceeded(limit, sequences); + } + + compbio.runner.Util.writeInput(sequences, confExec); + AsyncExecutor engine = Configurator.getAsyncEngine(confExec); + String jobId = engine.submitJob(confExec); + return jobId; + } + @Override public String analize(List sequences) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException { - // TODO Auto-generated method stub - return null; + WSUtil.validateFastaInput(sequences); + ConfiguredExecutable confAAcon = init(sequences); + + // set default conservation method to fastest - SHENKIN + // TODO: This violates encapsulation, should be moved to the runners + // level. + confAAcon.addParameters(Arrays.asList("-m=SHENKIN")); + return analize(sequences, confAAcon, null, "analize", getLimit("")); } @Override @@ -124,8 +146,16 @@ public class AAConWS implements Annotation { List> options) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException, WrongParameterException { - // TODO Auto-generated method stub - return null; + WSUtil.validateFastaInput(sequences); + ConfiguredExecutable confAACon = init(sequences); + // Could not do that! Space separated values + // will all be treated as keys! thus duplicates removed + // String params = cbuilder.getCommand(); + List params = WSUtil.getCommands(options, + AACon.KEY_VALUE_SEPARATOR); + confAACon.addParameters(params); + return analize(sequences, confAACon, null, "customAnalize", + getLimit("")); } @Override @@ -133,8 +163,14 @@ public class AAConWS implements Annotation { Preset preset) throws UnsupportedRuntimeException, LimitExceededException, JobSubmissionException, WrongParameterException { - // TODO Auto-generated method stub - return null; + WSUtil.validateFastaInput(sequences); + if (preset == null) { + throw new WrongParameterException("Preset must be provided!"); + } + ConfiguredExecutable confAAcon = init(sequences); + confAAcon.addParameters(preset.getOptions()); + Limit limit = getLimit(preset.getName()); + return WSUtil.align(sequences, confAAcon, null, "presetAnalize", limit); } } diff --git a/wsbuild.xml b/wsbuild.xml index ea64d08..8e7cc8b 100644 --- a/wsbuild.xml +++ b/wsbuild.xml @@ -22,6 +22,7 @@ + @@ -43,6 +44,17 @@ + + + + - + - + + -- 1.7.10.2