Components & Features

The Component class is very similar to Bio.SeqRecord.SeqRecord, but does not currently sub-class it—mainly because the features property is implemented differently.

class co.Component(seq, parent=None, features=None, removed_features=None, feature_class=None, id=None, name=None, description=None, annotations=None, mutations=None)
features

FeatureSet containing the features present in this component.

id

A unique identifier for this component; preferably either str or UniqueIdentifier.

Parameters:
  • features – A list of additional features (features in addition to those inherited from parent)
  • removed_features – A list of removed features (features present in parent or one of its parents, but not present in this component)
  • mutations – A list of mutations that have been applied to parent to arrive at seq. The mutations will not be applied to seq again. Use Component.mutate() to mutate a component.

The Feature class inherits from Bio.SeqFeature.SeqFeature but stores some additional information. Proceed with caution when using the two types interchangeably.

class co.Feature(component, *args, **kwargs)

Feature derives from SeqFeature and binds to a particular Component. Feature does not support the sub_features argument. All other SeqFeature arguments are supported.

class co.FeatureSet(feature_class=None)

An ordered collection of SeqFeature objects.

Parameters:feature_class (type) – type of the features stored in the collection; defaults to SeqFeature and must inherit from it.
class co.ComponentFeatureSet(component, removed_features=None, feature_class=None)

An extended version of FeatureSet that binds to a Component and inherits from any FeatureSet in the parent of a component.

When iterating over this feature set, any inherited features are also returned.

removed_features

Removed features are stored in removed_features if they are present in the parent, but not in component.

component