From 8556eb8924af71c83384789e39185e86644f39fc Mon Sep 17 00:00:00 2001 From: clintval Date: Fri, 2 Aug 2024 06:24:25 -0400 Subject: [PATCH] docs: clarify sort order --- pybedlite/overlap_detector.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pybedlite/overlap_detector.py b/pybedlite/overlap_detector.py index e5fbff7..66a50f7 100644 --- a/pybedlite/overlap_detector.py +++ b/pybedlite/overlap_detector.py @@ -346,10 +346,10 @@ def get_overlaps(self, interval: Span) -> List[SpanType]: list if no overlaps exist. The intervals will be returned sorted using the following sort keys: - * The interval's start - * The interval's end - * The interval's strand (if defined) - * The interval's reference sequence name + * The interval's start (ascending) + * The interval's end (ascending) + * The interval's strand, positive or negative (assumed to be positive if undefined) + * The interval's reference sequence name (lexicographically) """ tree = self._refname_to_tree.get(interval.refname) if tree is None: @@ -392,10 +392,10 @@ def get_enclosing_intervals(self, interval: Span) -> List[SpanType]: The list of intervals in this detector that enclose the query interval. The intervals will be returned sorted using the following sort keys: - * The interval's start - * The interval's end - * The interval's strand (if defined) - * The interval's reference sequence name + * The interval's start (ascending) + * The interval's end (ascending) + * The interval's strand, positive or negative (assumed to be positive if undefined) + * The interval's reference sequence name (lexicographically) """ results = self.get_overlaps(interval) return [i for i in results if interval.start >= i.start and interval.end <= i.end] @@ -411,10 +411,10 @@ def get_enclosed(self, interval: Span) -> List[SpanType]: The list of intervals in this detector that are enclosed within the query interval. The intervals will be returned sorted using the following sort keys: - * The interval's start - * The interval's end - * The interval's strand (if defined) - * The interval's reference sequence name + * The interval's start (ascending) + * The interval's end (ascending) + * The interval's strand, positive or negative (assumed to be positive if undefined) + * The interval's reference sequence name (lexicographically) """ results = self.get_overlaps(interval) return [i for i in results if i.start >= interval.start and i.end <= interval.end]