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
2. Secondary structure
3. Highlight conservation 1
4. Highlight conservation 2
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