module Matcher: sig end
Contains the definitions for the objects which are used to find
binding regions on ligands.
type matcher = {
|
stringform : string ; |
|
compiledform : Str.regexp ; |
}
A simple regular expression. We keep the original string
alongside for easier debugging. Matchers are used as the markers
on the projections of processing units which bind to ligands.
val make : string -> matcher
Quick shortcut to create a matcher
object.
val stringform : matcher -> string
Extract the string out from a matcher.
val matcher_compare : matcher -> matcher -> bool
Use matcher_compare m1 m2
to decide whether two matchers are
equal.
val allmatches : matcher -> Ligand.t -> Ligand.interval list
allmatches m l
returns a list of intervals where matcher
m
matches ligand
l
. A match necessarily has strictly positive
length, unless the match is for the very beginning or the very end
of the ligand.
Util.all_matches
val verify_match_interval : matcher -> Ligand.t -> Ligand.interval -> bool
verify_match_interval m l i
verifies whether matcher m
matches ligand l
at interval i
- in other words, whether
interval i
appears in allmatches m l
.
val matcher_concat : matcher list -> matcher
matcher_concat l
returns a new matcher which corresponds to
the concatenation of all the matchers in the list l
.
type string_permuter
This type is used by the functions make_string_permuter
and
permute_strings
below to modify strings by exchanging fragments
between them.
val make_string_permuter : matcher array ->
(int array * int array) * (int array * int array) ->
string_permuter
... FIXME: raise Invalid_argument
if the permutations are not
valid.
val permute_strings : string_permuter -> string * string -> string * string
Will raise Not_found
if the strings don't match the
permuter.
type snippet = string * matcher
A pair consisting of a string and a regular expression.
Snippets are used as the markers on the projections of processing
units which bind to other processing units. See
Swarm.EXPOSURE
. See also
snipmatch
below for a definition of
how snippets match with one another.
val snipmatch : snippet -> snippet -> bool
snipmatch s1 s2
returns true
if the two snippets match.
The two snippets s1 = (t1, m1)
and s2 = (t2, m2)
are said to
match if string t1
matches regular expression m2
and t2
matches m1
.