Package csb :: Package bio :: Package io :: Module clans :: Class ClansFileWriter

[frames] | no frames]

# Class ClansFileWriter

source code

          object --+
                   |
    ClansFileBuilder --+
                       |
                      ClansFileWriter

Class for serializing a Clans instance to a file in CLANS format.

Nested Classes
Inherited from `ClansFileBuilder`: `__metaclass__`

Instance Methods

__init__(self, output) x.__init__(...) initializes x; see help(type(x)) for signature | source code

add_hsp_block(self, clans_instance) Appends a <hsp>data</hsp> CLANS file block to the output. | source code

add_param_block(self, clans_instance) Appends a <param>data</param> CLANS file block to the output. | source code

add_pos_block(self, clans_instance) Appends a <pos>data</pos> CLANS file block to the output. | source code

add_rotmtx_block(self, clans_instance) Appends a <rotmtx>data</rotmtx> CLANS file block to the output. | source code

add_seq_block(self, clans_instance) Appends a <seq>data</seq> CLANS file block to the output. | source code

add_seqgroups_block(self, clans_instance) Appends a <seqgroupsparam>data</seqgroups> CLANS file block to the output. | source code

add_sequences_line(self, clans_instance) Appends the 'sequences=<#sequences>' line to the output. | source code

serialize(self, clans_instance) Creates a CLANS file containing all data from `clans_instance` | source code

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

Class Variables
| __abstractmethods__ = ``frozenset([``])``

Properties
Inherited from `ClansFileBuilder`: `output` Inherited from `object`: `__class__`

Method Details

### __init__(self, output)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `output` (stream) - the output stream
Overrides: object.__init__
  (inherited documentation)

### add_hsp_block(self, clans_instance)

source code

Appends a <hsp>data</hsp> CLANS file block to the output. If the CLANS instance has hsp_att_mode=="att" we add a <att>data<att> block which has the same format.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Overrides: ClansFileBuilder.add_hsp_block

### add_param_block(self, clans_instance)

source code

Appends a <param>data</param> CLANS file block to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Overrides: ClansFileBuilder.add_param_block

### add_pos_block(self, clans_instance)

source code

Appends a <pos>data</pos> CLANS file block to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Overrides: ClansFileBuilder.add_pos_block

### add_rotmtx_block(self, clans_instance)

source code

Appends a <rotmtx>data</rotmtx> CLANS file block to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Raises:
  - `ValueError` - if self.clans_instance.rotmtx is no 3x3 numpy.array
Overrides: ClansFileBuilder.add_rotmtx_block

### add_seq_block(self, clans_instance)

source code

Appends a <seq>data</seq> CLANS file block to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Overrides: ClansFileBuilder.add_seq_block

### add_seqgroups_block(self, clans_instance)

source code

Appends a <seqgroupsparam>data</seqgroups> CLANS file block to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized
Overrides: ClansFileBuilder.add_seqgroups_block

### add_sequences_line(self, clans_instance)

source code

Appends the 'sequences=<#sequences>' line to the output.

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized

### serialize(self, clans_instance)

source code

Creates a CLANS file containing all data from `clans_instance`

Parameters:
  - `clans_instance` (a Clans instance) - the source of the data to be serialized