Class: AliTV

AliTV(svg)

new AliTV(svg)

Creates an object of type AliTV for drawing whole genome alignment visualizations
Parameters:
Name Type Description
svg Object jQuery object containing a svg DOM element. Visualizations will be drawn on this svg. Size may be changed by object methods. Previous content will be deleted.
Author:
Source:
Example
// initializes an AliTV object (wga) on the svg element with id 'canvas'
var svg = $('#canvas');
var wga = new AliTV(svg);

Members

cache

property to cache calculated values
Properties:
Name Type Description
cache Object the data dependent displaying information
Properties
Name Type Description
linear Object the chromosome dependent displaying information
Properties
Name Type Description
maxGenomeSize Object the chromosome dependent displaying information
Source:

conf

property to store configuration options
Properties:
Name Type Description
linear Object The configuration options for the linear layout.
Properties
Name Type Description
startLineColor String The start color of the color gradient for drawing karyos according to their genomeId
endLineColor String The end color of the color gradient.
hideHalfVisibleLinks String If true - do not show links with only one end in a visible region.
circular Object The configuration options for the circular layout.
Properties
Name Type Description
tickSize Number The size of the ticks in pixels.
minLinkIdentity Number The minimum of the link identity the user wants to color.
maxLinkIdentity Number The maximum of the link identity the user wants to color.
midLinkIdentity Number The middle of the link identity the user wants to color.
minLinkIdentityColor String The color of the minimum link.
maxLinkIdentityColor String The color of the maximum link.
midLinkIdentityColor String The color of the middle link.
minLinkLength Number The minimum length of a link:
maxLinkLength Number The maximum length of a link.
graphicalParameters Object The configuration options for all graphical parameters.
Properties
Name Type Description
canvasWidth Number The width of the alignment drawing area in px.
canvasHeight Number The height of the alignment drawing area in px.
karyoHeight Number The height of each chromosome in px.
karyoDistance Number The horizontal distance between adjacent chromosomes of the same genome in bp.
linkKaryoDistance Number The vertical distance between chromosomes and links in px.
tickDistance Number The distance in bp of ticks on the drawn chromosomes.
treeWidth Number The width of the svg drawing area, where the tree should be shown.
genomeLabelWidth Number The width of the svg drawing area, where the genome labels should be shown.
linkOpacity Number The value which is used as default opacity of links.
fade Number The value which is used for the opacity of links by the fadeLinks method.
buttonWidth Number The width of the drawing area for the offset buttons.
layout String Contains the current layout, this means linear or circular.
tree Object Contains the configuration objects for drawing a tree.
Properties
Name Type Description
drawTree Boolean With this option it is possible to draw a phylogenetic tree ext to the chromosomes.
orientation Boolean Defines where the tree should be drawn.
features Object Contains the configuration for feature groups.
Properties
Name Type Description
showAllFeatures Boolean Defines if all features are drawn or not.
gene Object Contains the configuration for genes.
Properties
Name Type Description
form String Defines the shape of a gene.
color String Defines the color of a gene.
height Number Defines the height of the drawn gene onto the chromosome.
visible Boolean Defines if a gene is drawn or not.
invertedRepeat Object Contains the configuration for inverted repeats.
Properties
Name Type Description
form String Defines the shape of an inverted repeat.
color String Defines the color of an inverted repeat.
height Number Defines the height of the drawn inverted repeat onto the chromosome.
visible Boolean Defines if an inverted repeat is drawn or not.
nStretch Object Contains the configuration for n stretch.
Properties
Name Type Description
form String Defines the shape of a n stretch.
color String Defines the color of a n stretch.
height Number Defines the height of the drawn n stretch onto the chromosome.
visible Boolean Defines if an inverted n stretch is drawn or not.
repeat Object Contains the configuration for inverted repeats.
Properties
Name Type Description
form String Defines the shape of a repeat.
color String Defines the color of a repeat.
height Number Defines the height of the drawn repeat onto the chromosome.
visible Boolean Defines if an repeat is drawn or not.
fallback Object Contains the configuration for non-supported feature classes.
Properties
Name Type Description
form String Defines the shape of a non-supported feature groups.
color String Defines the color of a non-supported feature group.
height Number Defines the height of the drawn non-supported feature group onto the chromosome.
visible Boolean Defines if an non-supported feature group is drawn or not.
labels Object The configuration options for the text labels.
Properties
Name Type Description
ticks Boolean Contains the configuration for the labeling of the chromosome scale.
Properties
Name Type Description
showTicks Boolean Defines if ticks are drawn.
showTickLabels Boolean Defines if tick labels are drawn.
color String Defines the color of ticks and their labels.
genome Object Contains the configurations for the genome labels.
Properties
Name Type Description
showGenomeLabels Boolean Defines if genome labels are shown or not.
color String Defines the color of genome labels.
size Number Defines the size of genome labels.
offset Object Contains values for the offset
Properties
Name Type Description
isSet Boolean Defines if an offset is setted or not.
distance Number The value for shifting the chromosomes.
Source:

