Mercurial > repos > yufei-luo > s_mart
diff commons/launcher/MapClusterLauncher.py @ 31:0ab839023fe4
Uploaded
author | m-zytnicki |
---|---|
date | Tue, 30 Apr 2013 14:33:21 -0400 |
parents | 94ab73e8a190 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commons/launcher/MapClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +##@file +# Launch MapProgramLauncher.py on several files in parallel on a cluster. + + +import os +import sys +import getopt +import exceptions + +from pyRepet.launcher.AbstractClusterLauncher import * +from commons.launcher.MapProgramLauncher import MapProgramLauncher + + +class MapClusterLauncher( AbstractClusterLauncher ): + """ + Launch Map on several files in parallel on a cluster. + """ + + + def __init__( self ): + """ + Constructor. + """ + AbstractClusterLauncher.__init__( self ) + AbstractClusterLauncher.setAcronym( self, "Map" ) + + self._cmdLineSpecificOptions = "s:m:O:e:" + + self._exeWrapper = "MapProgramLauncher.py" + self._prgLauncher = None + self._prgLauncher = self.getProgramLauncherInstance() + + + def getSpecificHelpAsString( self ): + """ + Return the specific help as a string. + """ + string = "" + string += "\nspecific options:" + string += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self.getGapSize() ) + string += "\n -m: penalty for a mismatch (default='%i')" % ( self.getMismatchPenalty() ) + string += "\n -O: penalty for a gap openning (default='%i')" % ( self.getGapOpenPenalty() ) + string += "\n -e: penalty for a gap extension (default='%i')" % ( self.getGapExtendPenalty() ) + return string + + + def getGapSize( self ): + return self._prgLauncher.getGapSize() + + + def getMismatchPenalty( self ): + return self._prgLauncher.getMismatchPenalty() + + + def getGapOpenPenalty( self ): + return self._prgLauncher.getGapOpenPenalty() + + + def getGapExtendPenalty( self ): + return self._prgLauncher.getGapExtendPenalty() + + + def getProgramLauncherInstance( self ): + if self._prgLauncher == None: + self._prgLauncher = MapProgramLauncher() + self._prgLauncher.setInputFile( GENERIC_IN_FILE ) + self._prgLauncher.setOutputFile( "%s.fa_aln" % ( GENERIC_IN_FILE ) ) + #TESt de SATannot verifier si clean est a vrai + #self._prgLauncher.setClean() + self._prgLauncher.setVerbosityLevel( 1 ) + self._prgLauncher.setListFilesToKeep() + self._prgLauncher.setListFilesToRemove() + return self._prgLauncher + + +if __name__ == "__main__": + i = MapClusterLauncher() + i.setAttributesFromCmdLine() + i.run()