import sys, os, string
path = os.getcwd()
sys.path.append(os.path.join(path,"lib"))
import main

try:
    import psyco
    psyco.profile()
except:
    pass


###############################################################################
if __name__ == "__main__":
    options = {
               "-i":"zip",          # input folder
               "-o":"output",       # output folder
               "-x":"",             # pattern
               "-f":"", 	    # folder
               "-n":"No",           # GC-normalization
               "-g":"",             # reference gene
               "-r":0,	            # clustering number
               "-c":1,              # N Protein Distance Contribution
               "-e":"No",           # default parameter
               "-d":"Yes",          # save distance table
               "-m":"Yes",          # save clustering matrix
               "-t":"Yes",          # save phylogenetic tree
               "-l":"Yes",          # save cladogram
               "-p":"Yes",          # save Verhulst plot
            }
    arguments = sys.argv[1:]
    if arguments:
        for i in range(0,len(arguments)-1,2):
            key = arguments[i]
            if key not in options:
                raise IOError("Unknown argument " + key + "!")
            if i <= len(arguments)-2:
                options[key] = arguments[i+1]
    main.Interface(options)
