Mercurial > repos > bernhardlutz > rest_tool
view rest_tool.py @ 0:a9793e52a3ef draft
Uploaded
author | bernhardlutz |
---|---|
date | Sun, 23 Mar 2014 09:27:27 -0400 |
parents | |
children |
line wrap: on
line source
#!/usr/bin/env python # Aufruf convert_graph.py --type type --id id --outformat format import sys, os import networkx as nx import argparse import json from xgmml_networkx import XGMMLParserHelper, XGMMLWriter from networkx.readwrite import json_graph #supported graph_types output_types = ["tsv", "csv", "png", "json", "txt", "xml", "sdf", "asnt", "asnb", "jsonp"] def main(args): if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--type', type=str, help="That you want BioAssay Compund ...") parser.add_argument('--id', type=str, help="Specify the format of the input graph") parser.add_argument('--outformat', type=str, help="Specify the format of the output", choices = output_types) if len(sys.argv) < 6: print "Too few arguments..." parser.print_help() exit(1) args = parser.parse_args() main( args )