| Trees | Indices | Help |
|
|---|
|
|
object --+
|
int --+
|
object --+ |
| |
AbstractPosition --+
|
OneOfPosition
Specify a position where the location can be multiple positions. This models the GenBank 'one-of(1888,1901)' function, and tries to make this fit within the Biopython Position models. If this was a start position it should act like 1888, but as an end position 1901. >>> p = OneOfPosition(1888, [ExactPosition(1888), ExactPosition(1901)]) >>> p OneOfPosition(1888, choices=[ExactPosition(1888), ExactPosition(1901)]) >>> int(p) 1888 Interget comparisons and operators act like using int(p), >>> p == 1888 True >>> p <= 1888 True >>> p > 1888 False >>> p + 100 1988 >>> isinstance(p, OneOfPosition) True >>> isinstance(p, AbstractPosition) True >>> isinstance(p, int) True The old legacy properties of position and extension give the starting/lowest/left-most position as an integer, and the distance to the ending/highest/right-most position as an integer. Note that the position object will act like one of the list of possible locations depending on how it was created: >>> p2 = OneOfPosition(1901, [ExactPosition(1888), ExactPosition(1901)]) >>> p.position == p2.position == 1888 True >>> p.extension == p2.extension == 13 True >>> int(p) == int(p2) False >>> p == 1888 True >>> p2 == 1901 True
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
position Legacy attribute to get (left) position as integer (OBSOLETE). |
|||
|
extension Legacy attribute to get extension as integer (OBSOLETE). |
|||
|
Inherited from |
|||
|
|||
Initialize with a set of posssible positions. position_list is a list of AbstractPosition derived objects, specifying possible locations. position is an integer specifying the default behaviour.
|
String representation of the OneOfPosition location for debugging.
|
str(x)
|
|
|||
positionLegacy attribute to get (left) position as integer (OBSOLETE).
|
extensionLegacy attribute to get extension as integer (OBSOLETE).
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Feb 5 18:02:51 2013 | http://epydoc.sourceforge.net |