diff rest_tool.py @ 0:a9793e52a3ef draft

Uploaded
author bernhardlutz
date Sun, 23 Mar 2014 09:27:27 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rest_tool.py	Sun Mar 23 09:27:27 2014 -0400
@@ -0,0 +1,31 @@
+#!/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 )