From 7b4d8d7aceadaa1fde05846e854e6eccdba38b77 Mon Sep 17 00:00:00 2001 From: Matt Shirley Date: Thu, 26 Oct 2017 11:44:26 -0400 Subject: [PATCH] Don't set coordinates for spliced sequence --- pyfaidx/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyfaidx/__init__.py b/pyfaidx/__init__.py index 6206dd9..9739e5c 100644 --- a/pyfaidx/__init__.py +++ b/pyfaidx/__init__.py @@ -891,8 +891,8 @@ def get_seq(self, name, start, end, rc=False): return seq def get_spliced_seq(self, name, intervals, rc=False): - """Return a sequence by record name and list of intervals - + """Return a sequence by record name and list of intervals + Interval list is an iterable of [start, end]. Coordinates are 1-based, end-exclusive. If rc is set, reverse complement will be returned. @@ -908,8 +908,10 @@ def get_spliced_seq(self, name, intervals, rc=False): else: seq = "".join([chunk.seq for chunk in chunks]) - return Sequence(name=name, seq=seq, start=start, end=end) - + # Sequence coordinate validation wont work since + # len(Sequence.seq) != end - start + return Sequence(name=name, seq=seq, start=None, end=None) + def close(self): self.__exit__()