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

Class FeatureSet

source code

object --+
         |
        FeatureSet

FeatureSet object.
Instance Methods [hide private]
 
__init__(self, set_id=None, name=None, parent=None)
Create the object.
source code
 
add_feature(self, feature, **kwargs)
Add a new feature.
source code
 
del_feature(self, feature_id)
Delete a feature.
source code
 
set_all_features(self, attr, value)
Set an attribute of all the features.
source code
 
get_features(self, attribute=None, value=None, comparator=None)
Retreive features.
source code
 
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)
Returns a formatted string with information about the set
source code
 
__len__(self)
Return the number of features in the set.
source code
 
__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, parent=None)
(Constructor)

source code 

Create the object.

Arguments:
  • set_id: Unique id for the set
  • name: String identifying the feature set
Overrides: object.__init__

add_feature(self, feature, **kwargs)

source code 

Add a new feature.

Arguments:
  • feature: Bio.SeqFeature object
  • 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 

Delete a feature.

Arguments:
  • 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 

Set an attribute of all the features.

Arguments:
  • attr: An attribute of the Feature class
  • value: The value to set that attribute to

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 

Retreive features.

Arguments:
  • attribute: String, attribute of a Feature object
  • value: The value desired of the attribute
  • 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.

to_string(self, verbose=0)

source code 

Returns a formatted string with information about the set

Arguments:
  • verbose: Boolean indicating whether a short (default) or complete account of the set is required

__str__(self)
(Informal representation operator)

source code 
Returns a formatted string with information about the feature set.
Overrides: object.__str__