xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"\r
version="2.4">\r
\r
- <display-name>Jalview Web Services</display-name>\r
- <description>Jalview Web Services v2.0</description>\r
+ <display-name>JABAWS</display-name>\r
+ <description>JAva Bioinformatics Analysis Web Services (JABAWS)</description>\r
\r
<listener>\r
<listener-class>compbio.ws.server.ShutdownEngines</listener-class>\r
<load-on-startup/>\r
</servlet>\r
\r
+ <servlet>\r
+ <servlet-name>AAConWS</servlet-name>\r
+ <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>\r
+ <load-on-startup/>\r
+ </servlet>\r
+ \r
<servlet-mapping>\r
<servlet-name>ClustalWS</servlet-name>\r
<url-pattern>/ClustalWS</url-pattern>\r
<servlet-name>ProbconsWS</servlet-name>\r
<url-pattern>/ProbconsWS</url-pattern>\r
</servlet-mapping>\r
- \r
+ \r
+ <servlet-mapping>\r
+ <servlet-name>AAConWS</servlet-name>\r
+ <url-pattern>/AAConWS</url-pattern>\r
+ </servlet-mapping>\r
\r
<security-constraint>\r
<web-resource-collection>\r
<!-- Define the Login Configuration for this Application -->\r
<login-config>\r
<auth-method>BASIC</auth-method>\r
- <realm-name>JWS2 admins</realm-name>\r
+ <realm-name>JABAWS administrators</realm-name>\r
</login-config>\r
\r
<!-- Security roles referenced by this web application -->\r
<security-role>\r
<description>\r
- The role that is required to log in and view JWS2 internals\r
+ The role that is required to log in and view JABAWS internals\r
</description>\r
<role-name>admin</role-name>\r
</security-role>\r
package compbio.ws.server;\r
\r
import java.io.File;\r
+import java.util.Arrays;\r
import java.util.List;\r
\r
import javax.annotation.Resource;\r
\r
import org.apache.log4j.Logger;\r
\r
-import compbio.conservation.Method;\r
import compbio.data.msa.Annotation;\r
import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.JalviewAnnotation;\r
-import compbio.data.sequence.MultiAnnotatedSequence;\r
import compbio.engine.AsyncExecutor;\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.runner.Util;\r
import compbio.runner.conservation.AACon;\r
\r
-@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "MuscleWS")\r
+@WebService(endpointInterface = "compbio.data.msa.Annotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "AAConWS")\r
public class AAConWS implements Annotation<AACon> {\r
\r
// Ask for resource injection\r
ConfiguredExecutable<AACon> init(List<FastaSequence> sequences)\r
throws JobSubmissionException {\r
AACon aacon = new AACon();\r
- aacon.setInput("fasta.in").setOutput("fasta.out");\r
+ aacon.setInput("fasta.in").setOutput("aacon.out");\r
return Configurator.configureExecutable(aacon, sequences);\r
}\r
\r
+ // HashMap<Method, float[]>\r
@SuppressWarnings("unchecked")\r
- public MultiAnnotatedSequence<Method> getResult(String jobId)\r
- throws ResultNotAvailableException {\r
+ public String getResult(String jobId) throws ResultNotAvailableException {\r
WSUtil.validateJobId(jobId);\r
AsyncExecutor asyncEngine = Configurator.getAsyncEngine(jobId);\r
ConfiguredExecutable<AACon> aacon = (ConfiguredExecutable<AACon>) asyncEngine\r
.getResults(jobId);\r
- MultiAnnotatedSequence<Method> mas = aacon.getResults();\r
+ // MultiAnnotatedSequence<Method> mas = aacon.getResults();\r
// log(jobId, "getResults");\r
- return mas;\r
+ return "";// new HashMap<Method, float[]>();\r
}\r
\r
- @SuppressWarnings("unchecked")\r
- public JalviewAnnotation getJalviewAnnotation(String jobId)\r
- throws ResultNotAvailableException {\r
- MultiAnnotatedSequence<Method> result = getResult(jobId);\r
-\r
- // log(jobId, "getResults");\r
- return result.toJalviewAnnotation();\r
- }\r
+ /*\r
+ * @SuppressWarnings("unchecked") public JalviewAnnotation\r
+ * getJalviewAnnotation(String jobId) throws ResultNotAvailableException {\r
+ * MultiAnnotatedSequence<Method> result = getResult(jobId); // TODO //\r
+ * log(jobId, "getResults"); return result.toJalviewAnnotation(); }\r
+ */\r
\r
+ @Override\r
public Limit<AACon> getLimit(String presetName) {\r
return new AACon().getLimit(presetName);\r
}\r
\r
+ @Override\r
public LimitsManager<AACon> getLimits() {\r
return new AACon().getLimits();\r
}\r
\r
+ @Override\r
public ChunkHolder pullExecStatistics(String jobId, long position) {\r
WSUtil.validateJobId(jobId);\r
String file = Configurator.getWorkDirectory(jobId) + File.separator\r
return WSUtil.pullFile(file, position);\r
}\r
\r
+ @Override\r
public boolean cancelJob(String jobId) {\r
WSUtil.validateJobId(jobId);\r
return WSUtil.cancelJob(jobId);\r
}\r
\r
+ @Override\r
public JobStatus getJobStatus(String jobId) {\r
WSUtil.validateJobId(jobId);\r
return WSUtil.getJobStatus(jobId);\r
}\r
\r
+ @Override\r
public PresetManager<AACon> getPresets() {\r
return aaconPresets;\r
}\r
\r
+ @Override\r
public RunnerConfig<AACon> getRunnerOptions() {\r
return aaconOptions;\r
}\r
\r
+ String analize(List<FastaSequence> sequences,\r
+ ConfiguredExecutable<AACon> confExec, Logger log, String method,\r
+ Limit<AACon> limit) throws JobSubmissionException {\r
+ if (limit != null && limit.isExceeded(sequences)) {\r
+ throw LimitExceededException.newLimitExceeded(limit, sequences);\r
+ }\r
+\r
+ compbio.runner.Util.writeInput(sequences, confExec);\r
+ AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
+ String jobId = engine.submitJob(confExec);\r
+ return jobId;\r
+ }\r
+\r
@Override\r
public String analize(List<FastaSequence> sequences)\r
throws UnsupportedRuntimeException, LimitExceededException,\r
JobSubmissionException {\r
- // TODO Auto-generated method stub\r
- return null;\r
+ WSUtil.validateFastaInput(sequences);\r
+ ConfiguredExecutable<AACon> confAAcon = init(sequences);\r
+\r
+ // set default conservation method to fastest - SHENKIN\r
+ // TODO: This violates encapsulation, should be moved to the runners\r
+ // level.\r
+ confAAcon.addParameters(Arrays.asList("-m=SHENKIN"));\r
+ return analize(sequences, confAAcon, null, "analize", getLimit(""));\r
}\r
\r
@Override\r
List<Option<AACon>> options) throws UnsupportedRuntimeException,\r
LimitExceededException, JobSubmissionException,\r
WrongParameterException {\r
- // TODO Auto-generated method stub\r
- return null;\r
+ WSUtil.validateFastaInput(sequences);\r
+ ConfiguredExecutable<AACon> confAACon = init(sequences);\r
+ // Could not do that! Space separated values\r
+ // will all be treated as keys! thus duplicates removed\r
+ // String params = cbuilder.getCommand();\r
+ List<String> params = WSUtil.getCommands(options,\r
+ AACon.KEY_VALUE_SEPARATOR);\r
+ confAACon.addParameters(params);\r
+ return analize(sequences, confAACon, null, "customAnalize",\r
+ getLimit(""));\r
}\r
\r
@Override\r
Preset<AACon> preset) throws UnsupportedRuntimeException,\r
LimitExceededException, JobSubmissionException,\r
WrongParameterException {\r
- // TODO Auto-generated method stub\r
- return null;\r
+ WSUtil.validateFastaInput(sequences);\r
+ if (preset == null) {\r
+ throw new WrongParameterException("Preset must be provided!");\r
+ }\r
+ ConfiguredExecutable<AACon> confAAcon = init(sequences);\r
+ confAAcon.addParameters(preset.getOptions());\r
+ Limit<AACon> limit = getLimit(preset.getName());\r
+ return WSUtil.align(sequences, confAAcon, null, "presetAnalize", limit);\r
}\r
\r
}\r
<property name="muscle.wsdl" location="${wsdl.dir}/MuscleWS.wsdl" />\r
<property name="tcoffee.wsdl" location="${wsdl.dir}/TcoffeeWS.wsdl" />\r
<property name="mafft.wsdl" location="${wsdl.dir}/MafftWS.wsdl" />\r
+ <property name="aacon.wsdl" location="${wsdl.dir}/AAConWS.wsdl" />\r
\r
<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen">\r
<classpath refid="project.classpath" />\r
<!-- destdir - Where to put generated classes -->\r
<!-- sourcedestdir - Where to put generated source files -->\r
<!-- resourcedestdir - Where to put generated source files -->\r
+ <wsgen sei="compbio.ws.server.AAConWS" \r
+ sourcedestdir="${basedir}/webservices" \r
+ destdir="${classes}" \r
+ resourcedestdir="${wsdl.dir}" \r
+ keep="true" genwsdl="true" \r
+ extension="false" \r
+ xendorsed="true" \r
+ verbose="true">\r
+ <classpath refid="classes.path" />\r
+ <classpath refid="project.classpath" />\r
+ </wsgen>\r
<wsgen sei="compbio.ws.server.ClustalWS" \r
sourcedestdir="${basedir}/webservices" \r
destdir="${classes}" \r
verbose="true">\r
<classpath refid="classes.path" />\r
<classpath refid="project.classpath" />\r
- </wsgen>\r
+ </wsgen>\r
<wsgen sei="compbio.ws.server.TcoffeeWS" \r
sourcedestdir="${basedir}/webservices" \r
destdir="${classes}" \r
verbose="true">\r
<classpath refid="classes.path" />\r
<classpath refid="project.classpath" />\r
- </wsgen>\r
+ </wsgen>\r
+ \r
</target>\r
\r
\r