package bicat.run_machine; import javax.swing.JOptionPane; import bicat.gui.BicatGui; /** *
* Title: cHawk for BicAT Tool *
* * * @author Waseem Ahmad (wahmad at acm dor org) * * * Run Machine for cHawk algorithm (2007). * * For its execution, a shared library is needed (lib/linux/libcHawk.so for Linux). * */ public class RunMachine_cHawk extends RunMachine { // =========================================================================== public RunMachine_cHawk(BicatGui o) { owner = o; } // =========================================================================== public native void run_cHawk(double[] data, int total_gs, int total_cs, // String[] g_names, String[] c_names, int algo, double delta, int iter, double p_rand_1, double p_rand_2, double p_rand_3, int logarithm, int randomize, int n, String out_file); static { System.loadLibrary("cHawk"); System.out.println("cHawk library loaded"); } public synchronized void runBiclustering(final ArgumentscHawk cca) { final SwingWorker worker = new SwingWorker() { public Object construct() { // new RunMachineCC(null).runCC(); if (BicatGui.debug)System.out.println("gene number: "+ cca.getGeneNumber() +" Chip number: "+ cca.getChipNumber()); run_cHawk(cca.getData(), cca.getGeneNumber(), cca.getChipNumber(), cca.getAlgorithm(), cca.getDelta(), cca.getIter(), cca .getPR1(), cca.getPR2(), cca.getPR3(), cca .getLogarithm(), cca.getRandomize(), cca.getN(), cca.getOutputFile()); if (owner.debug) { System.out.println("Started cHawk in a new thread!\n"); } return null; } public void finished() { System.out.println("Getting results from cHawk... " + owner.currentDirectoryPath + "/output.cHawk"); computedBiclusters = getOutputBiclusters(owner.currentDirectoryPath + "/output.cHawk"); outputBiclusters = computedBiclusters; // is a LinkedList of // BitSet // representated-BCs // (bicat.runMachine.Bicluster_bitset) transferList(); owner.finishUpRun(cca.getDatasetIdx(), outputBiclusters, cca .getPreprocessOptions(), "cHawk"); JOptionPane .showMessageDialog( null, "Calculations finished.\nThe results can be found in the bicluster results section of the current dataset."); } }; worker.start(); } }