| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
ReadSetManager
The principle manager of a collection of ReadSet objects
Determines the exact names of the output files when extracting reads. Ensures that only one thread can write to one file at a time.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Default constructor.
Initializes a ReadSet instance with the provided set of properties.
Inputs:
manager - multiprocessing.Manager() instance owned by the
BamExtractor use this to make all Queues.
Outputs:
None
|
Stop all the threads from running Also stops any looping processes in the ReadSets Inputs: None Outputs: None |
Set response queues used to pass ReadSets to the extract threads
Inputs:
queues - dict { outPrefix : mp.Manager().Queue() }, one for each
thread that's parsing BAM files for the BAmExtractor
Outputs:
None
|
Set the print queue for communcating upwards Inputs: queue - mp.Manager().Queue(), print queue managed by the BamExtractor Outputs: None |
Ensure that only one thread at a time has access to a read set
Inputs:
bid - int, the unique identifier for a BAM file
gid - int, the unique identifier for a target group
rpi - enum, describes the type of read (RPI.FIR etc.)
threadId - string, identifies the thread that is requesting
the resource.
Outputs:
The requested read set or None if it is not available
|
Indicate that a thread is finished with a read set
Inputs:
bid - int, the unique identifier for a BAM file
gid - int, the unique identifier for a target group
rpi - enum, describes the type of read (RPI.FIR etc.)
threadId - string, identifies the thread that is freeing
the resource.
Outputs:
None
Raises:
InvalidParameterSetException - if the supplied information
doesn't make sense
|
Manage requests by parsing threads to access ReadSets This process runs on it's own thread and continues until it discovers a None on the requestQueue or self._threadsAreValid is set to False Inputs: None Outputs: None |
Determine all the outFile prefixes needed for extraction.
The RSM manages a collection of output file objects called ReadSets
These are made here and placed into hashes for retrieval later. This
function also populates instance variables self.fnPrefix2ReadSet and
self.outFiles; the two main ways that ReadSets can be accessed.
File names vary wildly depending on the values of flags such as:
mixGroups, mixBams etc. Take care when modifying this code.
Inputs:
prettyBamFileNames - [ string ] simple versions of the BAM filenames
groupNames - [ string ] identify contig groups. EX: [bin1, bin2]
zipped - bool, True if the output should be zipped
interleaved - bool, True if the output should be interleaved
mixBams - bool, True if BAM file origin should be ignored
mixGroups - bool, True if group origin should be ignored
mixReads - bool, True if (un)paired distinction should be ignored
headersOnly - bool, True if only headers should be printed
outFolder - string, folder to write output to
prefix - string, prefix to apply to all output files
Outputs:
of_prefixes - { bamId : { groupId : { rpi : outFile prefix } } },
this hash can be used to get the file name prefix for a
read set based on BAM file origin, group origin and
pairing information.
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Feb 17 15:54:06 2015 | http://epydoc.sourceforge.net |