This section contains a complete description of the Darwin built-in type database and details how to access the individual components of a genetic database. We begin by loading a genetic database and assigning it to the (default) system variable DB.
> DB := ReadDb('Sample/SH2');The DB name has a special status in Darwin. When performing matches on entries of a database, the matching algorithms require that the database be assigned to DB in most cases.
Table lists the various selectors available for
the structured type database. These selectors allow us access
to the information kept in the .map file.
> DB[FileName]; Sample/SH2 > DB[type]; Peptide > DB[TotAA]; 43582 > DB[TotChars]; 76825 > DB[TotEntries]; 78 > DB[Entry, 10]; 12701 > DB[Pat, 1]; 75820 > DB[string]; <DBNAME>SH2 Database</DBNAME><DBRELEASE>1.0</DBREL ..(76825).. G</SEQ></E>
Darwin allows multiple sequence databases to be loaded simultaneously. These can be assigned to any valid Darwin name. For instance,
> SP := ReadDb('~cbrg/DB/SwissProt'); # load SwissProt & > # assign it to the variable SP SP := Peptide file(/homes/cbrg/DB/SwissProt(34675450), no index, 52205 entries, 18531385 aminoacids) > EMBL := ReadDb('~cbrg/DB/EMBL39/EMBL39.fun'); # load EMBL & > # assign it to variable EMBL > DB := SP; DB := Peptide file(/homes/cbrg/DB/SwissProt(34675450), no index, 52205 entries, 18531385 aminoacids)With the assignment of SP to DB, the Swiss-Prot database becomes the current database. The type of both variables is database.
> type(SP, database); true > type(EMBL, database); trueThe system variable DB holds special status in Darwin. The database assigned to DB is the current database, that is, when any searches and matches are performed, they are performed here.