module Ligand: sig endAssocext.type t
This data structure is not thread safe.
exception Illegal_character
create below.val create : string -> tIllegal_character if a
character appears in the string which can not be part of a ligand.
For instance, ^ and $ can not appear in ligands. FIXME: For now,
anyway.val get_string : t -> stringtype interval
Assocext.interval.val get_interval_length : interval -> intexception Overlapping_intervals
compare_intervals when the intervals
provided overlap.val compare_intervals : interval -> interval -> intcompare i1 i2 returns -1 if i1 precedes i2 on the ligand, 1
if i1 follows i2 and 0 if they're equal. FIXME: Do error checking
too, as in if they overlap but are not equal?type frag
val get_interval : frag -> intervalfrag type.val contains_end : interval -> boolval contains_begin : interval -> boolexception Stale_frag
Stale_frag.val get_whole : frag -> tStale_frag will
be raised.val get_frag_list : t -> frag listval get_active_interval_list : t -> interval listexception Out_of_bounds
exception Empty
val first : t -> fragval last : t -> fragval next_frag : frag -> fragval prev_frag : frag -> fragval iter : (frag -> unit) -> t -> unitmodule Matcher: sig endexception Unable_to_bind
exception Illegal_interval
val bind : t -> interval -> fragbind l i attempts to bind the ligand l from i.start to
i.start + i.len - 1. The result is the newly bound frag. If the
interval is already bound (fully or partially), exception
Unable_to_bind will be raised. If the range is illegal,
Illegal_interval will be raised.val check : t -> interval -> boolbind above would perform, but does
not bind anything. Returns true if binding would be successful, or
false otherwise. If the interval is illegal, raise
Illegal_interval.exception Invalid_frag
val release : frag -> unitInvalid_frag if the frag is stale or otherwise not
registered.val replace : frag -> string -> unitInvalid_frag. The extremities are
unaffected by a replacement.type whichside =
| |
LeftSplit |
|||
| |
RightSplit |
(* | Returned by | *) |
type apportf = frag -> whichside * frag
split.val split : frag ->
int -> (t * frag) * (t * frag) * apportfsplit f pos splits a ligand into two parts. Precisely, the
ligand is split at position pos of frag f (note that we can only
split a bound ligand). The result is a structure of the form (l1,
f1), (l2, f2), apportf, where l1 and l2 are the new ligands, left
and right of the split respectively, f1 and f2 are the frags which
correspond to the original split frag, which are such that f1 is
bound to the end of the ligand l1 and f2 is bound to the beginning
of the ligand l2, and apportf is a function which maps any bound
frag on the original ligand to a frag on either of the resulting split
frags.type joinf = whichside * frag -> frag
join.val join : frag -> frag -> (t * frag) * joinfjoin f1 f2 joins two ligands into one. More precisely, f1
must be a tail frag on a ligand l1 and f2 a start frag on a ligand
l2. The result (l, f), joinf of join is a single ligand, with a
new frag f which corresponds to the join of f1 and f2. The
returned function joinf is used to map each original bound frag to a
frag on the resulting joined ligand.val collapse_interval : interval -> int * intcollapse_interval i returns (start, length), where the start
and length parameters correspond to the accounting introduced by the
original string from which the ligand was created. This is a lossy
operation, as, for instance, the ligand terminals are simply
forgotten.val basic_interval : t -> int -> int -> intervalbasic_interval start length creates an interval based on the
original string.val get_interval_string : t -> interval -> stringget_interval_string l i returns the base string associated to
the interval i in the ligand l. It is equal to the empty string
if the length of the interval is zero.val get_frag_string : frag -> string