Class Index | File Index

Classes


Class Biojs.ExpressionLoader


Version 1.0.0.

Extends Biojs.

Defined in: Biojs.ExpressionLoader.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
This component allows to load a tab-delimited file on the client.
Field Summary
Field Attributes Field Name and Description
<inner>  
Array containing the supported event names
<inner>  
opt
Default values for the options
Method Summary
Method Attributes Method Name and Description
 
 
constructor(options)
 
Build a HTML string that displays a given number of rows as a table, including a last row of radio buttons to select a column
 
getRGBString(value)
Extrapolates a value using the minimum and maximum values and colors given as parameters.
 
Parse a String with tab delimited format into a hash, where the first column is treated as the key, and the value are all the other columns grouped as an array
 
Open the first parameter dialog to choose which column of the file should be loaded.
 
Open the second parameter dialog to choose the range of expression values and their correspondent colors.
Methods borrowed from class Biojs:
addListener, extend, getId, listen, raiseEvent, setEventHandlers, setOptions
Event Summary
Event Attributes Event Name and Description
 
onError(actionPerformed)
 
onFileLoaded(actionPerformed)
 
onFileRemoved(actionPerformed)
Class Detail
Biojs.ExpressionLoader(options)
This component allows to load a tab-delimited file on the client. it uses HTML5 to load the file into the browser, it does not require a server side.
Author: Gustavo A. Salazar.
					var instance = new Biojs.ExpressionLoader({
					     target: "YourOwnDivId"
					});
Parameters:
{Object} options
An object with the options for the Expression Loader component.
Options detailed:
{string} target
Identifier of the DIV tag where the component should be displayed.
{String} label
Text for the link that opens the file chooser dialog.
Requires:
jQuery Core 1.7.2
jQuery UI 1.8.2
jQuery UI CSS 1.8.2
Expression Loader CSS
Color Selector CSS
Color Selector
Field Detail
<inner> eventTypes
Array containing the supported event names

<inner> opt
Default values for the options
Method Detail
calculateExtrapolingData(colorData)
Parameters:
colorData

constructor(options)
Parameters:
options

getFormatedTable(rows)
Build a HTML string that displays a given number of rows as a table, including a last row of radio buttons to select a column
instance.getFormatedTable(3);
Parameters:
{int} rows
the number of rows to be included in the table.

getRGBString(value)
Extrapolates a value using the minimum and maximum values and colors given as parameters. It returns a string in the format: "rgb([valRed],[valGreen],[valBlue])"
instance.getRGBString(0.6);
instance.getRGBString(0.8);
instance.getRGBString(0.1);
Parameters:
value

parseTabDelimitedString(text)
Parse a String with tab delimited format into a hash, where the first column is treated as the key, and the value are all the other columns grouped as an array
instance.parseTabDelimitedString('p1\t0.5\t0.3\t0.2\np2\t0.4\t0.2\t0.9');
Parameters:
{string} text
the tab delimited string

startWizzard()
Open the first parameter dialog to choose which column of the file should be loaded. It requires that a file(or a string) have been parsed previously because it uses the value in the attribute expressions.
instance.startWizzard();

wizzardStep2()
Open the second parameter dialog to choose the range of expression values and their correspondent colors. It requires that a file(or a string) have been parsed previously because it uses the value in the attribute expressions.
instance.startWizzard();
Event Detail
onError(actionPerformed)
instance.onError(
   function( objEvent ) {
   	alert("ERROR: "+ objEvent.error);
   }
);
Parameters:
{function} actionPerformed
A function which receives an Biojs.Event object as argument.
Event object data:
{Object} source
The component which did triggered the event.
{String} error
a string describing the type of error.

onFileLoaded(actionPerformed)
instance.onFileLoaded(function( objEvent ) {
					    alert("File loaded");
						var expression =objEvent.expressions,
							color=objEvent.colorData;
						var i=0;
						$('output').append("

"); for (var p in expression){ if (i++==40) break; var value=1*expression[p][objEvent.column*1]; $('output').append("
"+p+" ("+value+")"); } });
Parameters:
{function} actionPerformed
A function which receives an Biojs.Event object as argument.
Event object data:
{Object} source
The component which did triggered the event.
{Object} expressions
a hash array containing the values loaded with the protein id(first column in the file) as the key and an array of numbers(expression data) as the value.

onFileRemoved(actionPerformed)
					instance.onFileRemoved(function( objEvent ) {
					    alert("File removed");
						$('output').html("");
					});
Parameters:
{function} actionPerformed
A function which receives an Biojs.Event object as argument.
Event object data:
{Object} source
The component which did triggered the event.

Documentation generated by JsDoc Toolkit 2.3.2 on Fri Aug 23 2013 13:38:37 GMT+0100 (BST)