IntervalMetadata.query(bounds=None, metadata=None)[source]

Yield Interval object with the bounds and attributes.

State: Experimental as of 0.5.1.

The Interval objects must meet both requirements: 1) overlap with any of the spans specified by bounds; 2) satisfy metadata specification. For instance, you can identify all the recA genes that overlap with (10, 100) or (900, 1000) with this code interval_metadata.query([(10, 100), (900, 1000)], {'gene': 'recA'}).

  • bounds (iterable of tuples of int pair, optional) – Specifies bounds to look for the Interval objects. An satisfying interval feature only need to overlap with one bound. Default (None) means all Intervals meet this requirement.
  • metadata (dict, optional) – A dictionary of key word attributes associated with the Interval object. It specifies what metadata keywords and values to look for. Default (None) means all Intervals meet this requirement.

IntervalInterval object satisfying the search criteria.