1 package jalview.ws.rest.clientdefs;
3 import jalview.io.packed.DataProvider.JvDataType;
4 import jalview.util.MessageManager;
5 import jalview.ws.rest.InputType;
6 import jalview.ws.rest.RestClient;
7 import jalview.ws.rest.RestServiceDescription;
8 import java.util.Hashtable;
10 public class ShmrRestClient
13 public static RestClient makeShmmrRestClient()
15 String action = "Analysis", description = "Sequence Harmony and Multi-Relief (Brandt et al. 2010)", name = MessageManager
16 .getString("label.multiharmony");
17 Hashtable<String, InputType> iparams = new Hashtable<String, InputType>();
18 jalview.ws.rest.params.JobConstant toolp;
19 // toolp = new jalview.ws.rest.JobConstant("tool","jalview");
20 // iparams.put(toolp.token, toolp);
21 // toolp = new jalview.ws.rest.params.JobConstant("mbjob[method]","shmr");
22 // iparams.put(toolp.token, toolp);
24 // jalview.ws.rest.params.JobConstant("mbjob[description]","step 1");
25 // iparams.put(toolp.token, toolp);
26 // toolp = new jalview.ws.rest.params.JobConstant("start_search","1");
27 // iparams.put(toolp.token, toolp);
28 // toolp = new jalview.ws.rest.params.JobConstant("blast","0");
29 // iparams.put(toolp.token, toolp);
31 jalview.ws.rest.params.Alignment aliinput = new jalview.ws.rest.params.Alignment();
32 // SHMR server has a 65K limit for content pasted into the 'ali' parameter,
33 // so we always upload our files.
34 aliinput.token = "ali_file";
35 aliinput.writeAsFile = true;
36 iparams.put(aliinput.token, aliinput);
37 jalview.ws.rest.params.SeqGroupIndexVector sgroups = new jalview.ws.rest.params.SeqGroupIndexVector();
38 sgroups.setMinsize(2);
39 sgroups.min = 2;// need at least two group defined to make a partition
40 iparams.put("groups", sgroups);
41 sgroups.token = "groups";
43 RestServiceDescription shmrService = new RestServiceDescription(
47 "http://zeus.few.vu.nl/programs/shmrwww/index.php?tool=jalview",// ?tool=jalview&mbjob[method]=shmr&mbjob[description]=step1",
48 "?tool=jalview", iparams, true, false, '-');
49 // a priori knowledge of the data returned from the service
50 shmrService.addResultDatatype(JvDataType.ANNOTATION);
51 return new RestClient(shmrService);