miRGate ResT API

The miRGate API allows programmers to access miRGate data in a programmatic way, through a RESTful Web Service. Using this service, the server can be accessed from multiple programming languages, allowing researchers to wire miRGate results to their experiments. At this time, the API offers the gene retrieval operations, including data source listing, catalog listing and query execution.

Like any RESTful Web Service, operations are performed via web queries with a well-defined URL structure. The server API is located at http://mirgate.bioinfo.cnio.es/ResT

Data Source Listing

Lists all data source that the server can access at this moment. The URL is:

http://mirgate.bioinfo.cnio.es/ResT/API/

Query Execution

Executing a query on a data source is performed via:

http://mirgate.bioinfo.cnio.es/ResT/API/{organism}/{datasource}/{query}

All possible values for {organism} and {datasource}, can be obtained form the previous link at http://mirgate.bioinfo.cnio.es/ResT/API/

In the case of constrained query data API, the {query} must be a valid id of the catalog. This URL could be an example:

http://mirgate.bioinfo.cnio.es/ResT/API/human/miRNA_gene_predictions/hsa-miR-1/TP53

Get available namespaces for conversion

Getting the available namespaces for conversion of genesets is done via the gene_info source

http://mirgate.bioinfo.cnio.es/ResT/API/rat/gene_info/Nfkbib

http://mirgate.bioinfo.cnio.es/ResT/API/mouse/gene_info/ILMN_1238558

http://mirgate.bioinfo.cnio.es/ResT/API/human/gene_info/ENSG00000106077

For miRNAs miRNA_info, accepts serveral namespaces :

For miRNA names : http://mirgate.bioinfo.cnio.es/ResT/API/human/miRNA_info/hsa-miR-329

For miRNA accesions : http://mirgate.bioinfo.cnio.es/ResT/API/rat/miRNA_info/MIMAT0012831

For Probes : http://mirgate.bioinfo.cnio.es/ResT/API/mouse/miRNA_info/A_54_P2281

Retrieve predictions stored in miRGateDB

Getting predictions for miRNA/Gene of interest are available through several methods:

For a miRNA and a gene : gene_miRNA_predictions or miRNA_gene_predictions: http://mirgate.bioinfo.cnio.es/ResT/API/human/miRNA_gene_predictions/hsa-miR-1/TP53

For just a gene : gene_predictions: http://mirgate.bioinfo.cnio.es/ResT/API/rat/gene_predictions/Mapkapk5

For a miRNA : miRNA_predictions: http://mirgate.bioinfo.cnio.es/ResT/API/rat/miRNA_predictions/MIMAT0000858

In the case of predictions a filtering, method is also possible. This URL could be an example:

http://mirgate.bioinfo.cnio.es/ResT/API/human/gene_miRNA_predictions/ABCD1/MIMAT0007883/Rnahybrid

Get experimentally confirmed targets

Getting the available experimentally confirmed targets :

For a miRNA and a gene : gene_miRNA_confirmed or miRNA_gene_confirmed: http://mirgate.bioinfo.cnio.es/ResT/API/human/miRNA_gene_confirmed/hsa-miR-1/ABHD11

For just a gene : gene_confirmed: http://mirgate.bioinfo.cnio.es/ResT/API/human/gene_confirmed/ABHD11

For a miRNA : miRNA_confirmed: http://mirgate.bioinfo.cnio.es/ResT/API/mouse/miRNA_confirmed/MIMAT0000246

Programatic Access : Example Scripts

Script to print Basic Information about miRGateDB. Download from here.

 1 
 2 #
 3 #
 4 #  Created by Eduardo Andres Leon .
 5 #  Copyright (c) 2015 CNIO. All rights reserved.
 6 #  eandres@cnio.es
 7 
 8 #!/usr/bin/perl
 9 $|=1;
10 use strict;
11 use XML::LibXML;
12 
13 my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API";
14 
15 my $parser = XML::LibXML->new();
16 my $xmldoc = $parser->parse_file($SourceListingURL);
17 
18 #######################################################Listing basic information stored in miRGate Database################################################################# 
19 
20 print "\nmiRGate contains information for " . scalar(@{$xmldoc->findnodes('/miRGate/organism/commonName')}) . " organisms :\n\n";
21 foreach my $organism ($xmldoc->findnodes('/miRGate/organism/commonName')) {
22  	print "For " .$organism->textContent() ." contains " .scalar(@{$xmldoc->findnodes('/miRGate/organism/'.$organism->textContent().'/method')}) . " different sources:\n";
23 	foreach my $method ($xmldoc->findnodes('/miRGate/organism/'.$organism->textContent().'/method')) {
24 		foreach my $met ($method->childNodes()){
25 			if($met and $met->localname){
26 				print "\t". $met->localname .": " . $met->textContent."\n" if ($met->localname eq "name");
27 			}
28 		}
29 	}
30 }
31 print "\n";
32 
33 ##############################################################################################################################################################################
34 
35 __END__

