annotate NGSrich_0.5.5/src/NGSrich.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
1 import java.io.IOException;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
2
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
3 import _main.NGSrichEvaluate;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
4 import _main.NGSrichSummarize;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
5 import exceptions.FileFormatException;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
6
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
7 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
8 * This is the main class.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
9 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
10 * @author Peter Frommolt
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
11 * @author Ali Abdallah
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
12 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
13
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
14 public class NGSrich {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
15
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
16 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
17 * Self Explanatory.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
18 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
19 * @param args an Array of argument. The first argument is command and the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
20 * other arguments are its options.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
21 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
22 * @throws FileFormatException if the used files have formally a bad format.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
23 * @throws IOException
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
24 * @throws InterruptedException
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
25 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
26 public static void main(String[] args) throws FileFormatException,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
27 IOException, InterruptedException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
28
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
29 String usagestr =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
30 "\nThis is NGSrich, version 0.5.4.\n\n"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
31 + "Usage: java NGSrich [command] [options]\n\n"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
32 + "\tCommands:\n"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
33 + "\tevaluate"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
34 + "\tEvaluate target enrichment for a single sample.\n"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
35 + "\tsummarize"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
36 + "\tCreate a summary report for several evaluations.\n";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
37
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
38 int alen = args.length;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
39 if (alen == 0) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
40 System.out.println(usagestr);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
41 System.exit(0);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
42 } else {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
43 String[] cparams = new String[alen - 1];
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
44 for (int i = 0; i < alen - 1; i = i + 1) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
45 cparams[i] = args[i + 1];
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
46 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
47 String eval = "evaluate", summ = "summarize";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
48 if (eval.equals(args[0])) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
49 // Geändert von AA 27.07.2011.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
50 new NGSrichEvaluate(cparams).evaluate();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
51 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
52 if (summ.equals(args[0])) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
53 // Geändert von AA 27.07.2011.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
54 new NGSrichSummarize(cparams).summarize();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
55 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
56 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
57 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
58 }