skbio.metadata.IntervalMetadata.query#
- IntervalMetadata.query(bounds=None, metadata=None)[source]#
Yield
Interval
object with the bounds and attributes.The
Interval
objects must meet both requirements: 1) overlap with any of the spans specified bybounds
; 2) satisfymetadata
specification. For instance, you can identify all the recA genes that overlap with (10, 100) or (900, 1000) with this codeinterval_metadata.query([(10, 100), (900, 1000)], {'gene': 'recA'})
.- Parameters:
- boundsiterable 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 allIntervals
meet this requirement.- metadatadict, 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 allIntervals
meet this requirement.
- Yields:
- Interval
Interval
object satisfying the search criteria.