Phenyx Web services
From GBWiki
Phenyx web services
The execution of Phenyx identification runs via web services follows a multistep approach:
- login
- create job
- add peak list file(s)
- start identification run
- get run status
- retrieve result file(s)
login
The login URL is the following
http://localhost:8080/pwi_25_test/login/login_local.jsp
parameters:
- j_username=_username_
- j_password=_password_
Phenyx is also capable of processing basic authentication credentials presented in HTTP headers. The standard governing HTTP Basic Authentication is defined by RFC 1945, Section 11.
submission
the service url is the following:
http://localhost:8080/pwi/service/job_service.htm
Each request returns a XML document that describes the identification job and its status. Genebio provides a Java API to deserialize job XML into Java POJOs.
Job creation
This request creates a job on the server. The XML returned contains the job id to be used as parameters in the following steps
requires an http multipart POST.
parameters:
- action=create
- title=_job_title_
- file submission_file (this pamarater is the Phenyx submission XML file)
example:
?xml version="1.0" encoding="UTF-8"?>
<job>
<jobId>60</jobId>
<status>
<runStatus>
<runStatusElementList/>
</runStatus>
</status>
</job>
the current job XML representation provides the ID of the job(60). The job has no peak list and is therefore not ready to be launched.
Adding Peak list files
This service is used to add peak list files and is done n times for n peak list files
requires an http multipart POST.
parameters:
- action=add
- jobId=_job_id_
- file peak_list_file (this pamareter is the peak list file)
- fileFormat=_peak_list_file_format_
example
<?xml version="1.0" encoding="UTF-8"?>
<job>
<jobId>60</jobId>
<status>
<runStatus>
<runStatusElementList>
<runStatusElement>
<status>reserved</status>
<date>2008-03-05</date>
<time>10:54:04</time>
<summary/>
</runStatusElement>
</runStatusElementList>
</runStatus>
<progressStatus>
<progressElementList>
<progressElement>
<rawDescription>reading source data</rawDescription>
<progressElementValueList/>
</progressElement>
</progressElementList>
</progressStatus>
</status>
<title>test10</title>
</job>
The job has now at least one peak list and is ready to be launched.
Submitting job
http POST or GET
parameters:
- action=launch
- jobId=_job_id_
example:
http://localhost:8080/pwi/service/job_service.htm?action=launch&jobId=60
this request starts the identification of the job 60
Query Job Status
http POST or GET
parameters:
- action=get
- jobId=job_id
example:
http://localhost:8080/pwi/service/job_service.htm?action=get&jobId=644
<?xml version="1.0" encoding="UTF-8"?>
<job>
<jobId>60</jobId>
<status>
<runStatus>
<runStatusElementList>
<runStatusElement>
<status>reserved</status>
<date>2008-02-26</date>
<time>11:38:52</time>
<summary/>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:38:52</time>
<summary>building ms data</summary>
</runStatusElement>
<runStatusElement>
<status>pending</status>
<date>2008-02-26</date>
<time>11:38:53</time>
<summary>waiting for pre-processing</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:38:53</time>
<summary>converting sprectra data</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:38:53</time>
<summary>building ms data</summary>
</runStatusElement>
<runStatusElement>
<status>pending</status>
<date>2008-02-26</date>
<time>11:38:55</time>
<summary>waiting for process batch</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:38:55</time>
<summary>building ms data</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:38:56</time>
<summary>algo=phenyx MS/MS</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:39:02</time>
<summary>finished database processing</summary>
</runStatusElement>
<runStatusElement>
<status>pending</status>
<date>2008-02-26</date>
<time>11:39:03</time>
<summary>waiting for post-process batch</summary>
</runStatusElement>
<runStatusElement>
<status>running</status>
<date>2008-02-26</date>
<time>11:39:03</time>
<summary>post processing</summary>
</runStatusElement>
<runStatusElement>
<status>completed</status>
<date>2008-02-26</date>
<time>11:39:04</time>
<summary>2 matches (2 peptides): P00761_WOPP0(7.21361)Q9Y2X3(6.48598)</summary>
</runStatusElement>
</runStatusElementList>
</runStatus>
<progressStatus>
<progressElementList>
<progressElement>
<rawDescription>submit to uniprot_sprot</rawDescription>
<progressElementValueList/>
</progressElement>
<progressElement>
<rawDescription>searching on all 369798 databank entries</rawDescription>
<progressElementValueList>
<progressElementValue>
<rawDescription>spectra_rnd</rawDescription>
<currentValue>60</currentValue>
<endValue>60</endValue>
</progressElementValue>
<progressElementValue>
<rawDescription>uniprot_sprot_DB_blocks</rawDescription>
<currentValue>50</currentValue>
<endValue>50</endValue>
</progressElementValue>
</progressElementValueList>
</progressElement>
<progressElement>
<rawDescription>apply post processing command</rawDescription>
<progressElementValueList/>
</progressElement>
<progressElement>
<rawDescription>completed</rawDescription>
<progressElementValueList/>
</progressElement>
</progressElementList>
</progressStatus>
</status>
<title>(re: 45)</title>
</job>
the status element fully describes the status of the job. The element <runStatus> contains the content of the runStatus.txt file: it describes the progress from the queuing system perspective. The element <progressStatus> contains the content of the webseye.xml file. It describes the progress from the engine perspective. The "searching on all 369798 databank entries" <progressElement> element corresponds to the databank search. It contains two sub elements <progressElementValueList>: spectra_rnd (the random search), uniprot_sprot_DB_blocks (the search on the swissprot databank). Both have a progress status (currentValue/endValue), e.g. 60/60, and 70/70 respectively, meaning that both are finished. A status of 30/60 would mean that the corresponding element has a progress status of 50%
Result retrieval
the service url is the following:
http://localhost:8080/pwi/service/job_service.htm
Parameters
This service provides access to any user/job file provided that you have the appropriate rights. The parameters are the following:
action
This parameter specifies the type of action. The only currently implemeted value is "get"
category
The two possible values of this parameter are "result" and "user". This indicates the type of file of interest.
jobId
Defines the job id the file of interest belongs to and is relevant only if the category parameter has a value equal to "result"
outputType
This parameter defines the format of the request output
- content: will output the content of the file
- descriptor: will output a description of the file, i.e. its path, permissions, etc.
- view: will output a HTML page that provides a link to the file. This view also works for directories and will display links to all the files in the directory tree.
type
This param is used to specify the path of the file of interest relative to its root dir, i.e. job result dir or user dir.
Examples:
pidres: type=./pidres.xml stderr: type=./stderr.xml
root dir of the job specified by the jobId param: ./
Examples
How to retrieve the descriptor of the result file of the job 61175
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./pidres.xml&outputType=descriptor&outputFormat=xml&category=result&jobId=61175
How to retrieve the content of the result file of the job 61175
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./pidres.xml&outputType=content&outputFormat=xml&category=result&jobId=61175
How to retrieve descriptors for all the files belonging to job 61175
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./&outputType=descriptor&outputFormat=xml&category=result&jobId=61175
The descriptor for each file is of the following type. The element type contains the value (relative path) that should be used for parameter "type" to retrieve the content of the file.
<file>
<fileDescription>
<user>nico</user>
<path>/home/phenyx/phenyx/prod/data/results/61175/./runstatus.txt</path>
<jobId>61175</jobId>
<type>./pidres.xml</type>
<category reference="../../../../fileDescription/category"/>
<lastRefreshTime>0</lastRefreshTime>
</fileDescription>
<filePermisson reference="../../../filePermisson"/>
<isDirectory>false</isDirectory>
</file>
<file>
How to dispay an HTML page with links to all files in the dir tree of job 61175
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./&outputType=view&outputFormat=xml&category=result&jobId=61175
How to dispay an HTML page with links to all files in the dir tree of the current user
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./&outputType=view&outputFormat=xml&category=user
How to retrieve descriptors for all the files belonging to the logged user
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=./&outputType=descriptor&outputFormat=xml&category=user
The descriptor for each file is of the following type. The element type contains the value (relative path) that should be used for parameter "type" to retrieve the content of the file.
<file>
<fileDescription>
<user>nico</user>
<path>/home/phenyx/phenyx/prod/data/users/nico/./insilicodef.xml</path>
<type>.//insilicodef.xml</type>
<category reference="../../../../fileDescription/category"/>
<lastRefreshTime>0</lastRefreshTime>
</fileDescription>
<filePermisson reference="../../../filePermisson"/>
<isDirectory>false</isDirectory>
</file>
How to retrieve the content of the user insilicodef file
The relative path can be found out by applying the previous command. The file content is then retrieved with the following command:
http://phenyx.vital-it.ch/pwi/service/file_service.htm?action=get&type=.//insilicodef.xml&outputType=content&outputFormat=xml&category=user
