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