-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapalignerposeclustering.py
50 lines (39 loc) · 1.44 KB
/
mapalignerposeclustering.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import shutil
import sys
import openms_workflow as wrkflw
'''
#3 module: map aligner pose clustering
'''
def mapalignerposeclustering(input_port, ini_file, out_port):
command = "MapAlignerPoseClustering "
if ini_file is not None:
command += "-ini " + ini_file + " "
command += "-in "
for input_file,file_count in wrkflw.parsefolder(input_port):
command += input_file + ' '
command += '-out '
for input_file,file_count in wrkflw.parsefolder(input_port):
command += out_port+"/"+out_port+"-"+file_count+".featureXML" + ' '
command += '> ' + out_port+'/logfile.txt'
# command += '-log ' + out_port+'/logfile-00000.txt'
print("COMMAND: " + command + "\n")
os.system(command)
if __name__ == '__main__':
print("===MAP ALIGNER POSE CLUSTERING===")
in_port = sys.argv[4]
out_port = sys.argv[6]
# validate previous module's output
# wrkflw.prevalidation("id-mapper", in_port)
# set env
os.environ["LD_LIBRARY_PATH"] = sys.argv[1]
os.environ["PATH"] = sys.argv[2]
os.environ["OPENMS_DATA_PATH"] = os.path.abspath(sys.argv[3])
# ini file
ini_file = None
if os.path.exists('iniFiles'):
ini_dir = list(wrkflw.parsefolder('iniFiles'))
if len(ini_dir) > 0:
ini_file = ini_dir[0][0]
mapalignerposeclustering(in_port, ini_file, out_port)
# wrkflw.postvalidation(modulename="map-aligner-pose-clustering", outpath=out_port)