biomol.core.FeatureContainer#

class FeatureContainer(features)[source]#

Bases: object

Container for holding either node or edge features.

Parameters:

features (Mapping[str, Feature]) – A mapping of feature keys to Feature objects. Features can be either NodeFeature or EdgeFeature.

Notes

features must contain at least one NodeFeature. All NodeFeatures must have the same length.

Methods

concat

Concatenate multiple FeatureContainer instances.

copy

Create a deep copy of the FeatureContainer.

crop

Crop all features to only include the specified indices.

from_dict

Create a FeatureContainer from a dictionary.

keys

List of all features keys in the container.

remove

Remove features by their keys.

to_dict

Convert the container to a dictionary.

update

Update the container with new or modified features.