Used for submitting searches to a Mascot server and retrieving search results using HTTP. More...
#include <ms_http_client_search.hpp>
Public Types | |
enum | DownloadOption { DO_NORMAL = 0, DO_WITH_IONS = 1 } |
Definitions for downloading results. More... | |
enum | ReportTopSpecialValues { RT_auto = 0, RT_file = -1 } |
Definitions for special 'report top' values when requesting results in XML format. More... | |
enum | SearchStatusCode { SS_UNKNOWN, SS_ASSIGNED, SS_QUEUED, SS_RUNNING, SS_COMPLETE, SS_ERROR, SS_SEARCH_CONTROL_ERROR } |
Definitions for the various states possible when querying about a running Mascot search. More... | |
enum | UploadResponseCode { UR_SUCCESS, UR_ACCESS_DENIED, UR_INVALID_TASKID, UR_NO_RESULT_FILENAME, UR_NO_RESULT_FILE, UR_FILE_ALREADY_EXISTS, UR_ERROR } |
Definitions for the various responses possible when uploading data to Mascot. More... | |
Public Member Functions | |
ms_http_client_search (ms_http_client_session &session, const std::string &searchTaskId) | |
Access previously run search results. | |
ms_http_client_search (const ms_http_client_search &src) | |
virtual | ~ms_http_client_search () |
Destructor;. | |
void | appendErrors (const ms_errors &src) |
Copies all errors from another instance and appends them at the end of own list. | |
void | clearAllErrors () |
Remove all errors from the current list of errors. | |
void | copyFrom (const ms_errors *right) |
Use this member to make a copy of another instance. | |
void | copyFrom (const ms_http_client_search *right) |
bool | downloadDaemonResultsFile (std::string filename, ms_http_helper_progress &progress) |
Download the summary results of a search in the format used by Mascot Daemon. | |
bool | downloadPercolatorFile (std::string filename, ms_http_helper_progress &progress) |
Download the Percolator inpput and output files for the associated search. | |
bool | downloadResultsFile (std::string filename, ms_http_helper_progress &progress, DownloadOption options=DO_WITH_IONS) |
Download the results file (F*.dat). | |
bool | downloadXmlResultsFile (std::string filename, ms_http_helper_progress &progress, int reportTop=RT_auto) |
Download the results of the search in XML format. | |
const ms_errs * | getErrorHandler () const |
Retrive the error object using this function to get access to all errors and error parameters. | |
int | getLastError () const |
Return the error description of the last error that occurred. | |
std::string | getLastErrorString () const |
Return the error description of the last error that occurred. | |
bool | getResultsFileName (std::string &returnFileName) |
Return the path to the result file on the server (usually relative to the cgi directory). | |
std::string | getSearchTaskID () const |
Get the task ID of the associated Mascot search. | |
std::string | getSessionID () const |
Get the associated session ID. | |
bool | getStatus (SearchStatusCode &returnCode, int &statusValue) |
Return the current status of the search. | |
bool | isValid () const |
Call this function to determine if there have been any errors. | |
ms_http_client_search & | operator= (const ms_http_client_search &right) |
std::string | sessionId () const |
Get the associated session ID. | |
bool | uploadDistillerXmlResultsFile (std::string filename, UploadResponseCode &responseCode, std::string &responseText) |
Upload a Mascot Distiller quantitation XML file to the server. |
Used for submitting searches to a Mascot server and retrieving search results using HTTP.
Use ms_http_client_search to follow the progress of a new search as it runs on the Macot server and to retrieve the results from both new searches and old searches stored on the server.
The Mascot search must be run on the server within a Mascot session created by ms_http_client_session.
A previous search can be accessed by constructing a ms_http_client_search with a task identifier.
enum DownloadOption |
Definitions for downloading results.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
Definitions for special 'report top' values when requesting results in XML format.
Otherwise can use a small positive integer (eg 1..50) See Using enumerated values and static const ints in Perl, Java, Python and C#.
enum SearchStatusCode |
Definitions for the various states possible when querying about a running Mascot search.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
SS_UNKNOWN |
The search task ID was not recognised as a recent Mascot task. |
SS_ASSIGNED |
The search task has been assigned but no search has been submitted. |
SS_QUEUED |
The search has been submitted, but it has been queued . |
SS_RUNNING |
The search has started. The approximate percentage that has been completed is available. |
SS_COMPLETE |
The search has completed. |
SS_ERROR |
An error occurred when running the search. The Mascot error number is available from the getStatus call. |
SS_SEARCH_CONTROL_ERROR |
An error has occurred in the Mascot server application trying to get the search status. The error code is available and is documented in the Mascot Installation and Setup Manual (For example, ERR_TASKID_FAILOPEN = 1) |
enum UploadResponseCode |
Definitions for the various responses possible when uploading data to Mascot.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
ms_http_client_search | ( | ms_http_client_session & | session, |
const std::string & | searchTaskId | ||
) |
Access previously run search results.
This constructor does not validate the searchTaskId or session and does not call any scripts on the Mascot Server. It is recommended that getStatus() is called before calling other functions so that the searchTaskId and session can be validated.
session | The associated session object. |
searchTaskId | The Mascot task identifier used for the associated search. |
~ms_http_client_search | ( | ) | [virtual] |
Destructor;.
Called automatically.
ms_http_client_search | ( | const ms_http_client_search & | src ) |
src | is the source to initialise from |
void appendErrors | ( | const ms_errors & | src ) | [inherited] |
Copies all errors from another instance and appends them at the end of own list.
src | The object to copy the errors across from. See Maintaining object references: two rules of thumb. |
void clearAllErrors | ( | ) | [inherited] |
Remove all errors from the current list of errors.
The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.
All messages are accumulated into a list in this object, until clearAllErrors() is called.
See Error Handling.
void copyFrom | ( | const ms_http_client_search * | right ) |
The session object is copied, it is not created anew, cf the other constructors
right | is the source to initialise from |
void copyFrom | ( | const ms_errors * | right ) | [inherited] |
Use this member to make a copy of another instance.
right | is the source to initialise from |
bool downloadDaemonResultsFile | ( | std::string | filename, |
ms_http_helper_progress & | progress | ||
) |
Download the summary results of a search in the format used by Mascot Daemon.
filename | The name of the local file for the results to be written to. |
progress | The progress information is maintained as the data is downloaded from the server. The download may be aborted by calling setAbort. See Maintaining object references: two rules of thumb. |
bool downloadPercolatorFile | ( | std::string | filename, |
ms_http_helper_progress & | progress | ||
) |
Download the Percolator inpput and output files for the associated search.
filename | The name of the local file for the results to be written to. |
progress | The progress information is maintained as the data is downloaded from the server. The download may be aborted by calling setAbort. See Maintaining object references: two rules of thumb. |
bool downloadResultsFile | ( | std::string | filename, |
ms_http_helper_progress & | progress, | ||
DownloadOption | options = DO_WITH_IONS |
||
) |
Download the results file (F*.dat).
It is safest to call getStatus() before calling this function to validate the searchTaskId etc. because this function has more limited error reporting.
filename | The name of the local file for the results to be written to. |
progress | The progress information is maintained as the data is downloaded from the server. The download may be aborted by calling setAbort. See Maintaining object references: two rules of thumb. |
options | This contains the bit flags that controls how the file will be downloaded. It should be DO_NORMAL or a bitwise accumulation (boolean or operation) of the other flags. |
bool downloadXmlResultsFile | ( | std::string | filename, |
ms_http_helper_progress & | progress, | ||
int | reportTop = RT_auto |
||
) |
Download the results of the search in XML format.
Use of this function is deprecated. Use downloadResultsFile instead.
filename | The name of the local file for the results to be written to. |
progress | The progress information is maintained as the data is downloaded from the server. The download may be aborted by calling setAbort. See Maintaining object references: two rules of thumb. |
reportTop | The number of protein hits to include in the results. |
const ms_errs * getErrorHandler | ( | ) | const [inherited] |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
int getLastError | ( | ) | const [inherited] |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
Reimplemented in ms_mascotresfile.
std::string getLastErrorString | ( | ) | const [inherited] |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
Reimplemented in ms_mascotresfile.
bool getResultsFileName | ( | std::string & | returnFileName ) |
Return the path to the result file on the server (usually relative to the cgi directory).
The function is implemented by calling ms_http_helper::httpGetString with the command:
client.pl?result_file_name&task_id=searchTaskId
If the function fails because an invalid searchTaskId has been set, then the function will return false, returnFileName will be empty and the ms_errs::ERR_MSP_HTTP_GETRESULTSFILENAME error will be set.
It is safest to call getStatus() before calling this function to validate the searchTaskId etc. because this function has more limited error reporting.
See Multiple return values in Perl, Java, Python and C#.
[out] | returnFileName | Returns the path to the result file on the server (usually relative to the cgi directory). |
std::string getSearchTaskID | ( | ) | const |
Get the task ID of the associated Mascot search.
std::string getSessionID | ( | ) | const |
Get the associated session ID.
bool getStatus | ( | SearchStatusCode & | returnCode, |
int & | statusValue | ||
) |
Return the current status of the search.
Can be called regularly while a submitted search is runing in order to determine status.
The function is implemented by calling ms_http_helper::httpGetString with the command:
client.pl?status&task_id=searchTaskId
The value returned in statusValue depends on the returnCode:
See Multiple return values in Perl, Java, Python and C#.
[out] | returnCode | Returns the current status code of the search task. |
[out] | statusValue | Returns an optional value depending on the returnCode. |
bool isValid | ( | ) | const [inherited] |
Call this function to determine if there have been any errors.
This will return true unless there have been any fatal errors.
See Error Handling.
ms_http_client_search & operator= | ( | const ms_http_client_search & | right ) |
right | is the source to initialise from |
std::string sessionId | ( | ) | const [inline] |
bool uploadDistillerXmlResultsFile | ( | std::string | filename, |
ms_http_client_search::UploadResponseCode & | responseCode, | ||
std::string & | responseText | ||
) |
Upload a Mascot Distiller quantitation XML file to the server.
Uploads a Mascot Distiller quantitation XML file to the Mascot Server.
See Multiple return values in Perl, Java, Python and C#.
[in] | filename | The path of the file to be uploaded. |
[out] | responseCode | If the return value is true then this should be checked to see if the upload was accepted as valid. |
[out] | responseText | The response from the Mascot server. |
Copyright © 2022 Matrix Science Ltd. All Rights Reserved. Generated on Thu Mar 31 2022 01:12:33 |