NeuroProDB - Web-service API
To enable a programmatic access to NeuProDB and facilitate the extraction of information from the database for individual genes/proteins and identifier lists, a simple
web-service API is provided using RESTful calls. On this page we provide the general specification and an example python script for
the submission of a typical data retrieval.
1. General API specification
To search for gene and protein lists obtained from an experiment or from the literature within the NeuroProDB database and retrieve the stored information for the matched identifiers,
a simple query url can be submitted, and will results in the generation of a text-file or json-file, depending on the user's choice.
URL | lcsb-repexplore-cdc.lcsb.uni.lu/neuroprodb/api.php |
Method | GET |
Querystring | genes= | String containing comma-separated gene/protein names |
idtype= | Name of the gene/protein identifier. This is one of:- gene_symbol
- ensembl
- entrezgene
- uniprot_swissprot_id
- uniprot_swissprot_acc
|
output= | The chosen output format (tab-delimited text or JSON-format). This is one of: |
Returns | 200 OK & URL to the output file (containing the results or an error message if no query gene was found in the database) |
401 Unauthorized |
404 Not Found |
2. Python example source code
The Python script below submits a gene list consisting of 5 genes in HGNC gene symbol format to the NeuroProDB API, to retrieve the corresopnding information in the database, using a tab-delimited (txt) output format.
#!/usr/bin/env python
# The urllib and urllib2 libraries need to be installed!
import urllib
import urllib2
# Here, the genes, the identifier format, and the output type (json- or txt-file) are specified
genes = 'MANF,FGF1,ADNP,MDK,ARTN'
idtype = 'gene_symbol'
output = 'txt'
url = 'https://lcsb-repexplore-cdc.lcsb.uni.lu/neuroprodb/api.php'
params = urllib.urlencode({ 'genes':genes, 'idtype':idtype, 'output':output})
# As a result a hyperlink to the output-file is generated
response = urllib2.urlopen(url+'?'+params).read()
|
|