1 /* Copyright (c) 2009 Peter Troshin
\r
3 * Jalview Web Services @version: 2.0
\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
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
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
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
18 package compbio.runner._impl;
\r
20 import static compbio.runner._impl.BlastParameters.parAlView;
\r
21 import static compbio.runner._impl.BlastParameters.parDatabase;
\r
22 import static compbio.runner._impl.BlastParameters.parDel;
\r
23 import static compbio.runner._impl.BlastParameters.parEvalue;
\r
24 import static compbio.runner._impl.BlastParameters.parInput;
\r
25 import static compbio.runner._impl.BlastParameters.parOutput;
\r
27 import java.io.File;
\r
28 import java.util.Arrays;
\r
29 import java.util.List;
\r
31 import compbio.runner._SkeletalCommandBuilder;
\r
33 public class BlastAll extends _SkeletalCommandBuilder {
\r
35 static final String command = "blastall";
\r
38 blastp, tbastn, blastn
\r
45 static double default_evalue = 0.001d;
\r
46 static final String parBlastType = "-p";
\r
48 private final String workDirectory;
\r
50 public BlastAll(String workDirectory) {
\r
51 this.workDirectory = workDirectory;
\r
54 // Resulting command:
\r
55 // /fc_gpfs/gjb_lab/www-refine/bin/blast_32bit/blast-2.2.17/bin/blastall -p
\r
56 // blastp -i $input -d $dbnam -e $evalue -m 9 -o $outfile
\r
58 String getCommand(blastType btype, dataBase database, String input,
\r
60 return Environment.getBlastBinDir() + command + parDel + parBlastType
\r
61 + blastType.blastp + parDel + parInput + input + parDel
\r
62 + parDatabase + Environment.getBlastDatabasesDir() + database
\r
63 + parDel + parEvalue + default_evalue + parAlView + parOutput
\r
67 String getFullTestCommand(String test_input, String test_outfile) {
\r
68 return Environment.getBlastBinDir() + command + parDel + parBlastType
\r
69 + blastType.blastp + parDel + parInput + test_input + parDel
\r
70 + parDatabase + Environment.getBlastDatabasesDir()
\r
71 + dataBase.pdb + parDel + parEvalue + default_evalue
\r
72 + parAlView + parOutput + test_outfile;
\r
75 static String getTestCommand() {
\r
76 return Environment.getBlastBinDir() + command;
\r
79 static List<String> getTestArgs() {
\r
81 .asList(new String[] {
\r
82 parBlastType + blastType.blastp,
\r
83 parDatabase + Environment.getBlastDatabasesDir()
\r
84 + dataBase.pdb, parEvalue + default_evalue,
\r
88 public boolean removeOutput(String outfile) {
\r
89 File out = new File(outfile);
\r
91 if (out.canWrite()) {
\r
92 return out.delete();
\r
98 public String getCommand(ExecProvider provider) {
\r
99 return Environment.getBlastBinDir() + command;
\r
102 public String getCommandName() {
\r
107 public List<String> getCreatedFiles() {
\r
108 // TODO Auto-generated method stub
\r
113 public String getInput() {
\r
114 // TODO Auto-generated method stub
\r