From 175f421f30e69f6d98f5f0c2f6bfa06c74c22ee1 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 9 Apr 2024 21:42:16 +0000 Subject: [PATCH] finish addressing #228 --- gffutils/biopython_integration.py | 4 ++-- gffutils/test/test_biopython_integration.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gffutils/biopython_integration.py b/gffutils/biopython_integration.py index e6a80ab..f9a494f 100644 --- a/gffutils/biopython_integration.py +++ b/gffutils/biopython_integration.py @@ -72,8 +72,8 @@ def from_seqfeature(s, **kwargs): # BioPython parses 1-based GenBank positions into 0-based for use within # Python. We need to convert back to 1-based GFF format here. - start = s.location.start.position + 1 - stop = s.location.end.position + start = s.location.start + 1 + stop = s.location.end featuretype = s.type id = s.id attributes = dict(s.qualifiers) diff --git a/gffutils/test/test_biopython_integration.py b/gffutils/test/test_biopython_integration.py index c0d4f2a..58c5866 100644 --- a/gffutils/test/test_biopython_integration.py +++ b/gffutils/test/test_biopython_integration.py @@ -13,8 +13,8 @@ def test_roundtrip(): feature.keep_order = True dialect = feature.dialect s = bp.to_seqfeature(feature) - assert s.location.start.position == feature.start - 1 - assert s.location.end.position == feature.stop + assert s.location.start == feature.start - 1 + assert s.location.end == feature.stop assert s.id == feature.id f = bp.from_seqfeature(s, dialect=dialect, keep_order=True) assert feature == f