On 6 Feb 2007, at 14:00, David Withers wrote:

How can I determine the ordering of query results when using
martservice? I thought that the order was determianed by the order of
the attributes in the query. However, in the following query:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Query>
<Query virtualSchemaName="default" count="0" softwareVersion="0.5"
requestId="taverna">
 <Dataset name="uniprot">
  <Attribute name="sptr_ac" />
  <Attribute name="uniprot_gene_sequence" />
  <Filter name="superregnum_name" value="archaea" />
  <Filter name="proteome_name" value="Aeropyrum pernix" />
 </Dataset>
</Query>

the results are returned in the order 'uniprot_gene_sequence, sptr_ac'.


Hi  David,
We have now done a little investigation here and unfortunately this is going to remain an apparent exception to the rule for a little while longer. The ordering of the result columns as you correctly point out is determined by the dataset order first (if there is more than one of course) and then by ordering attributes within individual datasets. Since in most cases you have control over both(the datasets need to be visible and that's what you deal with most of the time)
you can always determine the order of the results.

However, we do have a concept of an invisible dataset in mart. This dataset is added implicitly during query execution on the server side and although it does actually follow the same rules as ordering of visible datasets ei dataset order first, attribute order second, the user has no control over explicit ordering of datasets in this case and this results in the inconsistency as reported in your example.

Fortunately all other invisible datasets either have no attributes or there are other alternative arrangements in place so they can be used 'safely'. The only exception is GenomicSequence so each time you request an attribute from genomic sequence, the order will be rigidly defined. I am afraid for now you will have to live with that and simply treat a few of these attributes differently from the others. We do accept that this inconsistency is annoying and In the long run we'll try to come up with a more user friendly arrangement

BTW, if you need this for your FASTA formatting purposes, you can always request FASTA format
from martservice and this will always come formatted correctly

a.



David.

-- David Withers
School of Computer Science, University of Manchester,
Oxford Road, Manchester, M13 9PL, UK.
Tel: +44(0)161 275 0145



------------------------------------------------------------------------ -------
Arek Kasprzyk
EMBL-European Bioinformatics Institute.
Wellcome Trust Genome Campus, Hinxton,
Cambridge CB10 1SD, UK.
Tel: +44-(0)1223-494606
Fax: +44-(0)1223-494468
------------------------------------------------------------------------ -------



Reply via email to