comparison commons/launcher/MapClusterLauncher.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
comparison
equal deleted inserted replaced
17:b0e8584489e6 18:94ab73e8a190
1 #!/usr/bin/env python
2
3 ##@file
4 # Launch MapProgramLauncher.py on several files in parallel on a cluster.
5
6
7 import os
8 import sys
9 import getopt
10 import exceptions
11
12 from pyRepet.launcher.AbstractClusterLauncher import *
13 from commons.launcher.MapProgramLauncher import MapProgramLauncher
14
15
16 class MapClusterLauncher( AbstractClusterLauncher ):
17 """
18 Launch Map on several files in parallel on a cluster.
19 """
20
21
22 def __init__( self ):
23 """
24 Constructor.
25 """
26 AbstractClusterLauncher.__init__( self )
27 AbstractClusterLauncher.setAcronym( self, "Map" )
28
29 self._cmdLineSpecificOptions = "s:m:O:e:"
30
31 self._exeWrapper = "MapProgramLauncher.py"
32 self._prgLauncher = None
33 self._prgLauncher = self.getProgramLauncherInstance()
34
35
36 def getSpecificHelpAsString( self ):
37 """
38 Return the specific help as a string.
39 """
40 string = ""
41 string += "\nspecific options:"
42 string += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self.getGapSize() )
43 string += "\n -m: penalty for a mismatch (default='%i')" % ( self.getMismatchPenalty() )
44 string += "\n -O: penalty for a gap openning (default='%i')" % ( self.getGapOpenPenalty() )
45 string += "\n -e: penalty for a gap extension (default='%i')" % ( self.getGapExtendPenalty() )
46 return string
47
48
49 def getGapSize( self ):
50 return self._prgLauncher.getGapSize()
51
52
53 def getMismatchPenalty( self ):
54 return self._prgLauncher.getMismatchPenalty()
55
56
57 def getGapOpenPenalty( self ):
58 return self._prgLauncher.getGapOpenPenalty()
59
60
61 def getGapExtendPenalty( self ):
62 return self._prgLauncher.getGapExtendPenalty()
63
64
65 def getProgramLauncherInstance( self ):
66 if self._prgLauncher == None:
67 self._prgLauncher = MapProgramLauncher()
68 self._prgLauncher.setInputFile( GENERIC_IN_FILE )
69 self._prgLauncher.setOutputFile( "%s.fa_aln" % ( GENERIC_IN_FILE ) )
70 #TESt de SATannot verifier si clean est a vrai
71 #self._prgLauncher.setClean()
72 self._prgLauncher.setVerbosityLevel( 1 )
73 self._prgLauncher.setListFilesToKeep()
74 self._prgLauncher.setListFilesToRemove()
75 return self._prgLauncher
76
77
78 if __name__ == "__main__":
79 i = MapClusterLauncher()
80 i.setAttributesFromCmdLine()
81 i.run()