Beispiel #1
0
def main() :
    if (len(argv) < 2) or (argv[1] in ('-h', '--help', 'help')) :
        usage()
        return 1

    command = argv[1]
    if command not in get_commands() :
        print >> stderr, "Error: unknown command '%s'" % command
        usage()
        return 1

    if command == 'test' :
        test_system(output=True)
        return 0

    options = parse_args(command, argv[2:])
    log = setup_logging(options['verbose'])
    check_options(command, options, log)

    test_system(command, options, exit_on_failure=True)
    System.tempdir(options['outdir']) # some objects need this set

    wf = WorkFlow(options)

    if command == 'preprocess' :
        return wf.preprocess()
 
    elif command == 'summary' :
        return wf.summary()

    elif command == 'cluster' :
        return wf.cluster()

    elif command == 'label' :
        return wf.label()

    elif command == 'showcounts' :
        return wf.showcounts()

    elif command == 'showlabels' :
        return wf.showlabels()

    elif command == 'phylogeny' :
        return wf.phylogeny()
    
    elif command == 'heatmap' :
        return wf.heatmap()

    elif command == 'wasabi' :
        return wf.wasabi()

    else :
        print >> stderr, "'%s' appears to be partially implemented!" % command

    return 1