Results of a Prosite match. Wrapper to the re.MatchObj, but returns
Seq objects instead of strings. And lookee - it implements the Seq
interface too!
Methods
|
|
|
|
__getitem__
|
__getitem__ ( self, i )
|
|
__getslice__
|
__getslice__ (
self,
i,
j,
)
|
|
__init__
|
__init__ (
self,
prosite,
seq,
match,
)
|
|
__len__
|
__len__ ( self )
|
|
__repr__
|
__repr__ ( self )
|
|
__str__
|
__str__ ( self )
|
|
end
|
end ( self, g=0 )
|
|
group
|
group ( self, *groups )
|
|
groups
|
groups ( self, default=None )
|
|
mapped_pattern
|
mapped_pattern ( self )
returns the specific Prosite pattern used to find this sequence
>>> p = Prosite.compile("[AP](2,3)-D.")
>>> m = p.search(Seq.Seq("PAD"))
>>> mapping = m.mapping()
>>> mapped = m.mapped_pattern()
>>> print str(m[1]), str(p[mapping[1]]), str(mapped[1])
P [AP](2,3) [AP]
>>> print str(mapped)
[AP]-[AP]-D.
>>>
Note that the original term includes the count, while the
mapped pattern does the expansion.
|
|
mapping
|
mapping ( self )
return a list of numbers mapping to items of the original pattern
For example, if the Prosite pattern is "[AP](2)-D." matched against
"PAD", then the mapping is [1, 1, 2], meaning the first character
of the match ("P") is from the first Prosite group ("[AP]"), as
is the second letter ("A"). The 3rd letter ("D") is mapped to
group 2 of the pattern.
|
|
span
|
span ( self, g )
|
|
start
|
start ( self, g=0 )
|
|