slice_by_positions

slice_by_positions#

TrackData.slice_by_positions(start, end)[source]#

Slices the track data along the positional axes.

The slicing follows Python slicing conventions (0 indexed, and includes elements up to end-1).

Parameters:
  • start (int) – The 1-bp resolution start position for slicing.

  • end (int) – The 1-bp resolution end position for slicing.

Return type:

TrackData

Returns:

A new TrackData object with the sliced values.

Raises:

ValueError – If (end - start) is greater than the width, or if (end - start) is not divisible by the resolution.