83ddca33ff2b01941650e5fd97e1c000977c24d1
[jabaws.git] / website / docs / v_2_2_0 / _sources / man / client.rst.txt
1 Command Line Client (CLI)
2 =========================
3
4 A JABAWS client is a Java application that lets you run the programs for which a JABAWS server provides web services. The most basic JABAWS client is a command line application this is able to call any of the JABAWS web services on any instance of JABAWS Server available over the web. The basic client is useful if you would like to test or execute the programs provided by the JABAWS server in your own scripts, but you do not want to handle any web service specific details. The client is an open source software, so you can also use the source code to as an example how to manipulate with JABAWS web services in your own code. Jalview [link], a multiple sequence alignment and analysis application, is a good example of a graphical JABAWS client. This client uses the same functionality as the JABAWS command line (CLI) client [link], but instead allows JABAWS services to be accessed in a more user-friendly manner, through a graphical user interface.
5
6 The command line client comes as a part of client package [link] which you are welcome to download. The command line client can be used to align sequences using any of JABAWS supported web services. The client is OS independent and supports most of the functions which can be accessed programmatically via JABAWS API [link]. Using this client you could align sequences using presets or custom parameters, please see examples of this below. Here is the list of options supported by the command line client.
7
8
9 ------------
10
11 .. _client_installing:
12
13 Installing
14 ----------
15
16 .. danger:: update for java
17
18 You need Java vX or higher installed in your machine to be able to run the JABAWS CLI client.
19 Please see the Java web site [link] for up to date instructions and downloads.
20
21
22 ------------
23
24 .. _cli_usage:
25
26 Usage
27 -----
28
29 .. code:: bash
30
31       java -jar jaba-client.jar
32
33 ::
34
35   Usage:
36   java -jar <path_to_jar_file> -h=host_and_context -s=serviceName ACTION [OPTIONS]
37   -h=<host_and_context> - a full URL to the JABAWS web server including context path e.g. http://10.31.10.159:8080/ws
38   -s=<ServiceName> - one of [MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS]
39
40
41   ACTIONS:
42   -i=<inputFile> - full path to fasta formatted sequence file, from which to align sequences
43   -parameters - lists parameters supported by web service
44   -presets - lists presets supported by web service
45   -limits - lists web services limits
46   Please note that if input file is specified other actions are ignored
47
48
49    OPTIONS: (only for use with -i action):
50   -r=<presetName> - name of the preset to use
51   -o=<outputFile> - full path to the file where to write an alignment
52   -f=<parameterInputFile> - the name of the file with the list of parameters to use.
53
54   Please note that -r and -f options cannot be used together. Alignment is done with either preset or aparameters from the file, but not both!
55
56
57 ------------
58
59 .. _cli_example:
60
61 Example Usage
62 -------------
63
64
65 Align sequences from input.fasta file using Mafft web service with default settings, print alignment in Clustal format to console.
66
67 .. code:: bash
68
69     java -jar jabaws-min-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws -s=MafftWS -i=d:\input.fasta
70
71 Content of input.fasta file is show below (please note sequences has been trimmed for clarity)
72
73 ::
74
75   >Foobar
76   MTADGPRELLQLRAAVRHRPQDFVAWL
77   >Bar
78   MGDTTAGEMAVQRGLALHQ
79   >Foofriend
80   MTADGPRELLQLRAAV
81
82 Align as in above example, but write output alignment in a file out.clustal, using parameters defined in prm.in file
83
84 .. code:: bash
85
86     java -jar jabaws-min-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws  -s=MafftWS -i=d:\input.fasta -o=d:\out.clustal -f=prm.in
87
88 The content of the prm.in file is shown below
89
90 ::
91
92   --nofft
93   --noscore
94   --fastaparttree
95   --retree=10
96   --op=2.2
97
98 The format of the file is the same for all JABAWS web services. Parameters are specified in exactly the same way as for native executables - alignment programs like Mafft etc. So parameters which you can use with command line version of an alignment program can be used with JABAWS. Most of the settings controlling alignment process are supported, but because any output has to be handled by JABAWS, settings controlling output are not allowed to be changed. For a list of parameters supported by a web service see the next example. In prm.in parameters are separated by the new line, and name of the parameter is separated from its value with an equals sign. This format is constant no matter which JABAWS web service is used.
99
100 .. code:: bash
101
102     java -jar jabaws-min-client.jar -h=http://myhost.compbio.ac.uk:8080/jabaws -s=MafftWS -parameters
103
104 The same client can be used to access JABAWS on different hosts. Just point the client to the host you want to use by changing the value of -h key.
105
106 For example you used ``-h=http://myhost.compbio.ac.uk:8080/jabaws`` server, now you want to use another server to ``-h=http://mylabserver.myuni.edu``. This comes handy if your favorite server is off and you need to do the job yesterday.