Package bamm :: Module bamExtractor
[hide private]
[frames] | no frames]

Module bamExtractor

source code


Author: Michael Imelfort

Copyright: Copyright 2014

License: LGPLv3

Classes [hide private]
  BamExtractor
Class used to manage extracting reads from multiple BAM files
Functions [hide private]
 
externalExtractWrapper(threadId, outFilePrefixes, bamPaths, prettyBamFileNames, numGroups, perContigGroups, contigs, printQueue, extractQueue, requestQueue, freeQueue, responseQueue, headersOnly, mixGroups, minMapQual, maxMisMatches, ignoreSuppAlignments, ignoreSecondaryAlignments, verbose=False)
Single-process BAMfile read extraction.
source code
Variables [hide private]
  __credits__ = ['Michael Imelfort']
  __maintainer__ = 'Michael Imelfort'
  __email__ = 'mike@mikeimelfort.com'
  __package__ = 'bamm'
Function Details [hide private]

externalExtractWrapper(threadId, outFilePrefixes, bamPaths, prettyBamFileNames, numGroups, perContigGroups, contigs, printQueue, extractQueue, requestQueue, freeQueue, responseQueue, headersOnly, mixGroups, minMapQual, maxMisMatches, ignoreSuppAlignments, ignoreSecondaryAlignments, verbose=False)

source code 
Single-process BAMfile read extraction.

cTypes pointers are unpickleable unless they are top level, so this function
lives outside the class and has 1,000,000 member variables passed to it.
Life would be easier if we could pass the class but any implicit copy
operations that follow are somewhat difficult to detect and can cause WOE.
Lot's of WOE, believe me...

Inputs:
 threadId - string, a unique Id for this process / thread
 outFilePrefixes - 3D dict for finding outFilePrefixes based on bamFile,
                   group and pairing information
 bamPaths - { bid : string }, full paths to the BAM files
 prettyBamFileNames - { bid : string }, short, print-friendly BAM names
 numGroups - int, the number of groups reads are split into
 perContigGroups - [int], contains groups Ids, insync with contigs array
 contigs - [string], contig ids as written in the BAM
 printQueue - Manager.Queue, thread-safe communication with users
 extractQueue - Manager.Queue, bids (BAMs) yet to be extracted from
 requestQueue - Manager.Queue, make requests for ReadSets for printing
 freeQueue - Manager.Queue, tell the RSM when finished with a ReadSet
 responseQueue - Manager.Queue, recieve copies of ReadSets from the RSM
 headersOnly - == True -> write read headers only
 mixGroups - == True -> use one file for all groups
 minMapQual - int, skip all reads with a lower mapping quality score
 maxMisMatches - int, skip all reads with more mismatches (NM aux files)
 useSuppAlignments - == True -> skip supplementary alignments
 useSecondaryAlignments - == True -> skip secondary alignments
 verbose - == True -> be verbose

Outputs:
 None