Package bamm :: Module bamMaker :: Class BamScheduler
[hide private]
[frames] | no frames]

Class BamScheduler

source code

Class for scheduling making multiple BAM and TAM files

The class implements a somewhat parallel interface for running multiple BWA jobs. It is a little slack in that it sequentially calls BWA with BWA's threading flag. On larger systems this will probably be slower than running gnu parallel through a bash script. but if you can do that then you probably don't need this.

Instance Methods [hide private]
 
__init__(self, database, alignmentAlgorithm, indexAlgorithm, outFolder, paired=[], interleaved=[], singleEnded=[], keptFiles=False, keepFiles=False, outputTam=False, prefix='', numThreads=1, maxMemory=None, forceOverwriting=False, extraArguments='', showCommands=False, quiet=False, silent=False)
Default constructor.
source code
 
makeBams(self)
sequentially make the bam files
source code
 
stripFaCrud(self, fileName) source code
 
makeOutFileName(self, readsFile)
Consistent way to make output file name prefixes
source code
 
makeSurePathExists(self, path)
Make sure that a path exists, make it if necessary
source code
Method Details [hide private]

__init__(self, database, alignmentAlgorithm, indexAlgorithm, outFolder, paired=[], interleaved=[], singleEnded=[], keptFiles=False, keepFiles=False, outputTam=False, prefix='', numThreads=1, maxMemory=None, forceOverwriting=False, extraArguments='', showCommands=False, quiet=False, silent=False)
(Constructor)

source code 
Default constructor.

Initializes a BamScheduler instance with the provided set of properties.

Inputs:
 database - full path to fasta file of contigs (may be gzipped),
 alignmentAlgorithm - one of BWA's alignment algorithms,
 indexAlgorithm - one of BWA's index algorithms,
 paired - [fileName pairs], always even numbered in length, in order
          [R_A_1, R_A_2, R_B_1, R_B_2, ...]
 interleaved - [fileNames], containing interleaved paired reads
 singleEnded - [fileNames], containing single ended reads
 keptFiles - == True -> indexes for the db already exist,
 keepFiles - == True -> don't delete indexes at the end,
 outputTam - == True -> you love text files to bits,
 numThreads - int, the maximum number of threads to use
 maxMemory - string, maximum memory program will use (samtools style)
 forceOverwriting - == True -> force overwriting index files,
 extraArguments - string, extra args to pass to BWA
 showCommands - == True -> show all commands being run
 quiet - == True -> suppress output from the mapper
 silent - == True -> suppress all output

Outputs:
 None

makeBams(self)

source code 
sequentially make the bam files

Inputs:
 None

Outputs:
 None

makeOutFileName(self, readsFile)

source code 
Consistent way to make output file name prefixes

Inputs:
 readsFile - path-free read file name

Outputs:
 pretty prefix

makeSurePathExists(self, path)

source code 
Make sure that a path exists, make it if necessary

Inputs:
 path - string, full or relative path to create

Outputs:
 None