annotate toolVisualizer.py @ 26:fbf2e5072b32 draft

planemo upload commit c74b3ff2329f69ac7b309cc7d9bdf7b9d78106fb-dirty
author pablocarb
date Fri, 05 Jul 2019 17:29:50 -0400
parents bce330b97d42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
1 #!/usr/bin/env python3
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
2 # -*- coding: utf-8 -*-
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
3 """
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
4 Created on Mar 19
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
5
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
6 @author: Pablo Carbonell
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
7 @description: Pathway visualizer.
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
8
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
9 """
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
10 import argparse
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
11 import os
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
12 from rpviz.main import run
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
13
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
14 def arguments():
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
15 parser = argparse.ArgumentParser(description='toolVisualizer: Pathway visualizer. Pablo Carbonell, SYNBIOCHEM, 2019')
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
16 parser.add_argument('infile',
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
17 help='Input SBML pathway file.')
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
18 parser.add_argument('outfile',
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
19 help='Output HTML file.')
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
20 return parser
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
21
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
22 def runVisualizer( infile, outfile ):
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
23 run(infile,outfile)
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
24
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
25
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
26
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
27 if __name__ == "__main__":
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
28 parser = arguments()
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
29 arg = parser.parse_args()
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
30 assert os.path.exists(arg.infile)
bce330b97d42 planemo upload commit 58fe26f452c61f1682290f662666043937943b81-dirty
pablocarb
parents:
diff changeset
31 runVisualizer( arg.infile, arg.outfile )