Package bamm :: Module bamRead :: Class ReadSet
[hide private]
[frames] | no frames]

Class ReadSet

source code

object --+
         |
        ReadSet

Container class to encapsulate the concept of a(n un)paired read set

This class manages file properties and writing functionality.

Instance Methods [hide private]
 
__init__(self, groupNames, outPrefix1, outPrefix2=None, paired=False, zipped=True, headersOnly=False)
Default constructor.
source code
 
getConstFP(self, fNumber=1)
return the unchanging filename prefix associated with this ReadSet
source code
 
determineFileSuffix(self, isFastq)
Determine the suffix of the file depending on if we're writing fasta or fastq
source code
 
writeChain(self, pBMM, isFastq, printQueue=None)
Write a single print chain to disk
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, groupNames, outPrefix1, outPrefix2=None, paired=False, zipped=True, headersOnly=False)
(Constructor)

source code 
Default constructor.

Initializes a ReadSet instance with the provided set of properties.

Inputs:
 groupNames - [ string ], target names, one for each target group.
 outPrefix1 - string prefix of the first output file (read1).
 outPrefix2 - string prefix of the second output file or None for
              interleaved or unpaired files.
 isPaired - bool, True if the file is a paired read file.
 zipped - bool, True if the data should be compressed for writing.
 headersOnly - bool, True if only headers should be printed.

Overrides: object.__init__

getConstFP(self, fNumber=1)

source code 
return the unchanging filename prefix associated with this ReadSet

Inputs:
 fNumber - which file prefix is needed? [1 or 2]
Outputs:
 The corresponding prefix

determineFileSuffix(self, isFastq)

source code 
Determine the suffix of the file depending on if we're writing
fasta or fastq

Inputs:
 isFastq - bool, is the file fastq (or fasta)
Outputs:
 Filenames to be written to.
 (fileName1, fileName2)
 fileName2 will be None for unpaired or interleaved-paired files

writeChain(self, pBMM, isFastq, printQueue=None)

source code 
Write a single print chain to disk

A print chain is a linked list of mapped reads that have been
pre-ordered and are ready to write (or print). The print chain can
contain either Fasta or Fastq reads but never both. File names are
determined on the fly based on the presence or absence of quality info
of the first read in the chain (determined by the BamExtractor) and
passed to this function as isFastq.

NOTE: This function does NOT free any memory associated with pBMM.

Inputs:
 pBMM - c.POINTER(BM_mappedRead_C), the start of a linked list of
        mapped reads, pre-ordered for printing by the BamExtractor
 isFastq - bool, True if reads have quality information.
 printQueue - Managed by the BamExtractor. Place all printing strings
              here. Acts as a verbose flag.
Outputs:
 None