0
|
1 #!/usr/bin/env python
|
|
2
|
|
3 # Copyright (C) 2011-2014 CRS4.
|
|
4 #
|
|
5 # This file is part of Seal.
|
|
6 #
|
|
7 # Seal is free software: you can redistribute it and/or modify it
|
|
8 # under the terms of the GNU General Public License as published by the Free
|
|
9 # Software Foundation, either version 3 of the License, or (at your option)
|
|
10 # any later version.
|
|
11 #
|
|
12 # Seal is distributed in the hope that it will be useful, but
|
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 # for more details.
|
|
16 #
|
|
17 # You should have received a copy of the GNU General Public License along
|
|
18 # with Seal. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
|
20
|
|
21
|
|
22 # A really really thin wrapper. We only seem to need it because Galaxy won't
|
|
23 # search for the command in the PATH
|
|
24
|
|
25 import os
|
|
26 import subprocess
|
|
27 import sys
|
|
28
|
|
29 if __name__ == '__main__':
|
|
30 output_path = sys.argv[-1]
|
|
31 try:
|
|
32 # seal merge_alignments won't overwrite an existing file, so we first remove
|
|
33 # the file Galaxy creates for us.
|
|
34 os.remove(output_path)
|
|
35 except IOError:
|
|
36 pass
|
|
37 hadoopized_output_path = 'file://' + os.path.abspath(output_path)
|
|
38 cmd = [ 'seal', 'merge_alignments' ] + sys.argv[1:-1]
|
|
39 cmd.append(hadoopized_output_path)
|
|
40 print "running command:", str(cmd)
|
|
41 subprocess.check_call(cmd)
|