Bilab Quick-start

The Bilab main window is comprised of distinct views. To the left is the interactive Console view where scigol language expressions and commands can be entered. The view in the lower right is Value view (probably where you are reading this). It displays values that have been selected in the Environemt view above, or values evaluated using the .show console command.

The Environment view displays a heirarchical tree of the objects available, such as functions that can be called, values of any type - such as numbers, lists, molecules etc. Selecting an object in the Environment view will cause its value to be display in the Value view - invoking any special viewers that are available depending on the type of the object.



Entering Scigol expressions

Try out some simple Scigol expressions in the console view:

3+(6*9)

You should see the value of the result displayed. You can call functions by enclusing their arguments (if any) within parenthesis after their name:

sqrt(5)

To see the type of the function (a func in Scigol parlance), type:

typeof(sqrt)

The result you see:

sqrt: func(r:real -> real)

is called the function's signature. In this case it reads: a function taking a single parameter, named r – that is a real number, and giving a real number in return. More information about a function, or any object, may be obtained by typing (for exampel):

.help sqrt

You can also assign variables in the console as follows:

s3 = sin(3)

Notice that the value of the right-hand-side (RHS) expression was displayed in addition to being assigned to the variable s3. To suppress the display of expression evaluation, suffix the line with a semi-conol ';'.

For example, suppose we want to assign the variable z to a 3-dimensional vector of zeros. There is a function named zero that does just what we want:

z = zero(3);

The value of the expression (a vector) wasn't displayed. We can easily display it by typing the variable alone as an expression:

z

By default, there are some sample objects in the global environment. For example, there is a list of numbers named gilist that has been predefined. To see its value just enter:

gilist

All lists in Scigol are represented by round parenthesis with comma seperated elements. A list can contain any type of elements and thet need not be all the same. A list can be indexed by using the function call notation and passing the index as argument, like:

gilist(0)

You can also index ranges of list elements like this:

gilist(0..2)
gilist(0..-3)

(Negative indices are counted from the end of the list instead of the beginning)

There are many other types, such as vector, matrix, map, class and others. Try some of these expressions:

v = [1 2 3]
v2 = [4 5 6]
v3 = v*2+v2
#v3
|v3|
zeromat = zero(2,2)
m1 = [1 2; 3 4]
m2 = [5 6; 7 8]
m1*m2+m2
mymap = [ 1 -> 2; 2 -> 4; 3 -> "thend" ]
mymap(3)

Biological types

By default, there are some sample object in the global environment. For example, a DNA sequence named d has been pre-defined. To view it simply enter it as an expression:

d

The variable d is an object of type DNA. As there is a custom viewer available for DNA, the viewer has been displayed in-line in the console (in this case it is an Artemis based viewer).

[*NB: in the current implementation there is only a single viewer choice per type and there are no viewer menus or options implemented]

There is also a pre-defined variable p containing a protein sequence:

p
avgisomass(p)

The genbank function takes a NCBI Genbank GI number, or list of GI numbers, and retrieves their sequences from the internet. Try this:

d3 = genbank( gilist(3) )
#d3

You can transcribe that into RNA thus:

r3 = transcribe(d3);

or directly into a protein (1st frame):

p3 = translate(d3)

While this protein has no structure information, a predefined sample protein with strucutre is declared as variable p2:

p2

As you can see, there is a custom viewer (based on JMol) for protein molecules.

Alignments

Suppose you have a set of protein sequences that you'd like to run through the ClustalW program to obtain an alignment. You can type the following to run ClustalW on proteins p, the translation of DNA d2 and protein dequence p3; first put them into a list and then invoke the clustalw function (or simply type the list directly as the argument to the function):

slist = ( p, translate(d2), p3 )
clustalw(slist)

The result of the function is an alignment – another Bilab type. The result is also displayed in a custom viewer for alignments (JalView based).

Learning about the library

The easiest way to learn about the available functions and object in the Bilab library is to browse using the Environment view and to get help on functions using the .help command. Many functions has extensive help available. For example:

.help antigenic



[*NB: Very little help text has been written in the current Bilab implementation prototype]



TODO hit-list: