Skip to main content

data.read_features_from_disk

data.read_features_from_disk(
    path_features,
    brain_atlas=None,
    mappings=None,
    strict=True,
    load_denoised=True,
)

Read electrophysiology features from disk and merge with channel information.

This function loads raw electrophysiology features, channel information, and channel labels from parquet files, merges them into a single dataframe, and adds brain region mapping information using the provided brain atlas.

Args: path_features (Path): Path to the directory containing the feature parquet files. brain_atlas (iblatlas.atlas.BrainAtlas, optional): Brain atlas object used to map coordinates to brain regions. Must be provided to enable region mapping. mappings (list, optional): List of brain region mapping ontologies to include. Default is [‘Cosmos’, ‘Beryl’]. strict (bool, optional): Whether to raise an error on panderas validation. The schema is picked from the columns present: ModelDenoisedFeatures for a table that has been through remap_waveform_shape_features, ModelRawFeatures otherwise. Default is True. load_denoised (bool, optional): Whether to return the denoised or raw features. Default is True.

Returns: pd.DataFrame: DataFrame containing merged electrophysiology features with channel information and brain region mappings. Legacy column names are renamed to the current ones (see LEGACY_FEATURE_RENAMES).

Raises: AssertionError: If brain atlas is not provided or if unknown mappings are specified.