data

property to store the data
Properties:
Name Type Description
karyo Object the chromosome information
Properties
Name Type Description
chromosomes Object the chromosome details, karyo IDs as keys
Properties
Name Type Description
genome_id Number number of genome to which this chromosome belongs
length Number length in bp
seq String sequence of the chromosome
name String name of the chromosome
features Object the feature information, feature type as keys
Properties
Name Type Description
link Object the link feature information, feature IDs as keys
Properties
Name Type Description
karyo String the karyo ID
start Number start position on the sequence
end Number end position on the sequence
Array the feature information fot type
Properties
Name Type Description
karyo String the karyo ID
name String the name of the feature
start Number start position on the sequence
end Number end position on the sequence
links Object the link information, (sgen) as keys
Properties
Name Type Description
Object the link information, (tgen) as keys
Properties
Name Type Description
Object the link information, feature_id (fid) as key
Properties
Name Type Description
Object the link information, feature_id (fid) as key
Properties
Name Type Description
source String source feature of the link
target String target feature of the link
identity Number identity of the link
Source:

filters

property to store data specific drawing options (structure highly dependent on data structure)
Properties:
Name Type Description
filters Object the data dependent displaying information
Properties
Name Type Description
karyo Object the chromosome dependent displaying information
skipChromosomesWithoutVisibleLinks Boolean If a chromosome has no visible links, because they are filtered, it is possible to skip this chromosome.
showAllChromosomes Boolean Allows to show all chromosomes, even if when they are set not visible.
onlyShowAdjacentLinks Boolean Allows to show only adjacent links or all links.
karyo.order Array array of chromosome IDs in the desired order (circular layout)
karyo.genome_order Array array of genome IDs in the desired order (linear layout)
karyo.chromosomes Object the chromosome drawing details, karyo IDs as keys
Properties
Name Type Description
reverse Boolean should the sequence be treated as its reverse (complement)
visible Boolean should the sequence be displayed at all
karyo.genome_region Object An object that can contain genome_ids as keys and regions as values
Properties
Name Type Description
Object region object with optional "start" and "end" values
Properties
Name Type Description
start Object start value in bp, this position in the genome scale (including gaps between chromosomes) will be at the start of the drawing area (left).
end Object end value in bp, this position in the genome scale (including gaps between chromosomes) will be at the end of the drawing area (right).
links.minLinkIdentity Number The minimum identity of links which should be draw.
links.maxLinkIdentity Number The maximum identity of links which should be draw.
links.minLinkLength Number The minimum length of links, which should be draw in bp.
links.maxLinkLength Number The maximum length of links, which should be draw in bp.
Source:

inTransaction

boolean that indicates whether AliTV is inside transaction, see functions startTransaction and endTransaction
Properties:
Name Type Description
inTransaction boolean is AliTV currently in transaction
Source:

onChangeCallbacks

array of registered onChange callback functions
Properties:
Name Type Description
onChangeCallbacks Array array of callback functions
Source:

svg

property to contain the svg DOM element as jQuery Object
Source:

svgD3

property to contain the svg DOM element as d3 Object
Source:

Methods

changeChromosomeOrder(id:, value:)

This function is supposed to change the order of chromosomes according to their genome. If a genome has only one chromosomes it is not possible to change the order.
Parameters:
Name Type Description
id: The name of the selected chromosome.
value: +1 (moves right) and -1 (moves left).
Source:

changeChromosomeOrientation(chromosome:)

This function is supposed to change the orientation of an assigned chromosome from reverse equal false or reverse equal true.
Parameters:
Name Type Description
chromosome: String the selected chromosome which orientation should be changed.
Author:
  • {Sonja Hohlfeld}
Source:

changeChromosomeVisibility(chromosomeName:)

This function is supposed to change the visibility of a selected chromosome. The function gets the name of a chromosome and set his visibility in filters.karyo.chromosomes equal false or true.
Parameters:
Name Type Description
chromosomeName: String the name of the selected chromosome.
Author:
  • Sonja Hohlfeld
Source:

changeGenomeOrder(name:, value:)

This function is supposed to swap a genome with its adjacent genomes according to the order of all genomes which is defined in ali.filters.karyo.genome_order.
Parameters:
Name Type Description
name: String the name of the selected genome.
value: Number +1 or -1. The number defines if the genome is moved one genome up or down.
Author:
  • Sonja Hohlfeld
Source:

clearAli()

This function is supposed to clear the complete drawing area by removing all children from the svg.
Author:
  • Sonja Hohlfeld
Source:

colorKaryoByGenomeId()

This function color karyos according to their genome_id and is called by drawLinearKaryo within the style attribute It operates on the genome_id of the links and therefore the genome_id should be assigned to the function The genome_id is assigned to a color which is used by the drawLinearKaryo function, so the returned value is the RGB farbcode
Author:
  • Sonja Hohlfeld
Source:

colorLinksByIdentity()

This function color links according to their identity and is called by drawLinearLinks within the style attribute It operates on the identity value of the links and therefore the identity should be assigned to the function The identity is assigned to a color which is used by the drawLinearLinks function, so the returned value is the RGB farbcode
Author:
  • Sonja Hohlfeld
Source:

drawCircular()

This function draws the data in the circular layout. It operates on the data of the object and therefore needs no parameters. It draws directly on the svg and therefore has no return value.
Author:
Source:

drawCircularKaryo(The)

This function draws the karyos in the circular layout, color them according to their genome_id and add some eventHandlers.
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getCircularKaryoCoords()
Author:
  • Markus Ankenbrand
Source:
This function draws links in the circular layout
Parameters:
Name Type Description
The Array array circularLinkCoords containing the coordinates of all links as returned by getCircularLinkCoords()
Author:
  • Markus Ankenbrand
Source:

drawCircularTicks(The)

This function draws the ticks to the karyos in the circular layout
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getCircularTickCoords()
Author:
  • Markus Ankenbrand
Source:

drawEqualLayout(The)

This function should draw the equal layout according to the current layout.
Parameters:
Name Type Description
The String current layout, this means circular or linear.
Author:
  • Sonja Hohlfeld
Source:

drawFeatureLegend()

This function is supposed to draw a legend for all the supportedFeatures.
Author:
  • Markus Ankenbrand
Source:

drawLinear()

This function draws the data in the linear layout. It operates on the data of the object and therefore needs no parameters. It draws directly on the svg and therefore has no return value.
Author:
Source:

drawLinearFeatureLabels(linearFeatureLabelCoords:)

This method is supposed to draw labels to all features.
Parameters:
Name Type Description
linearFeatureLabelCoords: get the coords for the feature labels which are returned by getFeatureLabelCoords.
Author:
  • Sonja Hohlfeld
Source:

drawLinearFeatures(The)

This function draws the features on the karyos in the linear layout, color them according to the configuration.
Parameters:
Name Type Description
The Array array containing the coordinates of the features as returned by getLinearFeatureCoords()
Author:
  • Sonja Hohlfeld
Source:

drawLinearGenomeLabels(linearGenomeLabelCoords:)

This function is supposed to draw the text labels for genomes.
Parameters:
Name Type Description
linearGenomeLabelCoords: gets the coords of the genome labels whcih is returned by getGenomeLabelCoords.
Author:
  • Sonja Hohlfeld
Source:

drawLinearKaryo(The)

This function draws the karyos in the linear layout, color them according to their genome_id and add some events to the chromosome.
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getLinearKaryoCoords()
Author:
  • Markus Ankenbrand and Sonja Hohlfeld
Source:
This function draws adjacent links in the linear layout
Parameters:
Name Type Description
The Array array linearLinkCoords containing the coordinates of all links as returned by getLinearLinkCoords()
Author:
  • Sonja Hohlfeld
Source:

drawLinearTickLabels(linearTickCoords)

This method is supposed to label the ticks with configurable tick labels.
Parameters:
Name Type Description
linearTickCoords
Author:
  • Sonja Hohlfeld
Source:

drawLinearTicks(The)

This function draw the ticks in the linear layout.
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getLinearTickCoords()
Author:
  • Sonja Hohlfeld
Source:

drawLinkIdentityLegend()

This function is supposed to draw a legend for the color code of the link identity.
Author:
  • Markus Ankenbrand
Source:

drawPhylogeneticTree()

This method is supposed to draw a phylogenetic tree next to the chromosomes. In the default configuration the tree is not drawn, but the user can set drawTree equal true and this method wil be called.
Author:
  • {Sonja Hohlfeld}
Source:

endTransaction()

This function is supposed to end a transaction, call triggerChange once and allow for new changes to trigger directly.
Source:
This function is called by a mouse event. If the mouse pointer enters the area of a chromosome all links should be faded out except the the links of the chromosome the mouse points to. If the mouse pointer leaves the area of a chromosome all links should be faded in.
Parameters:
Name Type Description
The Number opacity value is a number between 0 and 1 and indicates the degree of the colored link opacity.
Source:

filterChromosomeOrder(visibleChromosomes:)

This method is supposed to filter the order of chromosomes according to all visible chromosomes.
Parameters:
Name Type Description
visibleChromosomes: gets all visible chromosomes
Author:
  • Sonja Hohlfeld
Source:
Returns:
chromosomeOrder: returns the order of the visible chromosomes

filterChromosomes()

