Using the database

In this tutorial you will learn about the commands and functionalities of the database commands within FELIX.

The topics covered in Lesson 1: Introduction to the database utilities are:

Lesson 1: Introduction to the database utilities

1.   Starting FELIX

After installing FELIX on your computer (see the Insight II System Guide), use the UNIX change directory (cd) command to move to your working directory.

In your working directory, enter felix at the system prompt to start the program.

The graphics interface appears with a large graphics frame, Frame 1. Program warnings and messages appear in the text window and graphical output such as plots are displayed in the graphics frame.

The FELIX database has a hierarchical structure which may be represented as in the following figure.

Files are composed of entities or tables, whose structures are defined using schema files. The entities are in turn composed of items, which are themselves an arrangement of elements. The dba file system is difficult to understand in an overall sense, but one can begin to become familiar with it by working through some of the dba utilities, as in this lesson.

2.   Closing the current dba file and creating a new one

Go to the command line by using the <Tab> key to highlight the command line tool or by going to the text window. Enter these commands (press <Enter> after typing each command):

You should now see the following in the text window:

     item page name schema
---- ---- ---- ------
1 1 dba dba

which indicates that only the default (empty) database file exists.

3.   Generating 2D cross peaks

Open any 2D spectrum. To select a small region of the 2D spectrum, enter this command:

This allows you to pick cross peaks in a region specified by a rubber- band cursor.

The pic command knows how to render the data, even without your specifying a schema explicitly. This is because the pic command knows which entity it requires and automatically uses the appropriate one (i.e., xpk.sch).

4.   Checking the database file structure and seeing how it has changed

Now enter:

You should now see the following in the text window:

     item page  name  schema
---- ----- ---- ------
1 1 dba dba
2 3 xpk dba

5.   Viewing the contents of the entity xpk

Now enter:

You should see this in the text window:

     item page  name schema
---- ----- ---- ------
1 5 peaks xpk

6.   Inquiring about particular items and elements of the entity xpk:peaks


A list of the cross peak footprints determined by the pic utility is displayed.

You can also view a table of the peaks' contents by using the Edit/Peaks menu item. This creates a special table that contains information about the peaks. You can also use this table to edit the items or cells of the entity.

You can also specify the display of a particular item in an entity.


Information similar to this appears in the text window:

     2 216.186 2.383 0 null 721.749 3.269 0 null

Next you specify a particular element in an item.


The following information is displayed:


Since the element fields are named, you can use an equivalent command:


The same information is displayed as for the preceding command:


The other database utilities have the same syntactic logic.

7.   Loading the value of an element

Now you load a value from the database using the name check.

Enter these commands:

The following value is displayed:


You can change the value of any element in the database using a identifying number.


You can also change the value of any element in the database by using names instead of numbers.

Enter these commands:

8.   Modifying schema

You begin by copying one of the existing schema, asg.sch, to a new schema with the name wrd.sch and then will edit the new schema file.

Copy the existing schema, asg.sch, to a new file named wrd.sch by entering:

at the UNIX prompt.

Edit the new wrd.sch schema file with any text editor to the following:

wrd 5
item i k 01 06 (1x,i5)
cenpnt r k 01 10 (f10.3)
wid r 01 10 (f10.3)
cenppm r k 01 10 (f10.3)
name c 32 34 (2x,a32)

9.   Passing data to and getting data from a new database entity

Generate a new entity by entering this command:

This generates a new entity with the name weird, which is based upon the schema wrd.sch, using a single occurrence of that schema.

Store a value in an element of your new entity by entering:

Equivalently, you could also enter:

Both commands specify storing the string in the entity named weird, item 1, element 5 (again note that the element fields are named).

Give that element a name by entering:

Confirm that the element has been named by entering:

You should see the following:


Write the entity to an ASCII file by entering:

         > dba entity write weird weird.txt 

Now read the ASCII file back in as another entity by entering:

         > dba entity read test weird.txt 

Confirm the success of this set of operations by entering:

         > dba element load test.1.5 newvar 
         > lis newvar 

The following should be displayed:


To view any entity via tables you can use the Edit/Table menu item. This opens a control panel from which you can choose the entity that you would like to display in a table.