1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
The Sequence Viewer
================================================================================
.. currentmodule:: ost.gui
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:
.. code-block:: python
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.
.. image:: images/100615_select_display_style.png
For the moment there are four different display styles:
**1. Highlight propteries**
.. image:: images/100615_property_type.png
:width: 500pt
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**
.. image:: images/100615_secondary_structure.png
:width: 500pt
Display secondary structure information
This mode is only available, when a :class:`mol.EntityView` is connected to
the sequence.
**3. Highlight conservation 1**
.. image:: images/100615_conservation_1.png
:width: 500pt
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**
.. image:: images/100615_conservation_2.png
:width: 500pt
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>`.
.. image:: images/100616_zoom_in.png
Zoom in, if you lost your glasses at home
.. image:: 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 `-`.
.. image:: 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.
.. image:: images/100617_search_bar.png
.. class:: SequenceViewer
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.
.. method:: AddEntity(entity)
Add :class:`gfx.Entity` to SequenceViewer.
:param entity: an entity instance
:type entity: :class:`gfx.Entity`
.. method:: RemoveEntity(entity)
Remove entity from sequence viewer.
:param entity: an entity instance
:type entity: :class:`gfx.Entity`
.. method:: AddAlignment(alignment)
Add :class:`seq.AlignmentHandle` to SequenceViewer.
:param alignment: an alignment instance
:type alignment: :class:`seq.AlignmentHandle`
.. method:: RemoveAlignment(alignment)
Remove alignment from sequence viewer.
:param alignment: an alignment instance
:type alignment: :class:`seq.AlignmentHandle`
:rtype: None
.. method:: ChangeDisplayMode(style [, obj : None])
Change the display style of all alignments and sequences to the given style. If the obj parameter is given, it
changes only the display style of the given object.
If the style is not known, nothing happens
See also :meth:`GetDisplayModes`, :meth:`GetCurrentDisplayMode`
:param style: The display style
:type style: :class:`string`
:param obj: The object you would like to change
:type obj: :class:`gfx.Entity`, :class:`seq.AlignmentHandle`
.. method:: GetCurrentDisplayMode([obj : None])
Returns the current display style. If there are objects with different display styles, " " will be returned
otherwise the string of the display style.
:rtype: str
:param obj: The object you would like to get the display style
:type obj: :class:`gfx.Entity`, :class:`seq.AlignmentHandle`
.. method:: GetDisplayModes([obj : None])
Returns a list with all available display styles. If you pass an object, you will get only the display styles for
the given object.
:rtype: StringList
:param obj: The object you would like to get all display styles
:type obj: :class:`gfx.Entity`, :class:`seq.AlignmentHandle`
.. method:: GetQObject()
Get the SIP-QObject (QWidget), learn more about :doc:`python_cpp`.
:rtype: QWidget
.. method:: Hide()
Hide the Widget
.. method:: Show()
Shows the Widget
|