diff options
-rw-r--r-- | gn3/api/search.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py index 2038a14..3846aa7 100644 --- a/gn3/api/search.py +++ b/gn3/api/search.py @@ -174,7 +174,7 @@ def parse_location_field(species_query: xapian.Query, else: width = 50*10**3 point = apply_si_suffix(location_str) - location = Just(point - width), Just(point + width) + location = Just(max(0, point - width)), Just(point + width) return ChromosomalInterval(chromosome.removeprefix("chr"), *location) def make_query(interval: ChromosomalInterval) -> xapian.Query: |