Permalink
Browse files

doctest for CompoundFeature's strand property

  • Loading branch information...
peterjc committed Aug 30, 2012
1 parent ff6c999 commit 7af641f64da9adac3cc270d35315684d52c058d6
Showing with 29 additions and 1 deletion.
  1. +29 −1 Bio/SeqFeature.py
View
@@ -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.

0 comments on commit 7af641f

Please sign in to comment.