Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

doctest for CompoundFeature's strand property

  • Loading branch information...
commit 7af641f64da9adac3cc270d35315684d52c058d6 1 parent ff6c999
@peterjc peterjc authored
Showing with 29 additions and 1 deletion.
  1. +29 −1 Bio/SeqFeature.py
View
30 Bio/SeqFeature.py
@@ -957,7 +957,35 @@ def _set_strand(self, value):
for loc in self.parts:
loc.strand = value
strand = property(fget = _get_strand, fset = _set_strand,
- doc = "Overall strand of the compound location (read only).")
+ doc = """Overall strand of the compound location.
+
+ If all the parts have the same strand, that is returned. Otherwise
+ for mixed strands, this returns None.
+
+ >>> from Bio.SeqFeature import FeatureLocation, CompoundLocation
+ >>> f1 = FeatureLocation(15,17, strand=1)
+ >>> f2 = FeatureLocation(20,30, strand=-1)
+ >>> f = f1 + f2
+ >>> f1.strand
+ 1
+ >>> f2.strand
+ -1
+ >>> f.strand
+ >>> f.strand is None
+ True
+
+ If you set the strand of a CompoundLocation, this is applied to
+ all the parts - use with caution:
+
+ >>> f.strand = 1
+ >>> f1.strand
+ 1
+ >>> f2.strand
+ 1
+ >>> f.strand
+ 1
+
+ """)
def __add__(self, other):
"""Combine locations.
Please sign in to comment.
Something went wrong with that request. Please try again.