Skip to content
Snippets Groups Projects
sequence_viewer.rst 5.52 KiB

The Sequence Viewer

The sequence viewer of OpenStructure can be used to display sequences or alignments.

The following example adds an alignment to a sequence viewer and shows it in a new sequence viewer instance:

aln=io.LoadAlignment('sh2.aln')
v=gui.SequenceViewer()
v.AddAlignment(aln)
v.Show()

Core Features

Display styles

It is possible to display the data in different ways. To change the display style, click the tool icon of the menubar and select the display style from the list.

images/100615_select_display_style.png

For the moment there are four different display styles:

1. Highlight propteries

images/100615_property_type.png

Color groups of amino acids

grey orange yellow green red blue cyan
G F C S K D P
A Y M T R E  
V W     H N  
L         Q  
I            

2. Secondary structure

images/100615_secondary_structure.png

Display secondary structure information

This mode is only available, when a :class:`mol.EntityView` is connected to the sequence.

3. Highlight conservation 1

images/100615_conservation_1.png

Display conservation

This display style uses the :meth:`seq.alg.Conservation`-Algorithm which calculates the Conservation for each column. This Mode is only available for alignments.

4. Highlight conservation 2

images/100615_conservation_2.png

Display conservation

This implementation of conservation colors the columns grey, if all amino acids are from the same type. If all amino acids are from the same group, it colors the column with a light grey. Otherwise the column is colored white. This Mode is also only available for alignments.

Zoom

With the sequence viewer of Openstructure it is possible to zoom in and out <ctrl + mousewheel>.

images/100616_zoom_in.png

Zoom in, if you lost your glasses at home

images/100616_zoom_out.png

Zoom out, if you need a better overview of the sequence

Copy and Paste

It is possible to copy sequence text from the sequence viewer by pressing <ctrl + c>. If you paste the text (for example into a text editor), all the gaps will be filled with -.

images/100616_copy_paste.png

Search

With <ctrl + f> you can show or hide the search bar which help you finding parts of a sequence.

images/100617_search_bar.png

The SequenceViewer class represents a graphical sequence viewer. To see the sequences of a :class:`gfx.Entity`, you can use the :meth:`AddEntity` method. If you want to load an alignment, the :meth:`AddAlignment` method can be used.