Package biana :: Package utilities :: Module FormattedFileProcessor :: Class FormattedFileProcessor
[hide private]
[frames] | no frames]

Class FormattedFileProcessor

source code


Wrapper around reading/processing various formatted input streams

Instance Methods [hide private]
 
__init__(self, input_file_name, input_type)
Initialize an object of this class storing input_file_name: file name to be read/processed input_type: could be sif, tsv, fasta, etc..
source code
 
read(self, fields_to_include=None)
Read the file into a dictionary and return cloumns names and value dictionary
source code
 
process(self, out_method, fields_to_include)
Read and process an input file line by line.
source code

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

Class Variables [hide private]
  allowed_formats = Set(['tsv', 'fasta', 'sif'])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, input_file_name, input_type)
(Constructor)

source code 

Initialize an object of this class storing input_file_name: file name to be read/processed input_type: could be sif, tsv, fasta, etc..

Overrides: object.__init__

process(self, out_method, fields_to_include)

source code 

Read and process an input file line by line. If out_method is None a dictionary storing read lines are returned. out_method: method to output columns in current line on the fly in the input_type format fields_to_include: columns that would be included in the dictionary or processed with the function