Script to retrieve all sources to make query with. Download from here.

 1 #
 2 #  Created by Eduardo Andres Leon .
 3 #  Copyright (c) 2015 CNIO. All rights reserved.
 4 #  eandres@cnio.es
 5 
 6 #!/usr/bin/perl
 7 $|=1;
 8 use strict;
 9 use XML::LibXML;
10 
11 my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API";
12 
13 my $parser = XML::LibXML->new();
14 my $xmldoc = $parser->parse_file($SourceListingURL);
15 
16 
17 #######################################################How to make questions to miRGate Database############################################################################## 
18 
19 print "\nmiRGate contains " . scalar(@{$xmldoc->findnodes('/miRGate/sources/source_name')}) . " different sources :\n\n";
20 foreach my $source ($xmldoc->findnodes('/miRGate/sources/source_name')) {
21  	print "\t". $source->textContent() ."\n";
22 }
23 print "\n";
24 ##############################################################################################################################################################################
25 
26 __END__

Script to retrieve all experimentally validated targets from a couple of genes of interest. Download from here.

 1 
 2 #
 3 #  Created by Eduardo Andres Leon .
 4 #  Copyright (c) 2015 CNIO. All rights reserved.
 5 #  eandres@cnio.es
 6 
 7 #!/usr/bin/perl
 8 $|=1;
 9 use strict;
10 use XML::LibXML;
11 
12 my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API";
13 
14 my $parser = XML::LibXML->new();
15 my $xmldoc = $parser->parse_file($SourceListingURL);
16 
17 #######################################################Example : retrieve experimentally validated information about my genes of interest##################################### 
18 
19 my $parser = XML::LibXML->new();
20 
21 my $working_organism="human";
22 my @genes_of_interest=("TP53","TBCCD1");
23 
24 #Using the source gene_confirmed
25 my $source="gene_confirmed";
26 foreach my $gene (@genes_of_interest){
27 	my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API/$working_organism/$source/$gene";
28 	my $xmldoc = $parser->parse_file($SourceListingURL);
29 	print "There is/are " . scalar(@{$xmldoc->findnodes('/miRGate/search/results/result')}) . " experimentally validated experiments for $gene\n\n";
30 	my $cont=1;
31 	foreach my $confirmed_data ($xmldoc->findnodes('/miRGate/search/results/result')) {
32 		print $cont ." )";
33 	 	foreach my $confirmed_attr ($confirmed_data->childNodes()){
34 			if($confirmed_data){
35 				print "\t ". $confirmed_attr->localname .": " . $confirmed_attr->textContent."\n" ;
36 			}
37 		}
38 		$cont++;
39 		print "\n";
40 		
41 	}
42 }
43 ##############################################################################################################################################################################
44 
45 __END__

Script to obtained all predictions stored in miRGate for two genes and three miRNAs. Download from here.

 1 #
 2 #  Created by Eduardo Andres Leon .
 3 #  Copyright (c) 2015 CNIO. All rights reserved.
 4 #  eandres@cnio.es
 5 
 6 #!/usr/bin/perl
 7 $|=1;
 8 use strict;
 9 use XML::LibXML;
10 
11 my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API";
12 
13 my $parser = XML::LibXML->new();
14 my $xmldoc = $parser->parse_file($SourceListingURL);
15 
16 
17 ####################################################### Example : retrieve predicctions about my genes and miRNAs of interest ##################################### 
18 
19 my $parser = XML::LibXML->new();
20 
21 my $working_organism="human";
22 my @genes_of_interest=("TP53","TBCCD1");
23 my @miRNAs_of_interest=("hsa-miR-1","hsa-miR-605","hsa-miR-195-5p");
24 
25 #Using the source miRNA_gene_predictions
26 
27 my $source="miRNA_gene_predictions";
28 foreach my $gene (@genes_of_interest){
29 	foreach my $miRNA (@miRNAs_of_interest){
30 		my $SourceListingURL = "http://mirgate.bioinfo.cnio.es/ResT/API/$working_organism/$source/$miRNA/$gene";
31 		my $xmldoc = $parser->parse_file($SourceListingURL);
32 		print "There is/are " . scalar(@{$xmldoc->findnodes('/miRGate/search/results/result')}) . " predictions for $miRNA and $gene\n\n";
33 		my $cont=1;
34 		foreach my $predicted_data ($xmldoc->findnodes('/miRGate/search/results/result')) {
35 			print $cont ." )";
36 		 	foreach my $pred_attr ($predicted_data->childNodes()){
37 				if($pred_attr){
38 					print "\t ". $pred_attr->localname .": " . $pred_attr->textContent."\n" ;
39 				}
40 			}
41 			$cont++;
42 			print "\n";
43 		
44 		}
45 	}
46 }
47 ##############################################################################################################################################################################
48 
49 __END__