Wiki

Clone wiki

enterobase-web / api_lookup

underconstruction_minions.png

Top level links:

The lookup query method

Refer to interactive documentation : http://enterobase.warwick.ac.uk/api/v2.0/swagger-ui#!/Lookup

The lookup query method allows lookup of any EnteroBase barcode. (Barcodes for any type of data can be looked up with lookup. It is like a "Swiss army knife" query method and usually a query method specific to a particular type of data will be more suitable e.g. the assemblies query method for queries relating to assemblies.)

An example of this type of query to try in the interactive documentation is to set "barcode" to "SAL_AA0001AA_LO"

which is equivalent to an HTTP request to the URL:

http://enterobase.warwick.ac.uk/api/v2.0/lookup?barcode=SAL_AA0001AA_LO

which looks up a locus barcode and gives the result

not really working right now...

(Looking up assembly barcodes apparently does not work at present either.)

Another example for looking up a scheme barcode sets the barcode to "SAL_AA0010AA_SC" (for the cgMLST version 4 scheme in Salmonella):

http://enterobase.warwick.ac.uk/api/v2.0/lookup?barcode=SAL_AA0010AA_SC

giving the result

{
  "records": 1,
  "results": [
    {
      "accepted": 1,
      "barcode": "SAL_AA0010AA_SC",
      "create_time": "2016-01-27 17:39:55.279130",
      "detail": "",
      "index_id": 10,
      "info": {
        "ext_db": null,
        "ext_site": null,
        "incremental": false,
        "max_flanking": 30,
        "merging_error": 0.08,
        "merging_prop": 0.5,
        "min_flanking": 9,
        "min_frag_len": 50,
        "min_frag_prop": 0.3,
        "min_frag_sum": 0.45,
        "min_iden": 0.75,
        "min_prop": 1,
        "position": false,
        "ref_iden": 0.96,
        "value_type": "text"
      },
      "lastmodified": "2016-02-11 18:20:43.713484",
      "lastmodified_by": "enterotool",
      "mode": "MLST",
      "scheme": "cgMLSTv4",
      "table_alias": {
        "STs": "STs",
        "alleles": "alleles",
        "loci": "loci",
        "nomenclature_records": "nomenclature_records",
        "refsets": "refsets",
        "schemes": "schemes",
        "taxa": "taxa"
      },
      "taxon_index": 1,
      "value_alias": {
        "ST_id": "ST_id",
        "ST_index": "ST_index",
        "STs": "STs",
        "Strain_barcode": "Strain_barcode",
        "accepted": "accepted",
        "allele_id": "allele_id",
        "allele_index": "allele_index",
        "allele_indices": "allele_indices",
        "allele_name": "allele_name",
        "alleles": "alleles",
        "contig_name": "contig_name",
        "detail": "detail",
        "fullname": "fullname",
        "info": "info",
        "loci": "loci",
        "locus": "locus",
        "locus_index": "locus_index",
        "mode": "mode",
        "nomenclature_records": "nomenclature_records",
        "prefix": "prefix",
        "ref_allele": "ref_allele",
        "reference": "reference",
        "refname": "refname",
        "refsets": "refsets",
        "scheme": "scheme",
        "schemes": "schemes",
        "seq": "seq",
        "start": "start",
        "stop": "stop",
        "taxa": "taxa",
        "taxon": "taxon"
      },
      "version": 2
    }
  ]
}

Another example of this type of query to try in the interactive documentation which is also on the page about the API structure (which also has a discussion of barcodes) is to have "barcode" equal to "SAL_AA0019AA_ST" which is equivalent to an HTTP request to the URL:

http://enterobase.warwick.ac.uk/api/v2.0/lookup?barcode=SAL_AA0019AA_ST

which gives the result (concerning Sequence Type 19, Salmonella Typhimurium)

{
  "records": 1,
  "results": [
    {
      "ST_id": 19,
      "accepted": 1,
      "alleles": [
        {
          "accepted": 1,
          "allele_id": 10,
          "allele_name": null,
          "locus": "aroC"
        },
        {
          "accepted": 1,
          "allele_id": 7,
          "allele_name": null,
          "locus": "dnaN"
        },
        {
          "accepted": 1,
          "allele_id": 12,
          "allele_name": null,
          "locus": "hemD"
        },
        {
          "accepted": 1,
          "allele_id": 9,
          "allele_name": null,
          "locus": "hisD"
        },
        {
          "accepted": 1,
          "allele_id": 5,
          "allele_name": null,
          "locus": "purE"
        },
        {
          "accepted": 1,
          "allele_id": 9,
          "allele_name": null,
          "locus": "sucA"
        },
        {
          "accepted": 1,
          "allele_id": 2,
          "allele_name": null,
          "locus": "thrA"
        }
      ],
      "barcode": "SAL_AA0019AA_ST",
      "create_time": "2015-11-24 19:59:36.295460",
      "index_id": 19,
      "info": {
        "lineage": "",
        "predict": {
          "serotype": [
            [
              "Typhimurium",
              7372
            ],
            [
              "Typhimurium Var. 5-",
              440
            ],
            [
              "Typhimurium Var. O:5-",
              208
            ]
        },
        "st_complex": "1",
        "subspecies": ""
      },
      "lastmodified": "2017-02-19 01:44:21.503891",
      "lastmodified_by": "admin",
      "reference": {
        "lab_contact": "DVI",
        "refstrain": "9924828",
        "source": "mlst.warwick.ac.uk"
      },
      "scheme": "UoW",
      "scheme_index": 1,
      "version": 4885
    }
  ]
}

Looking up an allele barcode with:

http://hercules.warwick.ac.uk/api/v2.0/lookup?barcode=SAL_AP0358AA_AL

obtains the result

{
  "records": 1,
  "results": [
    {
      "_combo_tag": "1_716",
      "accepted": 1,
      "allele_id": 716,
      "allele_name": null,
      "barcode": "SAL_AP0358AA_AL",
      "create_time": "2017-04-14 06:58:05.463744",
      "index_id": 3900358,
      "lastmodified": "2017-04-14 06:58:05.463744",
      "lastmodified_by": "admin",
      "locus": "aroC",
      "locus_index": 1,
      "reference": {
        "refstrain": "SAL_FA3594AA_AS",
        "source": "mlst.warwick.ac.uk"
      },
      "scheme": "UoW",
      "seq": "GTGTTCCGTCCGGGGCACGCGGATTACACCTACGAACAAAAATACGGCCTGCGCGACTATCGCGGCGGCGGGCGTTCATCCGCCCGTGAAACCGCCATGCGCGTCGCGGCAGGCGCTATCGCCAAAAAATATCTGGCGCAGAAATTCGGCGTGGTGATTCGCGGCTGCCTGACCCAGATGGGTGATATTCCGCTGGAAATCAAAGACTGGGATCAGGTAGAGCAAAACCCGTTCTTCTGCCCGGACCCGGATAAAATCGAGGCGCTGGATGAGCTGATGCGCGCTCTGAAAAAAGAGGGCGATTCCATCGGCGCGAAAGTCACCGTGGTGGCCGACAGCGTGCCCGCCGGGCTTGGCGAGCCGGTATTTGACCGCCTGGACGCCGATATCGCCCACGCGCTGATGAGCATTAACGCCGTGAAGGGCGTGGAAATCGGCGACGGTTTCGGCGTGGTGCAACTGCGCGGCAGCCAGAACCGCGACGAAATCACCACTGCCGGT",
      "version": 1
    }
  ]
}

Updated