Back to index

python-biopython  1.60
Public Member Functions | Private Member Functions
Bio.SeqFeature.ExactPosition Class Reference
Inheritance diagram for Bio.SeqFeature.ExactPosition:
Inheritance graph
[legend]
Collaboration diagram for Bio.SeqFeature.ExactPosition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __new__
def __repr__
def position
def extension

Private Member Functions

def _shift
def _flip

Detailed Description

Specify the specific position of a boundary.

o position - The position of the boundary.
o extension - An optional argument which must be zero since we don't
have an extension. The argument is provided so that the same number of
arguments can be passed to all position types.

In this case, there is no fuzziness associated with the position.

>>> p = ExactPosition(5)
>>> p
ExactPosition(5)
>>> print p
5

>>> isinstance(p, AbstractPosition)
True
>>> isinstance(p, int)
True

Integer comparisons and operations should work as expected:

>>> p == 5
True
>>> p < 6
True
>>> p <= 5
True
>>> p + 10
15

Definition at line 780 of file SeqFeature.py.


Member Function Documentation

def Bio.SeqFeature.ExactPosition.__new__ (   cls,
  position,
  extension = 0 
)

Definition at line 813 of file SeqFeature.py.

00813 
00814     def __new__(cls, position, extension = 0):
00815         if extension != 0:
00816             raise AttributeError("Non-zero extension %s for exact position."
00817                                  % extension)
00818         return int.__new__(cls, position)

String representation of the ExactPosition location for debugging.

Reimplemented from Bio.SeqFeature.AbstractPosition.

Definition at line 819 of file SeqFeature.py.

00819 
00820     def __repr__(self):
00821         """String representation of the ExactPosition location for debugging."""
00822         return "%s(%i)" % (self.__class__.__name__, int(self))

def Bio.SeqFeature.ExactPosition._flip (   self,
  length 
) [private]

Definition at line 837 of file SeqFeature.py.

00837 
00838     def _flip(self, length):
00839         #By default perserve any subclass
00840         return self.__class__(length - int(self))

def Bio.SeqFeature.ExactPosition._shift (   self,
  offset 
) [private]

Definition at line 833 of file SeqFeature.py.

00833 
00834     def _shift(self, offset):
00835         #By default preserve any subclass
00836         return self.__class__(int(self) + offset)

Legacy attribute to get extension (zero) as integer (OBSOLETE).

Definition at line 829 of file SeqFeature.py.

00829 
00830     def extension(self):
00831         """Legacy attribute to get extension (zero) as integer (OBSOLETE)."""
00832         return 0

Legacy attribute to get position as integer (OBSOLETE).

Definition at line 824 of file SeqFeature.py.

00824 
00825     def position(self):
00826         """Legacy attribute to get position as integer (OBSOLETE)."""
00827         return int(self)

Here is the caller graph for this function:


The documentation for this class was generated from the following file: