Class Index | File Index

Classes


Namespace style_obj


Defined in: naview.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Object which controls every drawing aspect of plot.
Namespace Detail
style_obj
Object which controls every drawing aspect of plot. Contains four main attributes with lots of possible subdivisions and options.
These four attributes are:

1. "membrane"
2. "canvas"
3. "textdefs"
4. "protein"

"membrane":

----Sub-attributes: "membrane_region_height", "membrane_mode", "membrane_draw_opts"
----"membrane_region_height": controls % of total svg height occupied by membrane ----"membrane_draw_opts" sub-attributes depends on the "membrane_mode".

----"membrane_mode" has two possible values:

-----> "box" for drawing membranes as a colored rectangle
-----> "lipid" for drawing membranes as a lipid bilayer

--------"membrane_draw_opts" used sub-attributes for "membrane_mode":"box" are:
--------"fill": membrane rectangle color
--------"opacity": membrane rectangle opacity

--------"membrane_draw_opts" used sub-attributes for "membrane_mode":"lipid" are:
--------"hfill": membrane lipid head group color
--------"hstroke": membrane lipid head group stroke color
--------"hstroke_s": membrane lipid head group stroke width in pixels
--------"hopacity": membrane lipid head group opacity
--------"tfill": membrane lipid tail group color
--------"tstroke": membrane lipid tail group stroke color
--------"tstroke_s": membrane lipid tail group stroke width in pixels
--------"topacity": membrane lipid tail group opacity
--------"lipid_head_radius_width": lipid head group width in % of total svg width
--------"lipid_head_radius_height": lipid head group height in % of total svg height
--------"lipid_tail_number": number of lipid tails per lipid group
--------"lipid_tail_breaks": lipid tail breaks per lipid group (currently not used)
--------"lipid_tail_spacing": lipid upper membrane to lower membrane tails spacing in % of total svg height

"canvas":

----Sub-attribute: "border" with sub-attributes "right", "left", "top", "bottom"
----"right": controls svg right border in % of total svg width
----"left": controls svg left border in % of total svg width
----"top": controls svg top border in % of total svg height
----"bottom": controls svg bottom border in % of total svg height

"textdefs":
----Sub-attributes: "font_family", "font_style", "font_size", "fill", "center_xy"
----"font_family: controls text default font family
----"font_style": controls text default font style
----"font_size": controls text default font size
----"fill": controls text default color
----"center_xy": controls text automatic centering around "absolute" coordinate

"protein":

----Has many sub-attributes related to the drawing of different elements
----Sub-attributes for helices under protein: "helix_mode", "helix_draw_opts", "helix_region_width", "helix_region_height", "helix_spacing_width"

----"helix_mode": determines type of helix to be drawn: "box", "cylinder" or "cartoon" are possible values.
----"helix_draw_opts": determines helix drawing characteristics according to helix type.
--------"helix_draw_opts" used sub-attributes for "helix_mode":"box" are: NONE
--------"helix_draw_opts" used sub-attributes for "helix_mode":"cylinder" are:
--------"top_cylinder_stroke": stroke color of top cylinder circle
--------"top_cylinder_stroke_size": stroke size of top cylinder circle
--------"bottom_cylinder_stroke": stroke size of bottom cylinder cirle
--------"bottom_cylinder_stroke_size": stroke color of bottom cylinder circle

--------"helix_draw_opts" used sub-attributes for "helix_mode":"cartoon" are:
--------"x_to_end_prop": proportion that influences shape of drawn half helices
--------"y_to_mid_prop": proportion that influences shape of drawn half helices
--------"aa_area_perc_displacement": proportion that influences shape of drawn half helices
--------"thickness": proportion that influences half turn height
--------"front_helix_stroke": stroke color of front half helices
--------"back_helix_stroke": stroke color of back half helices
--------"stroke_size": stroke size of half helices

----"helix_draw_opts" also has properties that can be applied for any helix element which
----have a specific formatting as a dictionary of domain keys mapping to arrays of six elements
----corresponding to each helix(H1-H6) of each domain (I-IV)
--------"fill": color of front turns for each helix of each domain
--------"back_fill": color of back turns for each helix of each domain
--------"stroke": color of stroke for each helix of each domain
--------"stroke_size": size in pixels of stroke for each helix of each domain
--------"opacity": opacity of each helix in each domain
--------example: "I": { 1:"red",2:"red",3:"red",4:"blue",5:"red",6:"red"} for colors

----The helix related attributes: "helix_region_width", "helix_region_height", "helix_spacing_width",
----have a specific formatting as a dictionary of domain keys mapping to arrays of six elements
----corresponding to each helix(H1-H6) of each domain (I-IV)
----"helix_region_width": controls helix plot width in % of total svg width
----"helix_region_height": controls helix plot height in % of total svg height
----"helix_spacing_width": controls spacing between helices in % of total svg width

----Sub-attributes for loops include different loops categories such as:

----"short_loops_draw_opts" for short, intra domain loops
----"long_loops_draw_opts" for long, between domain loops
----"pore_loops_draw_opts", "pore_region_width", "pore_region_height" for pore loops
---- "nter_loop_width", "nter_loop_draw_opts" for the N-terminal loop
---- "cter_loop_width", "cter_loop_draw_opts" for the C-terminal loop
---- the sub-attributes of the differnt loops "_draw_opts" objects are mostly equal:
--------"type": value is "single". has no importance for now but is essential
--------"stroke": color of loop path stroke
--------"fill": color of loop path ("none" should be used for non-polygon paths)
--------"opacity": opacity of loop path
--------"stroke_size": stroke width of loop path

--------"calc_len": describes how loop length should be calculated. has multiple options of additional attributes
------------"type": indicates loop length calculus type. "fixed", "scaled", "reslen" and "custom" are possible options
------------"calc": contains additional attributes for each loop length calculus "type"

------------ "fixed" indicates an equal, similar loop drawn for fixed box with a given height, width (when applicable for loop shape)
------------ "fixed" has required attributes inside "calc": "height" "width" indicating % of total svg width, height

------------ "scaled" indicates each loop should be drawn from boxes with height, widths proportional to their amino acid numbering
------------ "scaled" has required attributes inside "calc": "height" "width" indicating maximum % of total svg width, height for biggest loop
------------ "scale" which indicates type of aa number loop scaling: "linear", "power" or "log".
------------ logarithimic "log" scale can have its base set by a "base" additional attribute inside "calc"
------------ power "power" scale can have its exponent set by a "exponent" additional attribute inside "calc"
------------ "scale" types are unavailable for "nter_loop_draw_opts" and "cter_loop_draw_opts"

------------ "reslen" indicates each loops aminoacid should have a given length in pixels
------------ "reslen" requires "length" attribute inside "calc" indicating aminoacid length in pixels.
------------ please note that loop minimum width is automatically set when bigger than "length" attribute
------------ this is calculates by a straight line between helices anchoring points divided by the loop aa number

------------ "custom" indicates an specific loop length for each loop defined by a dictionary indicating loop position
------------ "custom" requires dictionaries for "width" and "height" inside "calc" options.
------------ for "short_loops_draw_opts" this dictionary is formatted as the example below:
------------ "I": [0.01,0.01,0.01,0.01,0.005,0.01,0.01]
------------ for "long_loops_draw_opts" this dictionary is formatted as the example below:
------------ {2: 0.01, 3: 0.01, 4: 0.01},
------------ for "pore_loops_draw_opts", "nter_loop_draw_opts" and "cter_loop_draw_opts", the "custom" option is not available

--------"shape": describes how loop shape should be drawn
------------"type": indicates how loop shape should be drawn in plot
------------"calc": contains additional attributes for drawing specific loop shapes

------------ loop types "simple", "bulb" and "mushroom" are available for both short and long loops
------------ in loop type "simple", loop points are defined by the two helices anchoring points plus
------------ their centroid point, which is scaled in the vertical direction according to "calc_len"
------------ "height" definitions and to a "y_step" calc attribute
------------ an optional "calc" attribute "perc_center_x" can regulate the x positioning of the centroid
------------ point in relation to the anchoring first and second points.

------------ in loop type "bulb", besides the above points for loop "simple", two additional points are added:
------------ one before the first anchoring point and another after the first anchoring point
------------ the y position of these points are defined as a percentage of the scaled centroid point height
------------ by the "perc_step_y" attribute. their x positions are defined by the "calc_len"
------------ "width" definitions and to a "x_step" calc attribute

------------ in loop type "mushroom", besides the above points for loop "bulb", two additional points are added:
------------ one between the first anchoring point and the centroid point
------------ and another between the centroid point and the second anchoring point
------------ the y position of these points are defined as a percentage of the scaled centroid point height
------------ by the "perc_step_y2" attribute. ("perc_step_y1" is used for the "bulb" additional points)
------------ their x positions are defined by the "perc_center_x" "calc" attribute which regulates their distance
------------ between the anchoring points and the centroid as a frequency (0.0-1.0)

------------ loop type "swirl" is available only for both short loops
------------ this is mostly equal to the simple loop but here a "swirl_x" calc attribute is
------------ used to calculate the x positioning of two new points relative to the anchoring points centroid
------------ these two points are added between the first and centroid and centroid and second points
------------ their y positioning is controled by a "perc_step_y" attribute. the x positioning delta of the
------------ two new points is also added to the centroid point

------------ loop type "simple_skewed" is the only available only for pore loops
------------ this is equal to the "simple" loop definition but with the obligatory attribute
------------ "perc_center_x" for controlling the x positioning of the centroid point

------------ loop type "n_curves" is the only available only for N and C terminal loops
------------ in loop type "n_curves", loops are initially drawn as a straight line
------------ from the "canvas" bottom left corner to Helix 1 of Domain 1 and a number of "waves" are added
------------ to these loops. the height of each wave is calculated as percentages of a maximum wave step (attribute "y_step")
------------ in the calc attribute "perc_centers_height". the number of waves is defined in the "n_centers" "calc" attribute

--------- Note 1:
--------- long_loops_draw_opts has an additional "width" attribute that regulates their initial draw areas "width" calculation
--------- this is done by it's subattribute "type" whose possible values are "fixed" (equal inter domain loops width)
--------- or "scaled" (inter domain loops width proportional to loop aa number)

---- Note 2:
---- pore loops have two attributes under "protein":
---- "pore_region_width" and "pore_region_height" for controlling their draw areas width and height
---- as percentages of the svg total width and height. the values of these attributes are dictionaries
---- containing keys for the pore loops of each domain as the example below:
---- {"I":0.01,"II":0.01,"III":0.01,"IV":0.01}

---- Note 3:
---- N ter and C ter loops have each a single attribute under "protein":
---- "nter_loop_width" and "cter_loop_width" controlling their draw areas respective width
---- as percentages of the svg total width.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Sep 08 2021 09:00:35 GMT-0300 (BRT)