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

Module bamParser

source code


Author: Michael Imelfort

Copyright: Copyright 2014

License: LGPLv3

Classes [hide private]
  BamParser
class for generating coverage profiles and linking read information from several BAM files
Functions [hide private]
 
externalParseWrapper(bAMpARSER, parseQueue, BFI_list, verbose, doContigNames)
Single-process BAMfile parsing
source code
 
pythonizeLinks(BFI, bamFile)
Unpeel the links-associated C structs and return a python dictionary of LinkPair instances
source code
Variables [hide private]
  __credits__ = ['Michael Imelfort']
  __maintainer__ = 'Michael Imelfort'
  __email__ = 'mike@mikeimelfort.com'
  __package__ = 'bamm'
Function Details [hide private]

externalParseWrapper(bAMpARSER, parseQueue, BFI_list, verbose, doContigNames)

source code 
Single-process BAMfile parsing

cTypes pointers are unpickleable unless they are top level, so this function
lives outside the class. In this case we reduce the number of member
variables passed to it by passing the class instead. Any implicit copy
operations do not affect the workflow as it stands now. If you modify this
function you need to be aware of the limitations of python multiprocessing,
Queues, pickling and shared memory.

Extra logic is also contained in BamParser._parseOneBam

Inputs:
 bAMpARSER - BamParser instance, a valid BamParser instance
 parseQueue - Manager.Queue, bids (BAMs) yet to be parsed
 BFI_list - Manager.List, place all processed BFIs on this list
 verbose - == True -> be verbose
 doContigNames - == True -> load contigs names from the C-land BFI struct

pythonizeLinks(BFI, bamFile)

source code 
Unpeel the links-associated C structs and return a python dictionary
of LinkPair instances

Inputs:
 BFI - BM_fileInfo_C, C-land BamFileInfo struct
 bamFile - uid of the bamFile associated with the BFI

Outputs:
 A python dictionary of LinkPair instances