Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use compound locations in GenomeDiagram, not sub_features

  • Loading branch information...
commit e89cfb16e620c77a220487591701379dc41831b0 1 parent 6ae5369
@peterjc peterjc authored
Showing with 9 additions and 11 deletions.
  1. +9 −11 Bio/Graphics/GenomeDiagram/_Feature.py
View
20 Bio/Graphics/GenomeDiagram/_Feature.py
@@ -168,21 +168,19 @@ def __process_feature(self):
"""
self.locations = []
bounds = []
- if self._feature.sub_features == []:
- start = self._feature.location.nofuzzy_start
- end = self._feature.location.nofuzzy_end
+ try:
+ #Compound location?
+ parts = self._feature.location.parts
+ except AttributeError:
+ #No, simple location
+ parts = [self._feature.location]
+ for location in parts:
+ start = location.nofuzzy_start
+ end = location.nofuzzy_end
#if start > end and self.strand == -1:
# start, end = end, start
self.locations.append((start, end))
bounds += [start, end]
- else:
- for subfeature in self._feature.sub_features:
- start = subfeature.location.nofuzzy_start
- end = subfeature.location.nofuzzy_end
- #if start > end and self.strand == -1:
- # start, end = end, start
- self.locations.append((start, end))
- bounds += [start, end]
self.type = str(self._feature.type) # Feature type
#TODO - Strand can vary with subfeatures (e.g. mixed strand tRNA)
if self._feature.strand is None:
Please sign in to comment.
Something went wrong with that request. Please try again.