Back to index

python-biopython  1.60
Public Member Functions | Private Member Functions
Bio.SeqFeature.AfterPosition Class Reference
Inheritance diagram for Bio.SeqFeature.AfterPosition:
Inheritance graph
[legend]
Collaboration diagram for Bio.SeqFeature.AfterPosition:
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 is found after it.

Arguments:
o position - The lower 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 after position 10.

>>> p = AfterPosition(7)
>>> p
AfterPosition(7)
>>> print p
>7
>>> int(p)
7
>>> p + 10
17

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

Note this potentially surprising behaviour:

>>> p == ExactPosition(7)
True
>>> p == BeforePosition(7)
True

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

Definition at line 1161 of file SeqFeature.py.


Member Function Documentation

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

Definition at line 1201 of file SeqFeature.py.

01201 
01202     def __new__(cls, position, extension = 0):
01203         if extension != 0:
01204             raise AttributeError("Non-zero extension %s for exact position."
01205                                  % extension)
01206         return int.__new__(cls, position)

A string representation of the location for debugging.

Reimplemented from Bio.SeqFeature.AbstractPosition.

Definition at line 1217 of file SeqFeature.py.

01217 
01218     def __repr__(self):
01219         """A string representation of the location for debugging."""
01220         return "%s(%i)" % (self.__class__.__name__, int(self))

Definition at line 1221 of file SeqFeature.py.

01221 
01222     def __str__(self):
01223         return ">%s" % self.position

Here is the call graph for this function:

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

Definition at line 1227 of file SeqFeature.py.

01227 
01228     def _flip(self, length):
01229         return BeforePosition(length - int(self))
01230 

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

Definition at line 1224 of file SeqFeature.py.

01224 
01225     def _shift(self, offset):
01226         return self.__class__(int(self) + offset)

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

Definition at line 1213 of file SeqFeature.py.

01213 
01214     def extension(self):
01215         """Legacy attribute to get extension (zero) as integer (OBSOLETE)."""
01216         return 0

Legacy attribute to get position as integer (OBSOLETE).

Definition at line 1208 of file SeqFeature.py.

01208 
01209     def position(self):
01210         """Legacy attribute to get position as integer (OBSOLETE)."""
01211         return int(self)

Here is the caller graph for this function:


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