comparison osra.py @ 22:70b28a917515 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
author bgruening
date Sun, 01 Nov 2015 10:31:25 -0500
parents
children
comparison
equal deleted inserted replaced
21:ff23947232d0 22:70b28a917515
1 #!usr/bin/env python
2
3 import os, sys
4 import subprocess
5
6 """
7 OSRA_DATA_FILES is set during the toolshed Installation
8 If it is not set, use the standard configuration of OSRA.
9 That means we need to delete argument 4-7.
10 That script is a hack, because we do not know the content of OSRA_DATA_FILES at xml evaluation time.
11
12 osra -f $oformat $infile
13 -l \$OSRA_DATA_FILES/spelling.txt -a \$OSRA_DATA_FILES/superatom.txt
14 > $outfile
15 """
16
17 if not os.path.exists(sys.argv[7]):
18 # OSRA_DATA_FILES path is not set or the spelling file is not existent
19 sys.argv.pop(7) # superatom.txt path
20 sys.argv.pop(6) # -a
21 sys.argv.pop(5) # speling.txt path
22 sys.argv.pop(4) # -l
23
24 sys.argv[0] = 'osra'
25 subprocess.call(sys.argv, stdout=sys.stdout)
26
27