SecondaryStructureViewer

class visualife.widget.SecondaryStructureViewer(element_id, sequence_name='', ss_string='', **kwargs)

Bases: visualife.widget.SequenceViewer

Creates a widget that displays a protein secondary structure

Example of the widget is given below:

It has been created by the following code:

from visualife.widget import SecondaryStructureViewer

seq = SecondaryStructureViewer("show_secondary","4fia A","CCHHHHHHHHHHHHHHCEEEEEECCEEEEEECHHHHHHHHHHCCCCCCHHHHHHHHHEECCEECCCCCCCCCCHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCCCCCCEEHHHHHHHHHHHHHHHHHHHCCCCCCCCCHHHHHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCCCCCHHHHHHHHHHCCCCCHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCHHHHHHHHHHHHHHHHHCCCCCHHHHHHHHHHHHHHHHHHHHHHCCCCEEEEEECCCEEECCEEECCCEEEEEEHHHHHHCCCCCCCCCCCHHHHHHCCCCCCCCCCCCCCHHHHHCCHHHHHHHHHHHHHHHHHHHEEEEECCCCCCCEEECCCEEECCCCEEEEEEC")
seq.add_to_region("sel1", first_pos=40, last_pos=80)
seq.region_tooltip("sel1","first region")

:param element_id: ID of a html DIV element that will contain this SecondaryStructureViewer instance
:param sequence_name: name of the secondary structure to be shown
:param sequence: the secondary structure itself (one-letter string, HEC-code)
:param kwargs: only parsed by the base class constructor

Methods Summary

detect_blocks([which_seq, allowed_characters]) Detects secondary structure blocks (segments)

Methods Documentation

detect_blocks(which_seq=0, allowed_characters=['H', 'E', 'C', 'L'])

Detects secondary structure blocks (segments)

Returns three lists, that contain helices, strands and loops (H, E and C elements) :param allowed_characters: defines what to be detected, e.g. ['H','E'] detects only helices and strands (E for extended)

Parameters:
  • which_seq – (int) index of the sequence where secondary structure blocks will be detected (from 1!)
  • allowed_characters – characters that denote a secondary structure element
Returns:

three list of SSEs: for H, E and C, respectively. Each list of SSEs comprises (from, to) two-tuple of integer indexes to define an SSE location in the given secondary structure string