next up previous contents
Next: Searching for SGML Tags Up: Searching Functions Previous: Searching Arrays

Searching Sequence Databases

Calling Sequence:
SearchDb( $pat_{1}, pat_{2}, \ldots, pat_{k}$)
pati : { string, set(string)}

Returns: An Entry structure.

Synopsis: The SearchDb function searches the sequence database currently assigned to system variable DB. When pati consists of a set of strings, the function returns the logical OR of the results (all entries containing at least one of the elements in the set pati. The comma symbol represents the logical AND of the arguments. In this case, SearchDb returns only those Entry that contain all such patterns.


> DB := ReadDb('Sample/SH2');   # load the SH2 database & assign it to DB
> SearchDb('mouse');     # returns all Entry() which contain the pattern 'mouse'.
> SearchDb('SH3');
> SearchDb('mouse', 'SH3');       # return all Entry() which contain both
>                                 # 'mouse' and 'SH3'. Entry(64) and Entry(78) 
>                                 # contain mouse but not SH3.
> SearchDb({'mouse', 'human'});   # return all Entry() which contain
>                                 # human or mouse
> SearchDb('SH3', {'mouse', 'human'}); # return all Entry() which contain
>                                      # (SH3 and (mouse or human))

Gaston Gonnet