annotate commons/launcher/MafftClusterLauncher.py @ 19:9bcfa7936eec

Deleted selected files
author m-zytnicki
date Mon, 29 Apr 2013 03:23:29 -0400
parents 94ab73e8a190
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 #!/usr/bin/env python
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 ##@file
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 # Launch MafftProgramLauncher on several files in parallel on a cluster.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 from pyRepet.launcher.AbstractClusterLauncher import *
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 from commons.launcher.MafftProgramLauncher import MafftProgramLauncher
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 class MafftClusterLauncher( AbstractClusterLauncher ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 Launch Mafft on several files in parallel on a cluster.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 def __init__( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 Constructor.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 AbstractClusterLauncher.__init__( self )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 AbstractClusterLauncher.setAcronym( self, "Mafft" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 self._cmdLineSpecificOptions = "p:"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 self._exeWrapper = "MafftProgramLauncher.py"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 self._prgLauncher = None
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 self._prgLauncher = self.getProgramLauncherInstance()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30 def getSpecificHelpAsString( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
32 Return the specific help as a string.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33 """
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34 string = ""
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35 string += "\nspecific options:"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36 string += "\n -p: parameters for 'mafft' (default='--auto')"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
37 return string
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40 def getProgramParameters( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 return self._prgLauncher.getProgramParameters()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
42
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
43
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
44 def getProgramLauncherInstance( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
45 if self._prgLauncher == None:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
46 self._prgLauncher = MafftProgramLauncher()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
47 self._prgLauncher.setInputFile( GENERIC_IN_FILE )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
48 self._prgLauncher.setOutputFile( "%s.fa_aln" % ( GENERIC_IN_FILE ) )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
49 self._prgLauncher.setClean()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
50 self._prgLauncher.setVerbosityLevel( 1 )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
51 self._prgLauncher.setListFilesToKeep()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
52 self._prgLauncher.setListFilesToRemove()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
53 return self._prgLauncher
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
54
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
55
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
56 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
57 i = MafftClusterLauncher()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
58 i.setAttributesFromCmdLine()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
59 i.run()