| Felix Tutorials |

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:

1. Starting Felix
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.
A dialog box for opening the database appears on the screen:
In the first dialog box, enter file.dba in the Selections box and select OK.
The name of the database file is displayed in the Felix window's title frame, confirming its selection:
The Felix database has a hierarchical structure which may be represented as in Figure 2.
Figure 2
. Felix database structure
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
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:
> pic 0 xpk:peaks 3 0
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:
> dba file show
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:
> dba entity show xpk
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
Enter:
> dba entity show 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.
Enter:
> dba item show xpk:peaks.2
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.
Enter:
> dba element show xpk:peaks.2.2
The following information is displayed:
216.186
Since the element fields are named, you can use an equivalent command:
Enter:
> dba element show xpk:peaks.2.cen1
The same information is displayed as for the preceding command:
216.186
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:
> dba element load xpk:peaks.2.cen1 check
> lis check
The following value is displayed:
216.186
You can change the value of any element in the database using a identifying number.
Enter:
> dba element store xpk:peaks.2.cen1 104.8
You can also change the value of any element in the database by using names instead of numbers.
Enter these commands:
> def check 104.8
> dba element store xpk:peaks.2.cen1 &check
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:
> cp asg.sch wrd.sch
at the UNIX prompt.
Edit the new wrd.sch schema file with any text editor to the following:
c**wrd.sch
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:
> dba entity build weird wrd 1
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:
> dba element store weird.1.5 abcdef
Equivalently, you could also enter:
> dba element store weird.1.name abcdef
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:
> dba element load weird.1.name var
Confirm that the element has been named by entering:
> lis var
You should see the following:
abcdef
The following should be displayed:
abcdef
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.