ESTHER Database

Home
Search
Tools
Families
Biological
data
Basics on AChE
ESTHER definition
What is up?
Acknowledgments
& disclaimer


AQL examples - ESTHER Database

These queries work on the ESTHER Server.

These examples make use of recent AQL features which are available in version 4.8b and above.
Some queries have been formatted over multiple lines for readability. Copy and past them in the AQLquery page or just select the link TRY it to get the results

Only a small subset of classes are used in order to simplify matters. It is essential to know the class model of any class before writing a query.
See the different class with MODEL

There are several different ways of writing each query, only some of which are ilustrated below.

Answers are given in the form of tables, at their simplest 1 column tables, which therefore resemble a list. Some requires a numerical answer having counted the number of objects which satisfy a condition.

Listing objects using conditions on tags and object names

1a. Find all Gene_locus starting with the letters human

select l from l in class Gene_locus where l.name like "human*" TRY it
select all from class Gene_locus where .name like "human*"
select all from class Gene_locus."human*" This notation is reminiscent of the Find Gene_locus human* notation of the old query-language. It may run marginally quicker than the first two queries.
select l from l in class Gene_locus."human*" The query, but using a named iterator "l".

1b. Find all Authors starting with the letters Loc

select all class author where .name like "Loc*" TRY it
Same as 1a. All the variations also apply.
select all class Author where .name like "L*" and .name like "*oc*" TRY it

2. Find all Authors with email addresses

select all class Author where exists_tag ->E_mail
The exists_tag keyword is a boolean expression, which causes the where-clause to succeed or fail depending on whether the iterator succeeds to find the tag.
The expression ->E_mail would normally be expanded to ->E_mail[1] (i.e. return the first data-field to the right of the tag), but exists_tag will inhibit this particular behaviour for the expression that follows.
select all from class Author where exists_tag ->E_mail
select a from a in class Author where exists a->E_mail[0] When using the keyword exists the normal behaviour on tag-expressions applies. In order to refer to the existence of the tag E_mail, we specify the 0'th position from the tag, i.e. the tag itself. This is the long-hand version of the first query, which will internally be converted to this query anyway before execution. Both versions are therefore identical.
select all class Author where exists_tag ->E_mail TRY it

Use of logical operators : and or xor not

3. Find all Authors whose name begins with C, and who have email addresses

select a from a in class Author where a.name like "C*" and exists_tag a->E_mail TRY it

4. Find all human alpha/beta hydrolase for which a structure is known or a mutation

select all class Gene_locus where .name like "human*" and exists_tag ->Structure or exists_tag ->Mutation TRY it
select all class Gene_locus where .name like "human*" and exists_tag ->Structure TRY it
Gene_locus with structure/ordered by family: select a,fam from a in Gene_locus, where exists_tag a->Structure, fam->Family order by :fam TRY it

4. Find all cholinesterases from a particular phylum

Cholinesterases from chordates: select a from a in Gene_locus, where a like "*-ACHE*" or a like "*-BCHE*", n in a->Species->Tax_id->Tax_name where n like "Chordata" TRY it
Cholinesterases from insects: select a from a in Gene_locus, where a like "*-ACHE*" or a like "*-BCHE*", n in a->Species->Tax_id->Tax_name where n like "Insecta" TRY it

Conditions on tags and their values

5. Families and block ordered by number of Gene_locus

select m, num,bloc from m in class Family, bloc in m->Block , num in count (select m->Gene_locus) order by :num desc TRY it

6. Inhibitors with number of kinetic parameters in the database

select a, from a in class Inhibitor, c in count(select a->kinetic_parameter) where c > O order by :a TRY it

7. Table of all papers in 2002 ordered by 1st author

select a, tit from a in class Paper, yea in a->Year where yea like "2000", tit in a->Title order by :a TRY it

8. Table of all species with more than 20 alpha/beta hydrolase genes

select m,c from m in class Species where count(select m->Gene_locus) > 20 , c in count(select m->Gene_locus) order by :c desc TRY it

9. Table of all Caenorhabditis (elegans and briggsae) alpha/beta hydrolase ordered by the protein family

select a, fam, nam from a in class Gene_locus, spec in a->Species where spec.name like "Caenorhabditis*" order by :fam, fam in a->Family, nam in a->Name order by :fam TRY it

10. Table of all human alpha/beta hydrolase ordered by protein family with name TRY it

11. Table of all mouse alpha/beta hydrolase ordered by protein family with name TRY it

12. Table of all Drosophila melanogaster alpha/beta hydrolase ordered by protein family TRY it

13. Gene_locus of bacteria with block C

select a,spec from a in class Gene_locus, bloc in a->Block where bloc.name like "C", org in a->Organism where org.name like "bacteria", spec in a->Species, pap in a->Paper order by: a TRY it

14. Gene_locus of any taxon

select a, fam2, nam from a in class Gene_locus, fam in a->Block, fam2 in a->Family, tax in a->Species->Tax_id->Tax_name where tax like "Cnidaria", nam in a->Name order by :a (change the value in order to find any othe taxon) TRY it

15. Family of any taxon

select a, fam2, nam from a in class Gene_locus, fam in a->Block, fam2 in a->Family where fam.name like "AChE", tax in a->Species->Tax_id->Tax_name where tax like "Insecta", nam in a->Name order by :a (change the value in order to find any othe taxon) TRY it

1b. Species of bacteria which have Gene_locus in block C TRY it and those with complete genome which do not TRY it

1b.

xx. Thanks to my all times collaborators

Thanks to all select b from a in class Author where a.name like "**", b in a->Paper->Author where not b.name like "**" order by :b
< DL>

xx. Search all genes in a specific taxon level (replace Amoebozoa by your choice)

go select g,s,f,b from g in class Gene_locus, t in g->Species->Tax_id->Tax_name where t like "Amoebozoa*", s in g->Species, f in g->Family, b in g->Family->Block where b like "C" order by:f

Queries designed by Arnaud Chatonnet.
INRA Montpellier, 09/Dec/2002
arnaud.chatonnet@inra.fr

Send your questions or comments to :
Mail to: Nicolas Lenfant, Thierry Hotelier, Yves Bourne, Pascale Marchot and Arnaud Chatonnet.
Please cite: Lenfant 2013 Nucleic.Acids.Res. or Marchot Chatonnet 2012 Prot.Pept Lett.
For technical information about these pages see:
ESTHER Home Page and ACEDB Home Page
AcePerl Lincoln Stein Home Page
webmaster

Acknowledgements and disclaimer