This method should call other filter functions in order to filter the visible chromosomes.
Author:
  • Sonja Hohlfeld
Source:
Returns:
visibleChromosomes: returns only chromosomes which are visible
This method should filter all chromosome which have no visible links with the current configurations
Parameters:
Name Type Description
visibleChromosomes: the method gets all current visible chromosomes.
Author:
  • Sonja Hohlfeld
Source:
Returns:
filteredChromosomes: the method returns only chromosomes which have visible links
This method should call functions in order to filter the links. The nested link data structure with genome_ids as keys is returned as a flat structure with link_ids as keys. The filteredLinks are also saved as an object property.
Parameters:
Name Type Description
visibleChromosomes: gets the chromosomes which are visible in the current configurations.
Author:
  • Sonja Hohlfeld and Markus Ankenbrand
Source:
Returns:
visibleLinks: return all links which are visible

filterLinksByAdjacency()

This method should filter links according to their adjacency (if the according option is set and the layout is linear). The nested link data structure with genome_ids as keys is returned as a flat structure with link_ids as keys.
Author:
  • Sonja Hohlfeld and Markus Ankenbrand
Source:
Returns:
filteredLinks: returns only links which are between chromosomes of adjacent genomes (if needed) in a flat link object.

filterLinksByIdentity(visibleLinks:)

This method should filter links according to their identity.
Parameters:
Name Type Description
visibleLinks: gets all current visible links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
filteredLinks: return all links which are visible with the current configuration.

filterLinksByLength(visibleLinks:)

This method should filter links according to their length.
Parameters:
Name Type Description
visibleLinks: gets all current visible links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
filteredLinks: return all links which are visible with the current configuration.

filterVisibleChromosomes(visibleChromosomes:)

This method should filter all chromosome which are set visible in conf.filters.karyo.chromosomes[].visible
Parameters:
Name Type Description
visibleChromosomes: the method gets all current visible chromosomes.
Author:
  • Sonja Hohlfeld
Source:
Returns:
filteredChromosomes: the method returns only chromosomes whose visibility is set true
This method should filter the visible links according to visible chromosomes
Parameters:
Name Type Description
visibleLinks: contains all currently visible links.
visibleChromosomes: contains the chromosomes, which are visible in the current configurations in order to filter all links, which have no target or source chromosome.
Author:
  • Sonja Hohlfeld and Markus Ankenbrand
Source:
Returns:
visibleLinks: returns only links which source or target are in visible chromosomes

getAlignmentRegion() → {Object}

This function returns the internal alignmentRegion g element as d3 selection. It is created if it does not exist. It also creates and adds the clipPath if it does not exist.
Author:
  • Markus Ankenbrand
Source:
Returns:
internal alignmentRegion g as d3 selection.
Type
Object

getCanvasHeight() → {Number}

This function returns the height of the svg drawing area.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The height of canvas.
Type
Number

getCanvasWidth() → {Number}

This function returns the width of the svg drawing area.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The width of canvas.
Type
Number

getCircularKaryoCoords() → {Array}

Calculates coordinates for the chromosomes to draw in the circular layout. This function operates on the data property of the object and therefore needs no parameters. This function is primarily meant for internal usage, the user should not need to call this directly.
Author:
Source:
Returns:
Array containing one Object for each element in data.karyo of the form {karyo: 'karyo_name', startAngle:0, endAngle:1}
Type
Array

getCircularLinkCoords(The) → {Array}

Calculate coordinates for the links to draw in the cirular layout and uses link-data and karyo-coordinates This function is primarily meant for internal usage, the user should not need to call this directly
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getCircularKaryoCoords()
Author:
  • Markus Ankenbrand
Source:
Returns:
Returns an Array which is presented in the following example
Type
Array
Example
[
					{"linkID": "l1", "source": {"startAngle":1, "endAngle":3}, "target": {"startAngle":4, "endAngle":6}}
			]

getCircularTickCoords(The) → {Array}

This function calculates the coordinates (angles) for the ticks in the circular layout
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getCircularKaryoCoords()
Author:
  • Markus Ankenbrand
Source:
Returns:
Returns an Array of angles
Type
Array

getFeatureLabelCoords(gets)

This method is supposed to calculate the coordinates for feature labels. This method is called if the configuration of addFeatureLabels or showAllLabels is true.
Parameters:
Name Type Description
gets the coordinates of the drawn features.
Author:
  • Sonja Hohlfeld
Source:
Returns:
featureLabelCoords: returns an array which contains the coords for the feature labels.

getFeatureProperty(groupId, property) → {String}

This function returns the specified property of the given supported feature.
Parameters:
Name Type Description
groupId String The group ID of the desired supported feature.
property String The desired property of the feature (e.g. color, form, ...).
Author:
  • Markus Ankenbrand
