Package Bio :: Package Graphics :: Package GenomeDiagram :: Module _FeatureSet :: Class FeatureSet
[hide private]
[frames] | no frames]

Class FeatureSet

source code

object --+
         |
        FeatureSet

FeatureSet

Provides:

Methods:

o __init__(self, set_id=None, name=None) Called on instantiation

o add_feature(self, feature, color=colors.lightgreen)  Add a Feature
                object to the set

o del_feature(self, feature_id) Remove a feature from the set, by id

o set_all_features(self, attr, value)   Set the passed attribute to the
                passed value in all features in the set

o get_features(self)    Returns a list of Features from the set

o get_ids(self)     Returns a list of unique ids for features in the set

o range(self)       Returns the range of bases covered by features in
                    the set

o to_string(self, verbose=0)    Returns a string describing the set

o __len__(self)     Returns the length of sequence covered by the set

o __getitem__(self, key)    Returns a feature from the set, keyed by id

o __str__(self)     Returns a string describing the set

Attributes:

o id    Unique id for the set

o name  String describing the set

Instance Methods [hide private]
 
__init__(self, set_id=None, name=None)
o set_id Unique id for the set
source code
 
add_feature(self, feature, **args)
o feature Bio.SeqFeature object
source code
 
del_feature(self, feature_id)
o feature_id Unique id of the feature to delete
source code
 
set_all_features(self, attr, value)
o attr An attribute of the Feature class
source code
[Feature, Feature, ...]

get_features(self, attribute=None, value=None, comparator=None)
o attribute String, attribute of a Feature object
source code
[int, int, ...]

get_ids(self)
Return a list of all ids for the feature set
source code
 
range(self)
Returns the lowest and highest base (or mark) numbers as a tuple
source code
""

to_string(self, verbose=0)
o verbose Boolean indicating whether a short or complete account of the set is required
source code
int

__len__(self)
Return the number of features in the set
source code
Feature

__getitem__(self, key)
Return a feature, keyed by id
source code
""

__str__(self)
Returns a formatted string with information about the feature set
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, set_id=None, name=None)
(Constructor)

source code 
o set_id    Unique id for the set

o name      String identifying the feature set

Overrides: object.__init__

add_feature(self, feature, **args)

source code 
o feature       Bio.SeqFeature object

o **kwargs      Keyword arguments for Feature.  Named attributes
                of the Feature

Add a Bio.SeqFeature object to the diagram (will be stored
internally in a Feature wrapper

del_feature(self, feature_id)

source code 
o feature_id        Unique id of the feature to delete

Remove a feature from the set, indicated by its id

set_all_features(self, attr, value)

source code 
o attr      An attribute of the Feature class

o value     The value to set that attribute

Set the passed attribute of all features in the set to the
passed value

get_features(self, attribute=None, value=None, comparator=None)

source code 
o attribute        String, attribute of a Feature object

o value            The value desired of the attribute

o comparator       String, how to compare the Feature attribute to the
                   passed value

If no attribute or value is given, return a list of all features in the
feature set.  If both an attribute and value are given, then depending
on the comparator, then a list of all features in the FeatureSet
matching (or not) the passed value will be returned.  Allowed comparators
are: 'startswith', 'not', 'like'.

The user is expected to make a responsible decision about which feature
attributes to use with which passed values and comparator settings.

Returns:
[Feature, Feature, ...]

to_string(self, verbose=0)

source code 
o verbose       Boolean indicating whether a short or complete
                account of the set is required

Returns a formatted string with information about the set

Returns:
""

__str__(self)
(Informal representation operator)

source code 
Returns a formatted string with information about the feature set

Returns:
""

Overrides: object.__str__