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.
For the moment there are four different display styles:
1. Highlight propteries
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
Display secondary structure information
This mode is only available, when a mol.EntityView is connected to the sequence.
3. Highlight conservation 1
Display conservation
This display style uses the seq.alg.Conservation()-Algorithm which calculates the Conservation for each column. This Mode is only available for alignments.
4. Highlight conservation 2
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>.
Zoom in, if you lost your glasses at home
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 -.
Search¶
With <ctrl + f> you can show or hide the search bar which help you finding parts of a sequence.
- class SequenceViewer¶
The SequenceViewer class represents a graphical sequence viewer. To see the sequences of a gfx.Entity, you can use the AddEntity() method. If you want to load an alignment, the AddAlignment() method can be used.
- AddEntity(entity)¶
Add gfx.Entity to SequenceViewer.
Parameters: entity (gfx.Entity) – an entity instance
- RemoveEntity(entity)¶
Remove entity from sequence viewer.
Parameters: entity (gfx.Entity) – an entity instance
- AddAlignment(alignment)¶
Add seq.AlignmentHandle to SequenceViewer.
Parameters: alignment (seq.AlignmentHandle) – an alignment instance
- RemoveAlignment(alignment)¶
Remove alignment from sequence viewer.
Parameters: alignment (seq.AlignmentHandle) – an alignment instance Return type: None
- 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 GetDisplayModes(), GetCurrentDisplayMode()
Parameters:
- style (string) – The display style
- obj (gfx.Entity, seq.AlignmentHandle) – The object you would like to change
- 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.
Return type: str Parameters: obj (gfx.Entity, seq.AlignmentHandle) – The object you would like to get the display style
- 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.
Return type: StringList Parameters: obj (gfx.Entity, seq.AlignmentHandle) – The object you would like to get all display styles
- GetQObject()¶
Get the SIP-QObject (QWidget), learn more about Mixing PyQt and C++ Widgets.
Return type: PyQt4.QWidget
- Hide()¶
Hide the Widget
- Show()¶
Shows the Widget