Package Bio :: Package NeuralNetwork :: Package Gene :: Module Pattern :: Class PatternIO
[hide private]
[frames] | no frames]

Class PatternIO

source code

object --+
         |
        PatternIO

Allow reading and writing of patterns to files.

This just defines a simple persistance class for patterns, making it easy to write them to a file and read 'em back.

Instance Methods [hide private]
 
__init__(self, alphabet=None)
Intialize the reader and writer class.
source code
 
write(self, pattern_list, output_handle)
Write a list of patterns to the given handle.
source code
 
write_seq(self, seq_pattern_list, output_handle)
Convenience function to write Seq objects to a file.
source code
 
read(self, input_handle)
Read patterns from the specified handle.
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, alphabet=None)
(Constructor)

source code 

Intialize the reader and writer class.

Arguments:

o alphabet - An optional argument specifying the alphabet which patterns should follow. If an alphabet is set it'll be used to verify that all patterns follow it.

Attributes: o separator - A character to use in separating items in a signature when it is written to a file and read back. This character should not be in the possible alphabet of the sequences, or there will be trouble.

Overrides: object.__init__

write_seq(self, seq_pattern_list, output_handle)

source code 

Convenience function to write Seq objects to a file.

This can take Seqs and MutableSeqs, and write them to a file as strings.