18
|
1 import os
|
|
2 from pyRepet.launcher.Launcher import HmmpfamLauncher
|
|
3
|
|
4
|
|
5 class HmmpfamClusterComponent( object ):
|
|
6
|
|
7 def __init__(self):
|
|
8 self._component = None
|
|
9 self._profilDatabank = ""
|
|
10 self._resultDir = ""
|
|
11 self._queryDir = ""
|
|
12 self._tmpDir = ""
|
|
13 self._jobDb = None
|
|
14 self._SGEQueue = ""
|
|
15 self._SGEGroupId = ""
|
|
16
|
|
17 def loadConfig( self, config ):
|
|
18 self._profilDatabank = config.get( "profil_search","ProfilDatabank" )
|
|
19 self._queryDir = config.get( "hmmer_config","query_dir" )
|
|
20 self._tmpDir = config.get( "hmmer_config", "tmp_dir" )
|
|
21 self._resultDir = config.get( "hmmer_config", "result_dir" )
|
|
22 self._SGEQueue = config.get( "sge_config", "queue" )
|
|
23 self._SGEGroupId = config.get( "sge_config", "groupid" )
|
|
24
|
|
25 def run(self):
|
|
26 params = {"param":"--informat FASTA -E 10",
|
|
27 "profilDB": self._profilDatabank,
|
|
28 "outputDir": self._resultDir,
|
|
29 "query": self._queryDir,
|
|
30 "job_table":"jobs",
|
|
31 "queue" : self._SGEQueue,
|
|
32 "groupid" : self._SGEGroupId,
|
|
33 "tmpDir": self._tmpDir,
|
|
34 "cDir" : "."}
|
|
35 self._component = HmmpfamLauncher(self._jobDb, params)
|
|
36 self._component.run()
|
|
37
|
|
38 def clean (self):
|
|
39 dirToClean = self._tmpDir
|
|
40 os.system("rm " + dirToClean + "/*")
|
|
41 dirToClean = self._resultDir
|
|
42 os.system("rm " + dirToClean + "/*")
|
|
43
|
|
44 def setProfilDatabank (self, profilDatabank):
|
|
45 self._profilDatabank = profilDatabank
|
|
46
|
|
47 def getProfilDatabank(self):
|
|
48 return self._profilDatabank
|
|
49
|
|
50 def setQueryDir(self, input):
|
|
51 self._queryDir = input
|
|
52
|
|
53 def getQueryDir( self ):
|
|
54 return self._queryDir
|
|
55
|
|
56 def setSubjectDir(self, input):
|
|
57 self._subjectDir = input
|
|
58
|
|
59 def getSubjectDir( self ):
|
|
60 return self._subjectDir
|
|
61
|
|
62 def setSGEQueue(self, queue):
|
|
63 self._SGEQueue = queue
|
|
64
|
|
65 def getSGEQueue( self ):
|
|
66 return self._SGEQueue
|
|
67
|
|
68 def setSGEGrouId(self, id):
|
|
69 self._SGEGroupId = id
|
|
70
|
|
71 def getSGEGroupId( self ):
|
|
72 return self._SGEGroupId;
|
|
73
|
|
74 def setTmpDir(self, tmpDir):
|
|
75 self._tmpDir = tmpDir
|
|
76
|
|
77 def getTmpDir( self ):
|
|
78 return self._tmpDir
|
|
79
|
|
80 def setResultDir(self, wkDir):
|
|
81 self._resultDir = wkDir
|
|
82
|
|
83 def getResultDir(self):
|
|
84 return self._resultDir
|
|
85
|
|
86 def setJobDb (self, jobDb):
|
|
87 self._jobDb = jobDb
|
|
88
|
|
89 def getJobDb (self):
|
|
90 return self._jobDb
|
|
91 |