From 79e1d66ef2100149b1117c798dd7b4edd9333912 Mon Sep 17 00:00:00 2001 From: pvtroshin Date: Wed, 8 Jun 2011 17:36:31 +0000 Subject: [PATCH] JWS2 client git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4237 e3abac25-378b-4346-85de-24260fe3988d --- webservices/compbio/ws/client/Constraints.java | 70 ++++++++++++++++++++++++ webservices/compbio/ws/client/Jws2Client.java | 48 +--------------- webservices/compbio/ws/client/client_help.txt | 65 ++++++++++++++++++++++ 3 files changed, 136 insertions(+), 47 deletions(-) create mode 100644 webservices/compbio/ws/client/client_help.txt diff --git a/webservices/compbio/ws/client/Constraints.java b/webservices/compbio/ws/client/Constraints.java index 08b06ac..6cb6992 100644 --- a/webservices/compbio/ws/client/Constraints.java +++ b/webservices/compbio/ws/client/Constraints.java @@ -8,6 +8,9 @@ class Constraints { final static String hostkey = "-h"; final static String servicekey = "-s"; + final static String listServices = "-list_services"; + final static String testKey = "-test"; + // Actions final static String inputkey = "-i"; @@ -21,4 +24,71 @@ class Constraints { final static String parameterkey = "-p"; final static String presetkey = "-r"; + final static String help_text = "\r\n" + + "JABAWS client v2.0 June 2011 http://www.compbio.dundee.ac.uk/jabaws \r\n" + + " \r\n" + + "Usage: -h=host_and_context <-s=serviceName> ACTION [OPTIONS] \r\n" + + "\r\n" + + "-h= - a full URL to the JABAWS web server including context \r\n" + + " path e.g. http://10.31.1.159:8080/ws\r\n" + + "-s= - one of [MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, \r\n" + + " AAConWS, JronnWS, DisemblWS, GlobPlotWS]\r\n" + + " is required for all ACTIONS but -list_services\r\n" + + "\r\n" + + "ACTIONS: \r\n" + + "-list_services - list available services\r\n" + + "-test - test service \r\n" + + "-i= - full path to fasta formatted sequence file, from which to align \r\n" + + " sequences\r\n" + + "-parameters - lists parameters supported by web service\r\n" + + "-presets - lists presets supported by web service\r\n" + + "-limits - lists web services limits\r\n" + + "\r\n" + + "Please note that if input file is specified other actions are ignored\r\n" + + "\r\n" + + "OPTIONS (only for use with -i action):\r\n" + + "-r= - name of the preset to use\r\n" + + "-o= - full path to the file where to write an alignment\r\n" + + "-f= - the name of the file with the list of parameters to use.\r\n" + + "\r\n" + + "Please note that -r and -f options cannot be used together. Alignment is done with \r\n" + + "either preset or a parameters from the file, but not both!\r\n" + + "\r\n" + + "EXAMPLES: \r\n" + + "\r\n" + + "1) List all available services on the host \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -list_services\r\n" + + "\r\n" + + "2) Test Clustal web service \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=ClustalWS -test \r\n" + + "\r\n" + + "3) Align sequence from file input.txt with Probcons. Record resulting alignment \r\n" + + "into the output.txt \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=ProbconsWS -i=input.txt -o=output.txt\r\n" + + "\r\n" + + "4) Calculate disorder with Disembl take input from input.txt, output results to \r\n" + + "the console \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=DisemblWS -i=input.txt \r\n" + + "\r\n" + + "5) List all parameters available for AAconWS service \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=AAconWS -parameters\r\n" + + "\r\n" + + "6) Calculate conservation with AAConWS using LANDGRAF method, for Clustal alignment \r\n" + + "from input.txt and report the scores to the console \r\n" + + "\r\n" + + "Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=AAconWS -i=input.txt -f=prm.txt \r\n" + + "\r\n" + + "Where the content of prm.txt file is -m=LANDGRAF\r\n" + + "The list of the supported parameters can be obtained as shown in the example 5. \r\n" + + "\r\n" + + "Citation: Peter V. Troshin, James B. Procter and Geoffrey J. Barton - \"Java \r\n" + + "Bioinformatics Analysis Web Services for Multiple Sequence Alignment - \r\n" + + "JABAWS:MSA\" Bioinformatics 2011; doi: 10.1093/bioinformatics/btr304.\r\n" + + ""; + } diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index f3ca471..a0c95d1 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -18,16 +18,9 @@ package compbio.ws.client; -import static compbio.ws.client.Constraints.hostkey; import static compbio.ws.client.Constraints.inputkey; -import static compbio.ws.client.Constraints.limitList; import static compbio.ws.client.Constraints.outputkey; import static compbio.ws.client.Constraints.paramFile; -import static compbio.ws.client.Constraints.paramList; -import static compbio.ws.client.Constraints.presetList; -import static compbio.ws.client.Constraints.presetkey; -import static compbio.ws.client.Constraints.pseparator; -import static compbio.ws.client.Constraints.servicekey; import java.io.Closeable; import java.io.File; @@ -445,46 +438,7 @@ public class Jws2Client { * @param exitStatus */ static void printUsage(int exitStatus) { - System.out.println(); - System.out.println("Usage: " + hostkey - + pseparator + "host_and_context " + servicekey + pseparator - + "serviceName ACTION [OPTIONS] "); - System.out.println(); - System.out - .println(hostkey - + pseparator - + " - a full URL to the JWS2 web server including context path e.g. http://10.31.1.159:8080/ws"); - System.out.println(servicekey + pseparator + " - one of " - + Arrays.toString(Services.values())); - System.out.println(); - System.out.println("ACTIONS: "); - System.out - .println(inputkey - + pseparator - + " - full path to fasta formatted sequence file, from which to align sequences"); - System.out.println(paramList - + " - lists parameters supported by web service"); - System.out.println(presetList - + " - lists presets supported by web service"); - System.out.println(limitList + " - lists web services limits"); - System.out - .println("Please note that if input file is specified other actions are ignored"); - - System.out.println(); - System.out.println("OPTIONS (only for use with -i action):"); - - System.out.println(presetkey + pseparator - + " - name of the preset to use"); - System.out - .println(outputkey - + pseparator - + " - full path to the file where to write an alignment"); - System.out - .println("-f= - the name of the file with the list of parameters to use."); - System.out - .println("Please note that -r and -f options cannot be used together. " - + "Alignment is done with either preset or a parameters from the file, but not both!"); - + System.out.println(Constraints.help_text); System.exit(exitStatus); } diff --git a/webservices/compbio/ws/client/client_help.txt b/webservices/compbio/ws/client/client_help.txt new file mode 100644 index 0000000..7c70d4f --- /dev/null +++ b/webservices/compbio/ws/client/client_help.txt @@ -0,0 +1,65 @@ + +JABAWS client v2.0 June 2011 http://www.compbio.dundee.ac.uk/jabaws + +Usage: -h=host_and_context <-s=serviceName> ACTION [OPTIONS] + +-h= - a full URL to the JABAWS web server including context + path e.g. http://10.31.1.159:8080/ws +-s= - one of [MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, + AAConWS, JronnWS, DisemblWS, GlobPlotWS] + is required for all ACTIONS but -list_services + +ACTIONS: +-list_services - list available services +-test - test service +-i= - full path to fasta formatted sequence file, from which to align + sequences +-parameters - lists parameters supported by web service +-presets - lists presets supported by web service +-limits - lists web services limits + +Please note that if input file is specified other actions are ignored + +OPTIONS (only for use with -i action): +-r= - name of the preset to use +-o= - full path to the file where to write an alignment +-f= - the name of the file with the list of parameters to use. + +Please note that -r and -f options cannot be used together. Alignment is done with +either preset or a parameters from the file, but not both! + +EXAMPLES: + +1) List all available services on the host + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -list_services + +2) Test Clustal web service + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=ClustalWS -test + +3) Align sequence from file input.txt with Probcons. Record resulting alignment +into the output.txt + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=ProbconsWS -i=input.txt -o=output.txt + +4) Calculate disorder with Disembl take input from input.txt, output results to +the console + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=DisemblWS -i=input.txt + +5) List all parameters available for AAconWS service + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=AAconWS -parameters + +6) Calculate conservation with AAConWS using LANDGRAF method, for Clustal alignment +from input.txt and report the scores to the console + +Jws2Client -h=http://www.compbio.dundee.ac.uk/jabaws -s=AAconWS -i=input.txt -f=prm.txt + +Where the content of prm.txt file is -m=LANDGRAF +The list of the supported parameters can be obtained as shown in the example 5. + +Citation: Peter V. Troshin, James B. Procter and Geoffrey J. Barton - "Java +Bioinformatics Analysis Web Services for Multiple Sequence Alignment - +JABAWS:MSA" Bioinformatics 2011; doi: 10.1093/bioinformatics/btr304. -- 1.7.10.2