annotate osra.py @ 2:548537fc2577 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:42 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
548537fc2577 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
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
2
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
3 import os, sys
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
4 import subprocess
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
5
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
6 """
548537fc2577 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
548537fc2577 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.
548537fc2577 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.
548537fc2577 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.
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
11
548537fc2577 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
548537fc2577 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
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
14 > $outfile
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
15 """
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
16
548537fc2577 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]):
548537fc2577 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
548537fc2577 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
548537fc2577 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
548537fc2577 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
548537fc2577 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
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
23
548537fc2577 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'
548537fc2577 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)
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
26
548537fc2577 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/osra commit a44c0a13283e873a740eabcad04f021208290dfe-dirty
bgruening
parents:
diff changeset
27