Skip to content

Endpoints: Lookup

Christopher Maclean edited this page Feb 23, 2021 · 4 revisions

wormbase_parasite.endpoint_groups.lookup

LookupMixin

LookupMixin(self, /, *args, **kwargs)

A mixin with methods for accessing the Information section of the Wormbase ParaSite REST API

This mixin provides access to the following endpoints:

GET /lookup/id/:id
POST /lookup/id
GET /lookup/symbol/:species/:symbol
POST /lookup/symbol/:species/:symbol

Any arguments listed with a * are required

lookup_by_id

LookupMixin.lookup_by_id(self, id, db_type=None, expand=False, format='full', species=None)

GET lookup/id/:id

Arguments

  • id* (str): A stable ID
  • db_type (str): Default: None
  • expand (boolean): Default: False
  • format (str): Must be one of ['full', 'condensed'] Default: 'full'
  • species (str): Default: None

Example

client = wormbase_parasite.WormbaseClient()
client.lookup_by_id('WBGene00221255')

Returns

data (dict): a dictionary representing the data returned by the API

See also: https://parasite.wormbase.org/rest/documentation/info/lookup

batch_lookup_by_id

LookupMixin.batch_lookup_by_id(self, ids, db_type=None, expand=False, format='full', object_type=None, species=None)

POST lookup/id

Arguments

  • ids* (str or list): A comma-separated string of gene IDs, or a list of these IDs
  • db_type (str): Default: None
  • expand (boolean): Default: False
  • format (str): Must be one of ['full', 'condensed'] Default: 'full'
  • object_type (str): Default: None
  • species (str): Default: None

Example

client = wormbase_parasite.WormbaseClient()
id_list = ["WBGene00221255", "__VAR(gene_stable_id_2)__" ]
client.batch_lookup_by_id(id_list)
id_string = "WBGene00221255,__VAR(gene_stable_id_2)__"
client.batch_lookup_by_id(id_string)

Returns

data (dict): a dictionary representing the data returned by the API

See also: https://parasite.wormbase.org/rest/documentation/info/lookup_post

get_symbol_from_external_db

LookupMixin.get_symbol_from_external_db(self, species, symbol, expand=False, format='full')

GET lookup/symbol/:species/:symbol

Arguments

  • species* (str): Species name/alias
  • symbol* (str): A name or symbol from an annotation source that has been linked to a genetic feature
  • expand (boolean): Default: False
  • format (str): Must be one of ['full', 'condensed'] Default: 'full'

Example

client = wormbase_parasite.WormbaseClient()
client.batch_lookup_by_id('brugia_malayi_prjna10729', 'Bm994')

Returns

data (dict): a dictionary representing the data returned by the API

See also: http://parasite.wormbase.org/rest/documentation/info/symbol_lookup

batch_get_symbol_from_external_db

LookupMixin.batch_get_symbol_from_external_db(self, species, symbols, expand=False, format='full')

POST lookup/symbol/:species

Arguments

  • species* (str): Species name/alias
  • symbols* (str or list): A comma-separated string of symbols, or a list of these symbols
  • expand (boolean): Default: False
  • format (str): Must be one of ['full', 'condensed'] Default: 'full'

Example

client = wormbase_parasite.WormbaseClient()
symbol_list = ["Bm994", "__VAR(gene_symbol2)__"]
client.batch_get_symbol_from_external_db('brugia_malayi_prjna10729', symbol_list)
symbol_string = "Bm994,__VAR(gene_symbol2)__"
client.batch_get_symbol_from_external_db('brugia_malayi_prjna10729', symbol_string)

Returns

data (dict): a dictionary representing the data returned by the API

See also: https://parasite.wormbase.org/rest/documentation/info/symbol_post

Clone this wiki locally