Package Bio :: Package Graphics :: Package GenomeDiagram :: Module _Feature :: Class Feature
[hide private]
[frames] | no frames]

Class Feature

source code

object --+
         |
        Feature

Class to wrap Bio.SeqFeature objects for GenomeDiagram

Provides:

Methods:

o __init__(self, parent=None, feature_id=None, feature=None,
         color=colors.lightgreen) Called when the feature is
         instantiated

o set_feature(self, feature) Wrap the passed feature

o get_feature(self) Return the unwrapped Bio.SeqFeature object

o set_color(self, color) Set the color in which the feature will
        be drawn (accepts multiple formats: reportlab color.Color()
        tuple and color.name, or integer representing Artemis color

o get_color(self) Returns color.Color tuple of the feature's color

o __getattr__(self, name) Catches attribute requests and passes them to
        the wrapped Bio.SeqFeature object

Attributes:

o parent    FeatureSet, container for the object

o id        Unique id

o color    color.Color, color to draw the feature

o hide      Boolean for whether the feature will be drawn or not

o sigil     String denoting the type of sigil to use for the feature.
            Currently either "BOX" or "ARROW" are supported.

o arrowhead_length  Float denoting length of the arrow head to be drawn,
                    relative to the bounding box height.  The arrow shaft
                    takes up the remainder of the bounding box's length.

o arrowshaft_height  Float denoting length of the representative arrow
                     shaft to be drawn, relative to the bounding box height.
                     The arrow head takes the full height of the bound box.

o name_qualifiers   List of Strings, describes the qualifiers that may
            contain feature names in the wrapped Bio.SeqFeature object

o label     Boolean, 1 if the label should be shown

o label_font    String describing the font to use for the feature label

o label_size    Int describing the feature label font size

o label_color  color.Color describing the feature label color

o label_angle   Float describing the angle through which to rotate the
            feature label in degrees (default = 45, linear only)

o label_position    String, 'start', 'end' or 'middle' denoting where
            to place the feature label. Leave as None for the default
            which is 'start' for linear diagrams, and at the bottom of
            the feature as drawn on circular diagrams.

o label_strand  Integer -1 or +1 to explicitly place the label on the
            forward or reverse strand. Default (None) follows th
            feature's strand. Use -1 to put labels under (linear) or
            inside (circular) the track, +1 to put them above (linear)
            or outside (circular) the track.

o locations     List of tuples of (start, end) ints describing where the
            feature and any subfeatures start and end

o type      String denoting the feature type

o name      String denoting the feature name

o strand    Int describing the strand on which the feature is found

Instance Methods [hide private]
 
__init__(self, parent=None, feature_id=None, feature=None, color=colors.lightgreen, label=0)
o parent FeatureSet containing the feature
source code
 
set_feature(self, feature)
o feature Bio.SeqFeature object to be wrapped
source code
 
__process_feature(self)
Examine the feature to be wrapped, and set some of the Feature's...
source code
Bio.SeqFeature

get_feature(self)
Returns the unwrapped Bio.SeqFeature object
source code
 
set_colour(self, colour)
Backwards compatible variant of set_color(self, color) using UK spelling.
source code
 
set_color(self, color)
o color The color to draw the feature - either a colors.Color object, an RGB tuple of floats, or an integer corresponding to colors in colors.txt
source code
various

__getattr__(self, name)
If the Feature class doesn't have the attribute called for,...
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None, feature_id=None, feature=None, color=colors.lightgreen, label=0)
(Constructor)

source code 
o parent    FeatureSet containing the feature

o feature_id    Unique id for the feature

o feature   Bio.SeqFeature object to be wrapped

o color    color.Color Color to draw the feature (overridden
           by backwards compatible argument with UK spelling,
           colour).  Either argument is overridden if 'color'
           is found in feature qualifiers

o border   color.Color Color to draw the feature border, use
           None for the same as the fill color, False for no border.

o label     Boolean, 1 if the label should be shown

Overrides: object.__init__

set_feature(self, feature)

source code 
o feature   Bio.SeqFeature object to be wrapped

Defines the Bio.SeqFeature object to be wrapped

__process_feature(self)

source code 
Examine the feature to be wrapped, and set some of the Feature's
properties accordingly

set_color(self, color)

source code 
o color    The color to draw the feature - either a colors.Color
           object, an RGB tuple of floats, or an integer
           corresponding to colors in colors.txt

Set the color in which the feature will be drawn

__getattr__(self, name)
(Qualification operator)

source code 
If the Feature class doesn't have the attribute called for,
check in self._feature for it

Returns:
various