The UK Crop Plant Bioinformatics Network

BrassicaDB Tutorial

ACEDB and Queries


[Previous | Contents | Next]

BrassicaDB uses the ACEDB database software and all the database access methods use ACEDB to handle the data. This means that we have to deal with ACEDB's peculiarities. The most important thing to bear in mind is that ACEDB has its own query language, and while many of the interfaces try to insulate you from this, it is still used to process your data requests and will usually be available for direct use. The other factor to remember is that ACEDB's major strength is its capability for data browsing. This makes it ideal for 'follow on' enquires.

Note that in many cases you may be able to get to the data required by just browsing the database. This should be assisted by the naming conventions used for the objects in each class. However there are going to be times where this is not a suitable approach, so time to think about queries.

The ACEDB query language

ACEDB query language can be quite powerful, and will often be the most useful starting point when it comes to answering real queries. The problem with the query language is it often involves you having to understand the internal structure of the database. While this may seem like a large problem initially it actually turns out to be no big problem at all.

In many cases the question you want the answer to, will involve keywords. You can look for these without having to know anything about the database structure by using the grep and longgrep commands. These perform text searches of the database looking for the word or phrase you specified. Tip: if grep doesn't work try longgrep (in some cases this approach may have to be combined with narrowing queries).

For more specific queries, you can either go looking for the data you require by browsing the database or build a more structured query. For this you will need to know about the structure of the database (commonly known as the model). Many of the query interfaces will try to help when it comes to this part, by providing a guide to the model of the current class, but some do not. So how do we get a look at the model? Well this may depend on the access method being used. For instance when using Webace, if you know which class you are interested in, then selecting that class and then using the query system, will provide you with a view of that class's model, but in AceBrowser you are expected to know the model before you make a query.

Generally (some interfaces do not support this), you will be able to look at the database's model by looking at the Model class and the objects it contains. In some cases you may find it useful to use one method to look at the model and another to perform the query.

Back to the query language. The ACEDB query syntax is generally quite readable and will be easy to get to grips with for simple queries. More complex queries are just an extension of the same system.

The summary of the ACEDB query language commands presented below is intended as a reminder of the syntax used and not as a discussion of the language itself. If you need to know more about the ACEDB query language then take a look at one of the guides at the ACEDB documentation library. I have found the About ACEDB Queries (Gail Juvik) guide a particularly useful guide to the language.

  1. The query language supports wildcards *, ? and #, corresponding to anything, any character and any digit respectively.
  2. Find / find
  3. =, EQUAL, >, GT, <, LT, >=, <=
  4. &, AND, |, OR, !, NOT, ^, XOR
  5. NEXT & HERE
  6. ;
  7. COUNT
  8. Follow
  9. Don't worry if this seems a bit confusing, you will get the hang of how, and when, to use the query language by using it.

    Sample Queries

    Some sample queries to give you a feel for how it works.

    • find Locus pW*

      Finds all the loci described by pW probes.

    • find Sequence * Other_Pep_homol

      Find all the sequences with other peptide homologies (e.g. SPTrEMBL BLASTX results).

    • find Protein * !Corresponding_DNA

      Find all proteins without corresponding DNA sequences.

    • find Other_Protein * Pick_me_to_call=AGR_protein

      Find all the protein entries which have links to AGR.

    AQL

    A recent addition to the traditional ACEDB query language is AQL. AQL is similar to SQL & OQL and in a similar way the query results are always displayed as a table. This ability is an important addition to ACEDB's capabilities since previous versions of ACEDB required that an object describing the table be created.

    For more information on AQL, as well as a guide to syntax see http://www.sanger.ac.uk/Software/Acedb/whelp/AQL/.

    At the moment only the text based interfaces (tace, aceclient) and CITA / GFace support AQL. In time this will probably change, but at the moment if your problem requires a tabular answer, and you have to remote access the database then you can use either TableMaker or AQL to phrase your query. For both AQL and TableMaker you should look at the documentation before attempting your query (see the ACEDB documentation library).

    [Previous | Contents | Next]