module TrackLine: Track lines define display attributes. They can be thought of as lists of attribute-value pairs. For forward compatibility, this module allows arbitrary attributes to be set. However, the following lists known attributes and specifies restrictions on their values:
name - string enclosed in double quotes if there are spaces; recommended to use only alphanumeric characters and length less than 15 characters but this is not enforced
description - string enclosed in double quotes if there are spaces; recommended to use only alphanumeric characters and length less than 60 characters but this is not enforced
visibility - "hide", "dense", "full", "pack", or "squish"; if
type=wiggle_0 then "hide", "dense", or "full"; can also use integer value where 0 = "hide", 1 = "dense", 2 = "full", 3 = "pack", 4 = "squish"
color - "R,G,B" where each of R, G, and B are integers between 0 and 255
altColor - "R,G,B" where each of R, G, and B are integers between 0 and 255
itemRgb - "On" is the only allowed value
useScore - 0 or 1
group - string
priority - integer
autoScale - "on" or "off"
gridDefault - "on" or "off"
maxHeightPixels - "max:default:min" where each of max, default, and min are integers
graphType - "bar" or "points"
viewLimits - "lower:upper" where each of lower and upper are integers
yLineMark - floating point value
yLineOnOff - "on" or "off"
windowingFunction - "maximum", "mean", or "minimum"
smoothingWindow - "off" or an integer between 2 and 16
db - should be a valid UCSC assembly ID, but currently any string is accepted
offset - integer
url - string
htmlUrl - string
type - "wiggle_0" is the only value currently supported, leaving this attribute unset handles other track types
Type of a track line.
exception Bad of
val of_string :
string -> t
Parse string to track line. Must be in format as defined by UCSC.
val to_string :
t -> string
Return string representing track line in required format.
val empty :
Empty track line.
val set :
t -> string -> string -> t
set t a x sets attribute
a to value
t. Value always given as string since
set is a general function for setting any attribute. Unrecognized attributes are added without error checking, but
Bad is raised if known attribute's value does not meet requirements specified above. Any previous value of
a is overwritten.
val unset :
t -> string -> t
unset t a deletes attribute
t. Does nothing if attribute not in
val find :
t -> string -> string
find t a returns the value of attribute
a, or raises
Not_found if no such attribute.
val mem :
t -> string -> string -> bool
mem t a x returns true if
a is assigned value
val to_list :
t -> (string * string) list
Return list of attribute=value pairs.
val of_list :
(string * string) list -> t
of_list l sets
x for every
(a,x) pair in
Bad if any invalid values given. If attribute
a given more than once, last will apply.
val valid_wig :
t -> bool
Returns true if
t is a valid wiggle track line.