Package obitools :: Package location
[hide private]
[frames] | no frames]

Package location

source code

Submodules [hide private]

Classes [hide private]
  Location
Define a location on a sequence.
  SimpleLocation
A simple location is describe a continuous region of a sequence define by a begin and a end position.
  PointLocation
A point location describes a location on a sequence limited to a single position
  CompositeLocation
  ComplementLocation
Functions [hide private]
 
__sublocationIterator(text) source code
 
__locationParser(text) source code
Location subclass instance
locationGenerator(locstring)
Parse a location string as present in genbank or embl file.
source code
tuple(set,Location)
extractExternalRefs(locstring)
When a location describe external references (ex: D28156.1:1..>1292) separate the external reference part of the location and the location by itself.
source code
Variables [hide private]
  __simplelocparser = re.compile(r'(?P<before><?)(?P<from>[0-9]+...
  _matchExternalRef = re.compile(r'[A-Za-z0-9_\|]+(\.[0-9]+)?(?=...
  __package__ = 'obitools.location'

Imports: obitools, re, feature


Function Details [hide private]

locationGenerator(locstring)

source code 

Parse a location string as present in genbank or embl file.

Parameters:
  • locstring (str) - string description of the location in embl/gb format
Returns: Location subclass instance
a Location instance

extractExternalRefs(locstring)

source code 

When a location describe external references (ex: D28156.1:1..>1292) separate the external reference part of the location and the location by itself.

Parameters:
  • locstring (str) - text representation of the location.
Returns: tuple(set,Location)
a tuple with a set of string describing accession number of the referred sequences and a Location instance.

Variables Details [hide private]

__simplelocparser

Value:
re.compile(r'(?P<before><?)(?P<from>[0-9]+)(\.\.(?P<after>>?)(?P<to>[0\
-9]+))?')

_matchExternalRef

Value:
re.compile(r'[A-Za-z0-9_\|]+(\.[0-9]+)?(?=:)')