Search in sources :

Example 1 with UniqueFilter

use of edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.UniqueFilter in project clusterMaker2 by RBVI.

the class TransClust method main.

/**
 * The main method for the TransClust program. Starts the program
 * appropriately.
 * @param args The input variables.
 */
public static void main(String[] args) {
    TransClust.args = args;
    /* initialise logging */
    Logger logger = Logger.getLogger("");
    Handler[] handler = logger.getHandlers();
    for (Handler h : handler) {
        if (h instanceof ConsoleHandler) {
            h.setLevel(Level.INFO);
            h.setFormatter(new ConsoleFormatter());
            h.setFilter(new UniqueFilter());
        }
    }
    /* check if no input is given */
    if (args.length == 0) {
        log.severe("ERROR: Please define at least an input file/directory and an " + "output file for the results. Use -help for more details or see the " + "respective documentation.\n\n");
        System.out.println(ArgsUtility.createUsage().toString());
        System.exit(-1);
    }
    /* print usage */
    if ((args.length == 1) && ((args[0].trim().equalsIgnoreCase("-help")) || (args[0].trim().equalsIgnoreCase("--help")))) {
        System.out.println(ArgsUtility.createUsage().toString());
        System.exit(-1);
    } else /* start with parameters from console */
    {
        try {
            new Console(args);
        } catch (InvalidInputFileException e) {
            log.severe("ERROR: An invalid file/path name was given.");
            e.printStackTrace();
            System.exit(-1);
        } catch (ArgsParseException e) {
            log.severe(e.getMessage());
            log.severe("ERROR: please see usage details!");
            System.out.println(ArgsUtility.createUsage().toString());
        } catch (IOException e) {
        }
    }
}
Also used : ArgsParseException(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.ArgsParseException) ConsoleFormatter(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.ConsoleFormatter) InvalidInputFileException(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.InvalidInputFileException) UniqueFilter(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.UniqueFilter) Console(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.Console) FileHandler(java.util.logging.FileHandler) ConsoleHandler(java.util.logging.ConsoleHandler) Handler(java.util.logging.Handler) IOException(java.io.IOException) Logger(java.util.logging.Logger) ConsoleHandler(java.util.logging.ConsoleHandler)

Aggregations

InvalidInputFileException (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.InvalidInputFileException)1 ArgsParseException (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.ArgsParseException)1 Console (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.Console)1 ConsoleFormatter (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.ConsoleFormatter)1 UniqueFilter (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.networkClusterers.TransClust.de.layclust.taskmanaging.io.UniqueFilter)1 IOException (java.io.IOException)1 ConsoleHandler (java.util.logging.ConsoleHandler)1 FileHandler (java.util.logging.FileHandler)1 Handler (java.util.logging.Handler)1 Logger (java.util.logging.Logger)1