diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NGSrich_0.5.5/src/NGSrich.java	Mon Nov 21 08:12:19 2011 -0500
@@ -0,0 +1,58 @@
+import java.io.IOException;
+
+import _main.NGSrichEvaluate;
+import _main.NGSrichSummarize;
+import exceptions.FileFormatException;
+
+/**
+ * This is the main class.
+ * 
+ * @author Peter Frommolt
+ * @author Ali Abdallah
+ */
+
+public class NGSrich {
+
+	/**
+	 * Self Explanatory.
+	 * 
+	 * @param args an Array of argument. The first argument is command and the
+	 * other arguments are its options.
+	 * 
+	 * @throws FileFormatException if the used files have formally a bad format. 
+	 * @throws IOException 
+	 * @throws InterruptedException
+	 */
+	public static void main(String[] args) throws FileFormatException,
+			IOException, InterruptedException {
+
+		String usagestr = 
+					"\nThis is NGSrich, version 0.5.4.\n\n"
+				+ 	"Usage: java NGSrich [command] [options]\n\n"
+				+ 	"\tCommands:\n"
+				+ 	"\tevaluate" 
+				+ 	"\tEvaluate target enrichment for a single sample.\n"
+				+ 	"\tsummarize" 
+				+ 	"\tCreate a summary report for several evaluations.\n";
+
+		int alen = args.length;
+		if (alen == 0) {
+			System.out.println(usagestr);
+			System.exit(0);
+		} else {
+			String[] cparams = new String[alen - 1];
+			for (int i = 0; i < alen - 1; i = i + 1) {
+				cparams[i] = args[i + 1];
+			}
+			String eval = "evaluate", summ = "summarize";
+			if (eval.equals(args[0])) {
+				// Geändert von AA 27.07.2011.
+				new NGSrichEvaluate(cparams).evaluate();
+			}
+			if (summ.equals(args[0])) {
+				// Geändert von AA 27.07.2011.
+				new NGSrichSummarize(cparams).summarize();
+			}
+		}
+	}
+}
\ No newline at end of file