Source:
Throws:
  • Will throw an error if the feature groupId is not supported.
  • Will throw an error if the property is undefined in the feature group.
Returns:
The value of the property of the given supported feature.
Type
String

getGenomeColor() → {Array}

This function returns an array which contains the color of the first and the last genome. The colors are defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The color of the first and the last genome.
Type
Array

getGenomeDistance() → {Number}

This function calculates the appropriate genomeDistance of the linear layout for the current svg height.
Author:
  • Sonja Hohlfeld
Source:
Returns:
genomeDistance - the distance between genomes in the linear layout.
Type
Number

getGenomeLabelColor()

This function returns the color of the genomeLabels. The color is defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The color of the genome labels.

getGenomeLabelCoords()

This method is supposed to calculate the coordinates for genome labels. This is called if the configuration of addGenomeLables is true.
Author:
  • Sonja Hohlfeld
Source:
Returns:
genomeLabelCoords: returns an array which contains the coords for the genome labels.

getGenomeLabelSize()

This function returns the size of the genomeLabels. The size is defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The size of the genome labels.

getInvisibleChromosomes()

This functions gets the number of all chromosomes which are set invisible.
Author:
  • Sonja Hohlfeld
Source:
Returns:
invisibleChromosomeSize: the number of all chromosomes which are invisible.

getInvisibleFeatures()

This functions gets the number of all features which are in ali.filters.features.invisibleFeatures
Author:
  • Sonja Hohlfeld
Source:
Returns:
invisibleFeatureSize: the number of all features which are invisible.
This functions gets the number of all links which are in ali.filters.links.invisibleLinks
Author:
  • Sonja Hohlfeld
Source:
Returns:
invisibleLinkSize: the number of all Links which are invisible.

getJSON() → {Object}

This function returns the content of the AliTV object as a single object containing data, filters and conf.
Author:
  • Markus Ankenbrand
Source:
Returns:
The content of the AliTV object.
Type
Object

getKaryoHeight() → {Number}

This function returns the height of the chromosomes between two genomes which is set in the configuration.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The actual height of chromosomes.
Type
Number

getKaryoSpacer() → {Number}

This function returns the information of the spacer between two chromosomes which is set in the configuration.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The actual spacer.
Type
Number

getLayout() → {String}

This function returns the current layout.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The current layout: linear or circular.
Type
String

getLegendRegion() → {Object}

This function returns the internal legendRegion g element as d3 selection. It is created if it does not exist.
Author:
  • Markus Ankenbrand
Source:
Returns:
internal legendRegion g as d3 selection.
Type
Object

getLinearFeatureCoords(linearKaryoCoords:) → {Array}

Calculates coordinates for different shapes according to the different feature classes in order to draw in the linear layout. This function operates on the linearKaryoCoords. This function is primarily meant for internal usage, the user should not need to call this directly.
Parameters:
Name Type Description
linearKaryoCoords: Array contains the coordinates for all chromosomes of the form: {karyo: 'karyo_name', x:0, y:0, width:10, height:10}.
Author:
  • Sonja Hohlfeld
Source:
Returns:
linearFeatureCoords: contains the coordinates for feature classes of the form: {id: "featureId", x:0, y:0, width: 45, height: 10}
Type
Array

getLinearKaryoCoords() → {Array}

Calculates coordinates for the chromosomes to draw in the linear layout. This function operates on the data property of the object and therefore needs no parameters. This function is primarily meant for internal usage, the user should not need to call this directly. The function also updates the value cache.linear.maxGenomeSize
Author:
Source:
Returns:
Array containing one Object for each element in data.karyo of the form {karyo: 'karyo_name', x:0, y:0, width:10, height:10}
Type
Array

getLinearLinkCoords(The) → {Array}

Calculate coordinates for the links to draw in the linear layout and uses link-data and karyo-coordinates this function should also check if links are adjacent or not and save this information in the link property "adjacent" This function is primarily meant for internal usage, the user should not need to call this directly
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getLinearKaryoCoords()
Author:
  • Sonja Hohlfeld
Source:
Returns:
Returns an Array which is presented in the following example
Type
Array
Example
[
					{"linkID": "l1", "source0": {"x":0, "y":10}, "target0": {"x": 0, "y":20}, "source1": {"x":10, "y":10}, "target1": {"x":10, "y":20}, "adjacent": true}
			]

getLinearTickCoords(The) → {Array}

This function calculates the tick coords and operates on the chromosomes and need the length in bp and the width in px of the karyo.
Parameters:
Name Type Description
The Array array containing the coordinates as returned by getLinearKaryoCoords()
Author:
  • Sonja Hohlfeld
Source:
Returns:
The array containing the tick coordinates as shown in the following example. Ticks for one chromosome have to be adjacent and in the order from start to end.
Type
Array
Example
linearTickCoords = [{id: 'c1', x1: 0, x2: 0, y1: 860, y2: 910}, {id: 'c2', x1: 0, x2: 0, y1: 660, y2:710}]

