EnrichNet - Web-service API
To enable a programmatic access to EnrichNet and facilitate the execution of multiple analyses, EnrichNet provides a simple web-service API using RESTful calls. On this page we provide the general specification and an example python script for the submission of a typical analysis.



1. General API specification


One of the most common tasks in the analysis of gene and protein lists obtained from an experiment or from the literature is the assessment of putative functional associations between these genes/proteins and known cellular processes, pathways and complexes.

URLhttps://lcsb-enrichnet-server.uni.lu/enrichnet/index.php
MethodGET
Querystringgenes=String containing comma-separated gene/protein names
idtype=Name of the gene/protein identifier. This is one of:
  • ensembl
  • hgnc_symbol
  • refseq_dna
  • uniprot_swissprot
pathdb=The chosen pathway database. This is one of:
  • kegg
  • biocarta
  • reactome
  • wiki
  • nci
  • interpro
  • gobp
  • gomf
  • gocc
graph=The chosen molecular interaction network. This is one of:
  • string
  • bossi
Returns200 OK & URL to temporary web-page with results notification
401 Unauthorized
404 Not Found

To run an analysis with a self-defined molecular interaction network, a further programmatic interface has been made available to upload tab-delimited network files onto the server, which can be analyzed using the other web-service methods afterwards.

URLhttps://lcsb-enrichnet-server.uni.lu/enrichnet/fileupload.php
MethodPOST
VariablesupFile=Inform the server that a file is uploaded. Value should always be "yes"
file=The file to be uploaded encoded as multipart form data (see Python example below)
Returns200 OK & HTML-code of the acknowledgement web-page
401 Unauthorized
404 Not Found




2. Python example source code


The Python script below submits a gene list consisting of 5 genes in ENSEMBL-format to EnrichNet, for an enrichment analysis on the BioCarta database and using molecular interaction data from the STRING database.

#!/usr/bin/env python

# The urllib and urllib2 libraries need to be installed!
import urllib
import urllib2

# Here, the genes, the identifier format, the pathway database and the network are specified
genes = 'ENSG00000113916,ENSG00000068024,ENSG00000108840,ENSG00000061273,ENSG00000005339'
idtype = 'ensembl'
pathdb = 'biocarta'
graph = 'string'

url = 'https://lcsb-enrichnet-server.uni.lu/enrichnet/index.php'
params = urllib.urlencode({  'genestr':genes,  'idtype':idtype, 'pathdb':pathdb, 'graph':graph})

# As a result a hyperlink to a temporary web-page is generated, on which the user will be redirected
# to the interactive results page, once the results are available
response = urllib2.urlopen(url+'?'+params).read()


In order to upload your own molecular networks as input files programmatically, you can download the following extended script as a template (including a tab-delimlited example network file):

Download Python example source code for uploading self-defined networks