Back to index

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

List of all members.

Public Member Functions

def __new__
def position
def extension
def __repr__
def __str__

Private Member Functions

def _shift
def _flip

Detailed Description

Specify a position where the actual location occurs before it.

Arguments:
o position - The upper boundary of where the location can occur.
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.

This is used to specify positions like (<10..100) where the location
occurs somewhere before position 10.

>>> p = BeforePosition(5)
>>> p
BeforePosition(5)
>>> print p
<5
>>> int(p)
5
>>> p + 10
15

Note this potentially surprising behaviour:

>>> p == ExactPosition(5)
True
>>> p == AfterPosition(5)
True

Just remember that for equality and sorting the position objects act
like integers.

Definition at line 1099 of file SeqFeature.py.


Member Function Documentation

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

Definition at line 1132 of file SeqFeature.py.

01132 
01133     def __new__(cls, position, extension = 0):
01134         if extension != 0:
01135             raise AttributeError("Non-zero extension %s for exact position."
01136                                  % extension)
01137         return int.__new__(cls, position)

A string representation of the location for debugging.

Reimplemented from Bio.SeqFeature.AbstractPosition.

Definition at line 1148 of file SeqFeature.py.

01148 
01149     def __repr__(self):
01150         """A string representation of the location for debugging."""
01151         return "%s(%i)" % (self.__class__.__name__, int(self))

Definition at line 1152 of file SeqFeature.py.

01152 
01153     def __str__(self):
01154         return "<%s" % self.position

Here is the call graph for this function:

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

Definition at line 1158 of file SeqFeature.py.

01158 
01159     def _flip(self, length):
01160         return AfterPosition(length - int(self))

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

Definition at line 1155 of file SeqFeature.py.

01155 
01156     def _shift(self, offset):
01157         return self.__class__(int(self) + offset)

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

Definition at line 1144 of file SeqFeature.py.

01144 
01145     def extension(self):
01146         """Legacy attribute to get extension (zero) as integer (OBSOLETE)."""
01147         return 0

Legacy attribute to get position as integer (OBSOLETE).

Definition at line 1139 of file SeqFeature.py.

01139 
01140     def position(self):
01141         """Legacy attribute to get position as integer (OBSOLETE)."""
01142         return int(self)

Here is the caller graph for this function:


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