Package csb :: Package bio :: Package structure :: Class SecondaryStructure |
[frames] | no frames]

# Class SecondaryStructure

source code

                  object --+
                           |
        core.AbstractIndexer --+
                               |
    core.BaseCollectionContainer --+
                                   |
            core.CollectionContainer --+
                                       |
                                      SecondaryStructure

Describes the secondary structure of a chain. Provides an index-based access to the secondary structure elements of the chain.

Instance Methods
__init__(self, string=None, conf_string=None) x.__init__(...) initializes x; see help(type(x)) for signature | source code
__str__(self) str(x) | source code
int |
append(self, element) Add a new SecondaryStructureElement. | source code
tuple of SecondaryStructureElements |
at(self, rank, type=None) Returns: all secondary structure elements covering the specifid position | source code
clone(self) Returns: a deep copy of the object | source code
float |
q3(self, reference, relaxed=True) Compute Q3 score. | source code
tuple of SecondaryStructureElements |
scan(self, start, end, filter=None, loose=True, cut=True) Get all secondary structure elements within the specified [start, end] region. | source code
SecondaryStructure |
subregion(self, start, end) Same as `ss.scan(...cut=True)`, but also shift the start-end positions of all motifs and return a SecondaryStructure instance instead of a list. | source code
str |
to_string(self, chain_length=None) Get back the string representation of the secondary structure. | source code
to_three_state(self) Convert to three-state secondary structure (Helix, Strand, Coil). | source code
Inherited from `core.BaseCollectionContainer`: `__bool__`, `__contains__`, `__getitem__`, `__iter__`, `__len__`, `__nonzero__`, `__repr__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Static Methods
list |
parse(string, conf_string=None) Parse secondary structure from DSSP/PSI-PRED output string. | source code

Properties
int | end End position of the rightmost element
int | start Start position of the leftmost element
Inherited from `core.BaseCollectionContainer`: `last_index`, `length`, `start_index` Inherited from `object`: `__class__`

Method Details

### __init__(self, string=None, conf_string=None) (Constructor) | source code
x.__init__(...) initializes x; see help(type(x)) for signature Parameters: `string` (str) - a secondary structure string (e.g. a PSI-PRED output) `conf_string` (str) - secondary structure prediction confidence values, if available Overrides: object.__init__ (inherited documentation)

### __str__(self) (Informal representation operator) | source code
str(x) Overrides: object.__str__ (inherited documentation)

### append(self, element) | source code
Add a new SecondaryStructureElement. Then sort all elements by their start position. Parameters: `item` - the new item to append Returns: int the index of the new element Raises: `TypeError` - when the container is type-safe and item has an incorrect type Overrides: core.CollectionContainer.append

### at(self, rank, type=None) | source code
Returns: tuple of SecondaryStructureElements all secondary structure elements covering the specifid position

### clone(self) | source code
Returns: a deep copy of the object

### parse(string, conf_string=None) Static Method | source code
Parse secondary structure from DSSP/PSI-PRED output string. Parameters: `string` (str) - a secondary structure string (e.g. a PSI-PRED output) `conf_string` (str) - secondary structure prediction confidence values, if available Returns: list a list of SecondaryStructureElements. Raises: `ValueError` - if the confidence string is not of the same length

### q3(self, reference, relaxed=True) | source code
Compute Q3 score. Parameters: `reference` (SecondaryStructure) - reference secondary structure `relaxed` (bool) - if True, treat gaps as coils Returns: float the percentage of `reference` residues with identical 3-state secondary structure.

### scan(self, start, end, filter=None, loose=True, cut=True) | source code
Get all secondary structure elements within the specified [start, end] region. Parameters: `start` (int) - the start position of the region, 1-based, inclusive `end` (int) - the end position of the region, 1-based, inclusive `filter` (csb.core.EnumItem) - return only elements of the specified SecStructures kind `loose` (bool) - grab all fully or partially matching elements within the region. if False, return only the elements which strictly reside within the region `cut` (bool) - if an element is partially overlapping with the start..end region, cut its start and/or end to make it fit into the region. If False, return the elements with their real lengths Returns: tuple of SecondaryStructureElements a list of deep-copied SecondaryStructureElements, sorted by their start position

### subregion(self, start, end) | source code
Same as `ss.scan(...cut=True)`, but also shift the start-end positions of all motifs and return a SecondaryStructure instance instead of a list. Parameters: `start` (int) - start position of the subregion, with reference to the chain `end` (int) - start position of the subregion, with reference to the chain Returns: SecondaryStructure a deep-copy sub-fragment of the original SecondaryStructure

### to_string(self, chain_length=None) | source code
Get back the string representation of the secondary structure. Returns: str a string of secondary structure elements Bug: [CSB 0000003] If conflicting elements are found at a given rank, this position is represented as a coil.

Property Details

### end End position of the rightmost element Get Method: unreachable.end(self) - End position of the rightmost element Type: int

### start Start position of the leftmost element Get Method: unreachable.start(self) - Start position of the leftmost element Type: int