PSICQUIC is meant to be a RESTful service. Hence, it is possible to retrieve data using simple URLs through HTTP.
SOAP can be too cumbersome for some users or developers as usually a client may be needed. With REST, none of this is necessary because it is possible to do a query through HTTP and get the data back. The simplest way to do it is to do queries using your browser, but REST is a convenient way to access the data for scripts.
Different methods are available using REST. It is possible to fetch data by using:
- One or many interactor/participant identifiers.
- One or many interaction identifiers.
- A MIQL flexible query.
The first two methods are just a convenient modification of the third method. The only difference is that the appropriate MIQL field is automatically added for you behind the scenes.
The structure of the URL to fetch data from PSICQUIC is this one:
The URL contains different parts:
The first element of the URL is, of course, the location of the web service. Check the page for the providers for specific addresses.
At this moment only 1 version of PSICQUIC exists. With time, more versions might exist. The possible values for this bit are:
Version | Description |
---|---|
v1.0 | Version 1.0 of the PSICQUIC specification |
current | Will map always to the most current version. It works as a symbolic link |
As we said before, there are different methods available to retrieve data:
Method | Since spec version | Description |
---|---|---|
interactor | v1.0 | To search using interactor identifiers or aliases |
interaction | v1.0 | To search using interaction identifiers |
query | v1.0 | To search using MIQL queries |
These metadata methods return information about the service:
Method | Since spec version | Description |
---|---|---|
formats | v1.0 | Lists the return formats supported by the service |
version | v1.0 | Implementation version |
This is the place where we define the actual query. Depending on the method different queries may be used. When searching for interactors or interactions, the query must be one or many identifiers separater by the operands AND or OR (e.g. facd AND brca2
).
When using the query method, the query can be anything.
For users accessing RESTful PSICQUIC using scripts, the query must be properly encoded to avoid illegal URIs. For instance, all spaces in the query must be replaced by %20. Most programming languages contain already methods to do this. For clever web browsers, this is not necessary.
Whereas the rest of parts of the URL are mandatory, parameters are optional. We can use the parameters to choose the output format or to paginate the query. The parameters available in the reference implementation are the following:
Parameter Name | Possible values |
---|---|
format | xml25 (PSI-MIXML 2.5) tab25 (PSI-MITAB 2.5) tab26 (PSI-MITAB 2.6, not all data providers provide this format) tab27 (PSI-MITAB 2.7, not all data providers provide this format) count (Just the total count) |
It is possible to iterate through the results using "pages" by changing the value of firstResult while maintaining an immutable maxResults value. For example:
...?firstResult=0&maxResults=20
...?firstResult=20&maxResults=20
...?firstResult=40&maxResults=20
etc
If you don't want to show the whole results at once, this "pagination" method is very effective memory and speedwise.
- Getting the result for "brca2" in PSI-MITAB 2.5 format
http://www.ebi.ac.uk/Tools/webservices/psicquic/intact/webservices/current/search/query/brca2
- The same, in PSI-MI XML 2.5.4 format
http://www.ebi.ac.uk/Tools/webservices/psicquic/intact/webservices/current/search/query/brca2?format=xml25
- It supports paging. For instance, search for "species:human" and get only the first 100 results
http://www.ebi.ac.uk/Tools/webservices/psicquic/intact/webservices/current/search/query/species:human?firstResult=0&maxResults=100
- All of matrixdb in PSI-MITAB format
http://matrixdb.ibcp.fr:8080/webservices/current/search/query/*