Searches via Web Services


TrichDB provides programmatic access to its searches, via REST Web Services. The result of a web service request is a list of records (genes, ESTs, etc) in either XML or JSON format. REST services can be executed in a browser by typing a specific URL.

For example, this URL:
http://TrichDB.org/webservices/GeneQuestions/GenesByMolecularWeight.xml?
min_molecular_weight=10000&
max_molecular_weight=50000&
reference_strains_only=Yes&
organism=Trichomonas vaginalis&
o-fields=gene_type,organism


Corresponds to this request:
Find all (Trichomonas vaginalis) genes that have molecular weight between 10,000 and 50,000.
For each gene ID in the result, return its gene type and organism.
Provide the result in an XML document.



Downloading DNA sequences in a text file in FASTA format:

For specific genomic segments: For gene related regions:


WADLs: how to generate web service URLs

Click on a search below to access its WADL (Web Application Description Language).
  • A WADL is an XML document that describes in detail how to form a URL to call the search as a web service request. For more details go to How to read a WADL at the bottom of this page.
  • Note: some browsers (e.g.: Safari) do not know how to render an XML file properly (you will see a page full of terms with no structure).
  • To construct the URL in the example above, you would check the Molecular Weight WADL located below under Protein Attributes



How to read a WADL

  • (1) What is the name and purpose of the search.
    Under <method name=....>
    In our example: <doc title="description">Find genes whose ..... Molecular weights are ......</doc>

  • (2) What is the service URL.
    Under <resource path=....>.
    It includes an extension that indicates the format requested for the result (XML or JSON).
    In our example: http://TrichDB.org/webservices/GeneQuestions/GenesByMolecularWeight.xml

  • (3) How to constrain your search.
    Under <param name=.....>.
    If a default value is provided under <doc title="default">.....</doc>, then providing the parameter is optional.
    In our example: min_molecular_weight=10000, max_molecular_weight=50000.

  • (4) What to return for each ID in the result.
    Under <param name=.....> too.
    These are the same for all searches of a given record type (e.g., for all gene searches). Output-fields are single-valued attributes while output-tables are multi-valued (array).
    In our example: o-fields=gene_type,organism_full&o-tables=EcNumber