Package csb :: Package bio :: Package io :: Module clans

[frames] | no frames]

# Module clans

source code

Classes for parsing/manipulating/writing CLANS (by Tancred Frickey) files

This module defines ClansParser and ClansFileWriter for parsing and writing CLANS format files, respectively. Further, class Clans and several helper classes are used to hold and handle the parsed data.

The most commenly used CLANS data can be accessed in an Clans instance via

- .entries <ClansEntryCollection containing ClansEntry instances>
  - .name
  - .seq <the amino acid sequence>
  - .hsps <connections of this ClansEntry to others>
  - .groups <ClansSeqgroups the entry belongs to>
- .seqgroups <ClansSeqgroupCollection containing ClansSeqgroup instances>
- .params <ClansParams>

Parse a file into Clans instance `clans_instance` by

    >>> clans_instance = ClansParser().parse_file('input.clans')

Create a new entry `e` with name "`my entry`", sequence `AAAA` and coordinates `(x=1, y=1, z=1)`

    >>> e = ClansEntry(name='my entry', seq='AAAA', coords=(1, 1, 1))

and add it to an existing Clans instance `clans_instance`

    >>> clans_instance.add_entry(e)

Entries can be accessed using indices of `Clans` instances

    >>> clans_instance[0]  # access to first entry

and deleted by

    >>> clans_instance.remove_entry(e)

Equivalent functions exist for ClansSeqgroups.

Author: Klaus Kopec MPI fuer Entwicklungsbiologie, Tuebingen

Classes
| Clans Class for holding and manipulating data from one CLANS file.
| ClansEntry Class holding the data of one CLANS sequence entry.
| ClansEntryCollection Read-only container for holding (and internally managing) ClansEntry instances.
| ClansFileBuilder Base abstract files for building a file in CLANS format.
| ClansFileWriter Class for serializing a Clans instance to a file in CLANS format.
| ClansParams Class for handling Clans parameters.
| ClansParser CLANS file format aware parser.
| ClansSeqgroup Class holding the data of one CLANS group (seqgroup).
| ClansSeqgroupCollection Read-only container for holding (and internally managing) ClansSeqgroup instances.
| Color RGB color handling class.
| DuplicateEntryError Raised during Clans._update_index if two entries are identical in name, sequence, and coordinates.
| DuplicateEntryNameError Raised during Clans.get_entry if two entries have identical names.
| MissingBlockError Raised if an expected tag is not found during parsing of a CLANS file.
| UnknownTagError Raised if an unknown tag is encountered while parsing a CLANS file.

Variables
| __package__ = ``'``csb.bio.io``'``