slice_by_interval

slice_by_interval#

TrackData.slice_by_interval(interval, match_resolution=False)[source]#

Slices the track data using a genome.Interval.

Parameters:
  • interval (Interval) – The interval to slice to.

  • match_resolution (bool (default: False)) – If True, the interval will first be extended to make sure the width is divisible by resolution.

Return type:

TrackData

Returns:

A new TrackData object sliced to the interval.

Raises:

ValueError – If .interval is not specified or if the specified interval is not fully contained within the current interval.