getLinkColor() → {Array}

This function returns an array which contains the color of the minLinkIdentity and the maxLinkIdentity. The colors are defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The color of the links with the minimal and maximal identity.
Type
Array

getLinkOpacity()

This method is supposed to return the default link opacity.
Author:
  • Markus Ankenbrand
Source:
Returns:
linkOpacity: the default link opacity.

getMaxChromosomeLength()

This function is supposed to return the value of the longest chromosome.
Author:
  • Sonja Hohlfeld
Source:
Returns:
maxLinkLength: the value of the longest chromosome in bp.

getMaxLinkIdentity()

This method is supposed to return the current maximal identity of links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
maximalLinkIdentity: the maximal identity of links.

getMaxLinkLength()

This method is supposed to return the current maximal length of links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
maximalLinkLength: the maximal length of links.

getMinLinkIdentity()

This method is supposed to return the current minimal identity of links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
minimalLinkIdentity: the minimal identity of links.

getMinLinkLength()

This method is supposed to return the current minimal length of links.
Author:
  • Sonja Hohlfeld
Source:
Returns:
minimalLinkLength: the minimal lenght of links.

getOffset() → {Number}

This function returns the offset for a specific chromosome.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The offset in bp of a chromosome.
Type
Number

getOuterRadius() → {Number}

This function calculates the appropriate outerRadius of the circular layout for the current svg dimensions.
Author:
  • Markus Ankenbrand
Source:
Returns:
outerRadius - the outer radius in px
Type
Number

getSupportedFeatures() → {Array}

This function is supposed to return an array of supported features
Source:
Returns:
supportedFeatures
Type
Array

getSvgAsText() → {String}

This function returns the content of the svg as a text string.
Author:
  • Markus Ankenbrand
Source:
Returns:
The content of the svg.
Type
String

getSvgHeight() → {Number}

This function returns the height of the svg.
Author:
  • Markus Ankenbrand
Source:
Returns:
The height of svg.
Type
Number

getSvgWidth() → {Number}

This function returns the width of the svg.
Author:
  • Markus Ankenbrand
Source:
Returns:
The width of svg.
Type
Number

getTickDistance() → {Number}

This function returns the distance of the chromosome ticks in bp.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The tick distance in bp.
Type
Number

getTickLabelColor()

This function returns the color of the tick Labels. The color is defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The color of the tick labels.

getTickLabelFrequency() → {Number}

This function returns the current frequency of tick labels.
Author:
  • Sonja Hohlfeld
Source:
Returns:
Returns the frequency of the tick labels.
Type
Number

getTickLabelSize()

This function returns the size of the tick Labels. The size is defined in the conf-object.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The size of the tick labels.

getTreeWidth() → {Number}

This function returns the current width of the phylogenetic tree.
Author:
  • Sonja Hohlfeld
Source:
Returns:
The current tree width.
Type
Number

hasTree() → {Boolean}

This method should check if the user provides tree data.
Author:
  • Sonja Hohlfeld
Source:
Returns:
Returns true when tree data exists and false when there is no tree data.
Type
Boolean

onDataChange(callback)

This function is supposed to register callback function which are called upon data change
Parameters:
Name Type Description
callback function callback to be called upon data change
Source:

orderKaryosAutomatically()

This function re-orders the karyos in all genomes according to the longest hit to the reference genome (determined by globally longest sequence) This function is transpiled using babel to make tests with phantomJS work (does not support ES6) To see the original ES6 implementation you can check out fb68a0fb290ab38ccc381bfebd4323f267f97ca6
Author:
  • Markus Ankenbrand
Source:

removeLinksOutsideVisibleRegion(linkCoords, removeHalfVisible) → {Array}

This function returns linkCoords with those removed that have their ends outside the visible region. Optionally also links with only one end in the visible region can be removed.
Parameters:
Name Type Description
linkCoords Array linearLinkCoords as returned by getLinearLinkCoords
removeHalfVisible boolean if true also links with one end inside the visual region will be removed
Author:
  • Markus Ankenbrand
Source:
Returns:
- filtered linearLinkCoords
Type
Array

resetGenomeRegion(genome_id)

This function resets the genome_region filter to default for the specified genome
Parameters:
Name Type Description
genome_id String genome_id
Author:
  • Markus Ankenbrand
Source:

rotateTreeToGenomeOrder() → {object}

This function is supposed to generate a tree from the supplied one that matches the current genome_order.
Author:
  • Markus Ankenbrand
Source:
Returns:
tree - the tree in data rotated to match the current genome_order.
Type
object

setCanvasHeight(The)

This function replaces the old height of the drawing area for the alignment. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the height of the svg drawing area which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setCanvasWidth(The)

