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
Collaboration diagram for Bio.SeqFeature.BeforePosition:
Collaboration graph

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.

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
>>> print p
>>> int(p)
>>> p + 10

Note this potentially surprising behaviour:

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

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

Definition at line 1099 of file

Member Function Documentation

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

Definition at line 1132 of file

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

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

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

Here is the call graph for this function:

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

Definition at line 1158 of file

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

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

Definition at line 1155 of file

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

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

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: