alphagenome.data.track_data.concat#
- alphagenome.data.track_data.concat(track_datas, extra_metadata_name_and_keys=None)[source]#
Concatenates multiple
TrackDataobjects along the track dimension.This function combines multiple
TrackDataobjects into a single object by concatenating their values and metadata. The resultingTrackDataobject will have the same resolution and interval as the input objects.- Parameters:
track_datas (
Sequence[TrackData]) – A sequence ofTrackDataobjects to concatenate. All objects must have the same resolution, interval, and width.extra_metadata_name_and_keys (
Optional[tuple[str,Sequence[str|int|float]]] (default:None)) – An optional tuple specifying a new metadata column to add. The first element is the column name, and the second is a sequence of values to populate the column.
- Return type:
- Returns:
A new
TrackDataobject containing the concatenated data.- Raises:
ValueError – If the input
TrackDataobjects have different resolutions, intervals, or widths, or if the length ofextra_metadata_name_and_keys[1]does not match the length oftrack_datas.