This function replaces the old width of the drawing area for the alignment. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the width of the svg drawing area which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setConf(conf)

Extends the existing conf of the AliTV object. New features override the existing ones if conflicting. Non-conflicting configuration values are kept. For the required format see the documentation of the conf property. If you need to override the entire conf object write directly to the conf property of your AliTV object. This is not recommended as AliTV will not function properly if some conf values are not set.
Parameters:
Name Type Description
conf Object Object containing conf values
Author:
Source:

setData(data)

Sets the data of the AliTV object. For the required format see the documentation of the data property
Parameters:
Name Type Description
data Object Object containing karyo, link and feature information
Author:
Source:
Example
var svg = $('#canvas');
var wga = new AliTV(svg);
var karyo = {
	'chromosomes': {
	'c1': {'genome_id': 0, 'length': 2000, 'seq': null},
	'c2': {'genome_id': 1, 'length': 1000, 'seq': null}
	}
};
var features = {
	'f1': {'karyo': 'c1', 'start': 300, 'end': 800},
	'f2': {'karyo': 'c2', 'start': 100, 'end': 600}
};
var links = { "l1":
	{'source': 'f1', 'target': 'f2', 'identity': 90}
};
wga.setData({'karyo': karyo, 'features': features, 'links': links};

setFeatureInvisible(featureID:, group:, karyo:)

This function gets a selected feature ID and pushes it to ali.filters.Features.invisibleFeatures. The function marks all features, which are set invisible.
Parameters:
Name Type Description
featureID: gets the ID of the selected feature.
group: gets the group of the selected feature for example invertedRepeat.
karyo: gets the chromsome which belongs to the selected feature.
Author:
  • Sonja Hohlfeld
Source:
Returns:
ali.filters.features.invisibleFeatures: returns the features which are invisible in the current settings.

setFeatureProperty(groupId, property, value:)

This function replaces the old color of the specified supported feature with the new color in the config-object.
Parameters:
Name Type Description
groupId String the supported feature groupId for which the color should be set.
property String The desired property of the feature (e.g. color, form, ...).
value: the new value for the property of the supported feature.
Author:
  • Markus Ankenbrand
Source:
Throws:
  • Will throw an error if the feature is not supported.
  • Will throw an error if the argument is empty.

setFilters(filters)

Sets the filters of the AliTV object. For the required format see the documentation of the filters property The filters are highly dependent on the data object and have to resemble its layout
Parameters:
Name Type Description
filters Object Object containing data specific drawing information
Author:
Source:
Example
var svg = $('#canvas');
var wga = new AliTV(svg);
var karyo = {
	'chromosomes': {
	'c1': {'genome_id': 0, 'length': 2000, 'seq': null},
	'c2': {'genome_id': 1, 'length': 1000, 'seq': null}
	}
};
var features = {
	'f1': {'karyo': 'c1', 'start': 300, 'end': 800},
	'f2': {'karyo': 'c2', 'start': 100, 'end': 600}
};
var links = {"l1":
	{'source': 'f1', 'target': 'f2', 'identity': 90}
};
wga.setData({'karyo': karyo, 'features': features, 'links': links};
var filters = {
	'karyo': {
		'order': ['c1', 'c2'],
		'genome_order': ['0', '1'],
		'chromosomes': {
	 		'c1': {'reverse': false, 'visible': true},
			'c2': {'reverse': false, 'visible': true}
		}
	}
};
wga.setFilters(filters);
wga.drawLinear();
wga.drawCircular();

setGenomeColor(color:)

This function replaces the old colors of the start genome and the end genome with the new ones.
Parameters:
Name Type Description
color: the array contains the startLineColor and the endLineColor which is returned by getGenomeColor.
Author:
  • Sonja Hohlfeld
Source:
Throws:
Will throw an error if the argument is empty.

setGenomeLabelColor(color:)

This function set a new color for the genome labels.
Parameters:
Name Type Description
color: the current color of genome labels which is returned by getGenomeLabelColor.
Author:
  • Sonja Hohlfeld
Source:
Throws:
Will throw an error if the argument is empty.

setGenomeLabelSize(size:, The)

This function set a new size for the genome labels.
Parameters:
Name Type Description
size: the current size of genome labels which is returned by getGenomeLabelSize.
The Number function gets the size of genome labels which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setJSON(json)

This is a convenience function to set data, filters and conf of the AliTV object with a single call.
Parameters:
Name Type Description
json Object Object containing any of data, filters and conf.
Author:
  • Markus Ankenbrand
Source:

setKaryoHeight(The)

This function replaces the old height of the chromosomes with the new value in the config-object. It is called by a blur()-event, when the decription field loses focus. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the height of chromosomes which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setKaryoSpacer(The)

This function replaces the old spacer with the new spacer in the config-object. It is called by a blur()-event, when the decription field loses focus. When the method gets a wrong spacer it throws an error message.
Parameters:
Name Type Description
The Number function gets the spacer which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is Sorry, you entered an empty value. Please try it again..
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setLinkColor(color:)

This function replaces the old colors for the minimal and maximal link identity by the new ones.
Parameters:
Name Type Description
color: the array contains the minLinkIdentityColor and the maxLinkIdentityColor which is returned by getLinkColor.
Author:
  • Sonja Hohlfeld
Source:
Throws:
Will throw an error if the argument is empty.

setLinkInvisible(selectedLinkID:)

This function gets the id of a selected link, hides it and pushes it to ali.filters.links.selectedLinks.
Parameters:
Name Type Description
selectedLinkID: gets the id of the selected link
Author:
  • Sonja Hohlfeld
Source:
Returns:
ali.filters.links.invisibleLinks: returns the links which are invisible in the current settings of ali.filters.links.invisibleLinks.

setLinkOpacity(The)

This function sets a new default link opacity. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number new opacity (value between 0 and 1)
Author:
  • Markus Ankenbrand
Source:
Throws:
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is out of range [0,1].

setNewFeature(group:, form:, color:) → {ali.conf.features.supportedFeatures}

This function is supposed to get the parameters for adding a new feature group in conf.features.supportedFeatures.
Parameters:
Name Type Description
group: the name of the new feature group
form: the form for the group which is used by drawFeatures
color: the color for the new group
Author:
  • Sonja Hohlfeld
Source:
Returns:
The current feature groups which are supported by AliTV
Type
ali.conf.features.supportedFeatures

setOffset(The, The)

This function sets a new offset for specific chromosome. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the distance for shifting chromosomes which can be set by the user.
The String function gets the Id of the chromosome which should be shifted.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.

setSvgHeight(height)

This function sets the height of the svg - it does not effect the size of the canvas, tree, etc. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
height Number the desired height of the svg set by the user.
Author:
  • Markus Ankenbrand
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setSvgWidth(width)

This function sets the width of the svg - it does not effect the size of the canvas, tree, etc. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
width Number the desired width of the svg set by the user.
Author:
  • Markus Ankenbrand
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setTickDistance(The)

This function replaces the old distance between ticks with the new distance in the config-object. It is called by a blur()-event, when the decription field loses focus. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the distance between ticks which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setTickLabelColor(color:)

This function set a new color for the tick labels.
Parameters:
Name Type Description
color: the current color of tick labels which is returned by getTickLabelColor.
Author:
  • Sonja Hohlfeld
Source:
Throws:
Will throw an error if the argument is empty.

setTickLabelFrequency(tickLabelFrequency:)

This function replaces the old frequency of tick labels with the new tick label frequency in the config-object.
Parameters:
Name Type Description
tickLabelFrequency: the frequency of tick labels which is returned by getTickLabelFrequency.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setTickLabelSize(size:, The)

This function set a new size for the tick labels.
Parameters:
Name Type Description
size: the current size of tick labels which is returned by getTickLabelSize.
The Number function gets the size of tick labels which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

setTreeWidth(The)

This function replaces the old tree width with the new tree width in the config-object. When the method gets a wrong value it throws an error message.
Parameters:
Name Type Description
The Number function gets the width of a phylogenetic tree which can be set by the user.
Author:
  • Sonja Hohlfeld
Source:
Throws:
  • Will throw an error if the argument is empty.
  • Will throw an error if the argument is not a number.
  • Will throw an error if the argument is less than 0 or equal to 0.

showInvisibleFeature(selectedFeatureId:)

This function is supposed to get the ID of a selected feature, which is hidden and should be restored. The function show the hidden feature and delete it from the invisibleFeatures-object in ali.filters.features.invisibleFeatures
Parameters:
Name Type Description
selectedFeatureId: the Id of the features which should be restored.
Author:
  • Sonja Hohlfeld
Source:
Returns:
ali.filters.features.invisibleFeatures: the current features which are set invisible.
This function is supposed to get the ID of a selected link, which is hidden and should be restored. The function show the hidden link and delete it from the invisibleLinks-object in ali.filters.links.invisibleLinks
Parameters:
Name Type Description
selectedLinkID: the ID of the links which should be restored.
Author:
  • Sonja Hohlfeld
Source:
Returns:
ali.filters.links.hiddenLinks: the current links which are set invisible.

startTransaction()

This function is supposed to start a transaction and prevent changes from being triggered during that time
Source:

triggerChange()

This function is supposed to call all registered callback functions
Source:

updateGenomeRegionBySvgRect(rect)

This function updates the genome_region filter according to the specified region on the svg
Parameters:
Name Type Description
rect Object rect an object with properties x, y, width and height (relative to the svg)
Author:
  • Markus Ankenbrand
Source: