837e4b3fafe4207fc83283974cc5fc954f0901f0
[jabaws.git] / runner / compbio / runner / _impl / RPSBlast.java
1 /* Copyright (c) 2011 Peter Troshin\r
2  *  \r
3  *  JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0     \r
4  * \r
5  *  This library is free software; you can redistribute it and/or modify it under the terms of the\r
6  *  Apache License version 2 as published by the Apache Software Foundation\r
7  * \r
8  *  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\r
9  *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache \r
10  *  License for more details.\r
11  * \r
12  *  A copy of the license is in apache_license.txt. It is also available here:\r
13  * @see: http://www.apache.org/licenses/LICENSE-2.0.txt\r
14  * \r
15  * Any republication or derived work distributed in source code form\r
16  * must include this copyright and license notice.\r
17  */\r
18 package compbio.runner._impl;\r
19 \r
20 import static compbio.runner._impl.BlastParameters.parAlView;\r
21 import static compbio.runner._impl.BlastParameters.parDatabase;\r
22 \r
23 import java.util.Arrays;\r
24 import java.util.List;\r
25 \r
26 import compbio.runner._SkeletalCommandBuilder;\r
27 \r
28 public class RPSBlast extends _SkeletalCommandBuilder {\r
29 \r
30         enum DB {\r
31                 Pfam, Cdd, Cog, Smart, Kog, Tirg\r
32         }\r
33 \r
34         private static final String command = Environment.getBlastBinDir()\r
35                         + getCommandName();\r
36 \r
37         private final String workDirectory;\r
38 \r
39         public RPSBlast(String workDirectory) {\r
40                 this.workDirectory = workDirectory;\r
41         }\r
42 \r
43         // my $blast =\r
44         // "$blast_dir/rpsblast -i $input -d $dblocat/$dbnam -m 9 -a 1 -o $output_dir/$outfile.rpsblastout";\r
45         // Could be static, but interface declaration requires to be overriden\r
46         public String getCommand(ExecProvider provider) {\r
47                 return command;\r
48         }\r
49 \r
50         public static String getTestCommand() {\r
51                 return command;\r
52         }\r
53 \r
54         public static String getCommandName() {\r
55                 return "rpsblast";\r
56         }\r
57 \r
58         static List<String> getTestArgs() {\r
59                 return Arrays.asList(new String[] {\r
60                                 parDatabase + Environment.getRPSBlastDatabasesDir() + DB.Smart,\r
61                                 parAlView });\r
62         }\r
63 \r
64         String getDefaultEvalue() {\r
65                 return "1e-6";\r
66         }\r
67 \r
68         @Override\r
69         public List<String> getCreatedFiles() {\r
70                 // TODO Auto-generated method stub\r
71                 return null;\r
72         }\r
73 \r
74         @Override\r
75         public String getInput() {\r
76                 // TODO Auto-generated method stub\r
77                 return null;\r
78         }\r
79 \r
80 }\r