# HG changeset patch # User bernhardlutz # Date 1395581247 14400 # Node ID a9793e52a3ef44bc789b1bd0908329728a582e77 Uploaded diff -r 000000000000 -r a9793e52a3ef rest_tool.py --- /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 ) diff -r 000000000000 -r a9793e52a3ef rest_tool.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rest_tool.xml Sun Mar 23 09:27:27 2014 -0400 @@ -0,0 +1,43 @@ + + Fetch pubchem data + echo "0.1.0" + + REST_TOOL_SCRIPT_PATH + + + python \$GRAPHCONVERTER_SCRIPT_PATH/rest_tool.py --id $id --type $input_type --outformat $output_format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool fetches data from pubchem + + diff -r 000000000000 -r a9793e52a3ef test-data/bsp_graph.gml~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/bsp_graph.gml~ Sun Mar 23 09:27:27 2014 -0400 @@ -0,0 +1,49 @@ + Creator "yFiles" + Version 2.2 + graph + [ hierarchic 1 + directed 1 + node + [ id 0 + graphics + [ x 200.0 + y 0.0 + ] + LabelGraphics + [ text "January" ] + ] + node + [ id 1 + graphics + [ x 425.0 + y 75.0 + ] + LabelGraphics + [ text "December" ] + ] + edge + [ source 1 + target 0 + graphics + [ Line + [ point + [ x 425.0 + y 75.0 + ] + point + [ x 425.0 + y 0.0 + ] + point + [ x 200.0 + y 0.0 + ] + ] + ] + LabelGraphics + [ text "Happy New Year!" + model "six_pos" + position "head" + ] + ] + ] diff -r 000000000000 -r a9793e52a3ef tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Sun Mar 23 09:27:27 2014 -0400 @@ -0,0 +1,5 @@ + + + $REPOSITORY_INSTALL_DIR + +