![]() |
OpenMS
|
Class which handles the communication between OpenMS and the Mascot server. More...
#include <OpenMS/FORMAT/MascotRemoteQuery.h>
Constructors and destructors | |
| String | query_spectra_ |
| std::string | mascot_xml_ |
| std::string | mascot_decoy_xml_ |
| String | error_message_ |
| String | search_identifier_ |
| String | server_path_ |
| Path on mascot server. | |
| String | host_name_ |
| Hostname of the mascot server. | |
| bool | requires_login_ = false |
| Login required. | |
| bool | use_ssl_ = false |
| Use SSL connection. | |
| String | boundary_ |
| boundary string that will be embedded into the HTTP requests | |
| Int | to_ = 1500 |
| Timeout after these many seconds. | |
| bool | export_decoys_ = false |
| MascotRemoteQuery () | |
| default constructor | |
| MascotRemoteQuery & | operator= (const MascotRemoteQuery &rhs)=delete |
| assignment operator | |
| MascotRemoteQuery (const MascotRemoteQuery &rhs)=delete | |
| copy constructor | |
| ~MascotRemoteQuery () override | |
| destructor | |
| void | setQuerySpectra (const String &exp) |
| sets the query spectra, given in MGF file format | |
| const std::string & | getMascotXMLResponse () const |
| returns the Mascot XML response which contains the identifications | |
| const std::string & | getMascotXMLDecoyResponse () const |
| returns the Mascot XML response which contains the decoy identifications (note: setExportDecoys must be set to true, otherwise result will be empty) | |
| bool | hasError () const |
| predicate which returns true if an error occurred during the query | |
| const String & | getErrorMessage () const |
| returns the error message, if hasError can be used to check whether an error has occurred | |
| String | getSearchIdentifier () const |
| returns the search number | |
| void | setExportDecoys (const bool b) |
| request export of decoy summary and decoys (note: internal decoy search must be enabled in the MGF file passed to mascot) | |
| void | run () |
| Execute the full Mascot workflow synchronously (login -> query -> export results). | |
| void | updateMembers_ () override |
| This method is used to update extra member variables at the end of the setParameters() method. | |
| void | login (CURL *curl) |
| login to Mascot server | |
| void | execQuery (CURL *curl) |
| execute query (upload file) | |
| std::string | getResults (CURL *curl, const std::string &results_path) |
| download result file and process response | |
| std::string | httpGet (CURL *curl, const std::string &path) |
| perform an HTTP GET and return the response body | |
| std::string | httpPost (CURL *curl, const std::string &path, const std::string &body, const std::string &content_type) |
| perform an HTTP POST with the given body and content type, return the response body | |
| std::string | buildUrl (const std::string &path) const |
| build full URL from a path | |
| String | getSearchIdentifierFromFilePath (const String &path) const |
| Extract search identifier from .dat file path. | |
| std::string | removeHostName (const std::string &url) const |
| Remove host name information from a url. | |
Additional Inherited Members | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const String &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const String & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const String &name) |
| Mutable access to the name. | |
| const std::vector< String > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
| Writes all parameters to meta values. | |
Protected Member Functions inherited from DefaultParamHandler | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< String > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| String | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
Class which handles the communication between OpenMS and the Mascot server.
This class provides a communication interface which is able to query the Mascot server and reports the identifications provided be the Mascot server
Parameters of this class are:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| hostname | string | Address of the host where Mascot listens, e.g. 'mascot-server' or '127.0.0.1' | ||
| host_port | int | 80 | min: 0 | Port where the Mascot server listens, 80 should be a good guess |
| server_path | string | mascot | Path on the server where Mascot server listens, 'mascot' should be a good guess | |
| timeout | int | 1500 | min: 0 | Timeout in seconds, after which the query is declared as failed.This is NOT the whole time the search takes, but the time in between two progress steps. Some Mascot servers freeze during this (unstable network etc) and idle forever, the connection is killed. Set this to 0 to disable timeout! |
| boundary | string | GZWgAaYKjHFeUaLOLEIOMq | Boundary for the MIME section | |
| use_proxy | string | false | true, false | Flag which enables the proxy usage for the HTTP requests, please specify at least 'proxy_host' and 'proxy_port' |
| proxy_host | string | Host where the proxy server runs on | ||
| proxy_port | int | 0 | min: 0 | Port where the proxy server listens |
| proxy_username | string | Login name for the proxy server, if needed | ||
| proxy_password | string | Login password for the proxy server, if needed | ||
| login | string | false | true, false | Flag which should be set 'true' if Mascot security is enabled; also set 'username' and 'password' then. |
| username | string | Name of the user if login is used (Mascot security must be enabled!) | ||
| password | string | Password of the user if login is used (Mascot security must be enabled!) | ||
| use_ssl | string | false | true, false | Flag indicating whether you want to send requests to an HTTPS server or not (HTTP). Requires OpenSSL to be installed (see openssl.org) |
| export_params | string | _ignoreionsscorebelow=0&_sigthreshold=0.99&_showsubsets=1&show_same_sets=1&report=0&percolate=0&query_master=0 | Adjustable export parameters (passed to Mascot's 'export_dat_2.pl' script). Generally only parameters that control which hits to export are safe to adjust/add. Many settings that govern what types of information to include are required by OpenMS and cannot be changed. Note that setting 'query_master' to 1 may lead to incorrect protein references for peptides. | |
| skip_export | string | false | true, false | For use with an external Mascot Percolator (via GenericWrapper): Run the Mascot search, but do not export the results. The output file produced by MascotAdapterOnline will contain only the Mascot search number. |
| batch_size | int | 50000 | min: 0 | Number of spectra processed in one batch by Mascot (default 50000) |
default constructor
|
delete |
copy constructor
|
override |
destructor
|
private |
build full URL from a path
|
private |
execute query (upload file)
| const String & getErrorMessage | ( | ) | const |
returns the error message, if hasError can be used to check whether an error has occurred
| const std::string & getMascotXMLDecoyResponse | ( | ) | const |
returns the Mascot XML response which contains the decoy identifications (note: setExportDecoys must be set to true, otherwise result will be empty)
| const std::string & getMascotXMLResponse | ( | ) | const |
returns the Mascot XML response which contains the identifications
|
private |
download result file and process response
| String getSearchIdentifier | ( | ) | const |
returns the search number
Extract search identifier from .dat file path.
| bool hasError | ( | ) | const |
predicate which returns true if an error occurred during the query
|
private |
perform an HTTP GET and return the response body
|
private |
perform an HTTP POST with the given body and content type, return the response body
|
private |
login to Mascot server
|
delete |
assignment operator
|
private |
Remove host name information from a url.
| void run | ( | ) |
Execute the full Mascot workflow synchronously (login -> query -> export results).
| void setExportDecoys | ( | const bool | b | ) |
request export of decoy summary and decoys (note: internal decoy search must be enabled in the MGF file passed to mascot)
| void setQuerySpectra | ( | const String & | exp | ) |
sets the query spectra, given in MGF file format
|
overrideprotectedvirtual |
This method is used to update extra member variables at the end of the setParameters() method.
Also call it at the end of the derived classes' copy constructor and assignment operator.
The default implementation is empty.
Reimplemented from DefaultParamHandler.
|
private |
boundary string that will be embedded into the HTTP requests
|
private |
|
private |
|
private |
Hostname of the mascot server.
|
private |
|
private |
|
private |
|
private |
Login required.
|
private |
|
private |
Path on mascot server.
|
private |
Timeout after these many seconds.
|
private |
Use SSL connection.