OpenMS
MascotRemoteQuery Class Reference

Class which handles the communication between OpenMS and the Mascot server. More...

#include <OpenMS/FORMAT/MascotRemoteQuery.h>

Inheritance diagram for MascotRemoteQuery:
[legend]
Collaboration diagram for MascotRemoteQuery:
[legend]

Constructors and destructors

QNetworkAccessManager * manager_
 
String query_spectra_
 
QByteArray mascot_xml_
 
QByteArray mascot_decoy_xml_
 
QString cookie_
 
String error_message_
 
QTimer timeout_
 
String search_identifier_
 
String server_path_
 Path on mascot server. More...
 
String host_name_
 Hostname of the mascot server. More...
 
bool requires_login_
 Login required. More...
 
bool use_ssl_
 Use SSL connection. More...
 
String boundary_
 boundary string that will be embedded into the HTTP requests More...
 
Int to_
 Timeout after these many seconds. More...
 
bool export_decoys_ = false
 
 MascotRemoteQuery (QObject *parent=0)
 default constructor More...
 
MascotRemoteQueryoperator= (const MascotRemoteQuery &rhs)=delete
 assignment operator More...
 
 MascotRemoteQuery (const MascotRemoteQuery &rhs)=delete
 copy constructor More...
 
 ~MascotRemoteQuery () override
 destructor More...
 
void setQuerySpectra (const String &exp)
 sets the query spectra, given in MGF file format More...
 
const QByteArray & getMascotXMLResponse () const
 returns the Mascot XML response which contains the identifications More...
 
const QByteArray & getMascotXMLDecoyResponse () const
 returns the Mascot XML response which contains the decoy identifications (note: setExportDecoys must be set to true, otherwise result will be empty) More...
 
bool hasError () const
 predicate which returns true if an error occurred during the query More...
 
const StringgetErrorMessage () const
 returns the error message, if hasError can be used to check whether an error has occurred More...
 
String getSearchIdentifier () const
 returns the search number More...
 
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) More...
 
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void run ()
 
void timedOut () const
 slot connected to QTimer (timeout_) More...
 
void readResponse (QNetworkReply *reply)
 slot connected to the QNetworkAccessManager::finished signal More...
 
void downloadProgress (qint64 bytes_read, qint64 bytes_total)
 slot connected to signal downloadProgress More...
 
void uploadProgress (qint64 bytes_read, qint64 bytes_total)
 slot connected to signal uploadProgress More...
 
void followRedirect (QNetworkReply *reply)
 slot connected to signal gotRedirect More...
 
void gotRedirect (QNetworkReply *reply)
 signal when class got a redirect More...
 
void done ()
 signal when class is done and results can be collected More...
 
void login ()
 login to Mascot server More...
 
void execQuery ()
 execute query (upload file) More...
 
void getResults (const QString &results_path)
 download result file More...
 
void endRun_ ()
 finish a run and emit "done" More...
 
void removeHostName_ (QString &url)
 Remove host name information from an url, e.g., "http://www.google.de/search" -> "search". More...
 
QUrl buildUrl_ (const std::string &path)
 helper function to build URL More...
 
void logHeader_ (const QNetworkRequest &header, const String &what)
 Write HTTP header to error stream (for debugging) More...
 
void logHeader_ (const QNetworkReply *header, const String &what)
 Write HTTP header to error stream (for debugging) More...
 
String getSearchIdentifierFromFilePath (const String &path) const
 
void readResponseHeader (const QNetworkReply *reply)
 parse new response header More...
 

Additional Inherited Members

- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- 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. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

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:

NameTypeDefaultRestrictionsDescription
hostname string  Address of the host where Mascot listens, e.g. 'mascot-server' or '127.0.0.1'
host_port int80 min: 0Port where the Mascot server listens, 80 should be a good guess
server_path stringmascot  Path on the server where Mascot server listens, 'mascot' should be a good guess
timeout int1500 min: 0Timeout 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 stringGZWgAaYKjHFeUaLOLEIOMq  Boundary for the MIME section
use_proxy stringfalse true, falseFlag 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 int0 min: 0Port 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 stringfalse true, falseFlag 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 stringfalse true, falseFlag 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 stringfalse true, falseFor 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 int50000 min: 0Number of spectra processed in one batch by Mascot (default 50000)

Note:
  • If a section name is documented, the documentation is displayed as tooltip.
  • Advanced parameter names are italic.

Constructor & Destructor Documentation

◆ MascotRemoteQuery() [1/2]

MascotRemoteQuery ( QObject parent = 0)

default constructor

◆ MascotRemoteQuery() [2/2]

MascotRemoteQuery ( const MascotRemoteQuery rhs)
delete

copy constructor

◆ ~MascotRemoteQuery()

~MascotRemoteQuery ( )
override

destructor

Member Function Documentation

◆ buildUrl_()

QUrl buildUrl_ ( const std::string &  path)
private

helper function to build URL

◆ done

void done ( )
signal

signal when class is done and results can be collected

◆ downloadProgress

void downloadProgress ( qint64  bytes_read,
qint64  bytes_total 
)
privateslot

slot connected to signal downloadProgress

◆ endRun_()

void endRun_ ( )
private

finish a run and emit "done"

◆ execQuery()

void execQuery ( )
private

execute query (upload file)

◆ followRedirect

void followRedirect ( QNetworkReply *  reply)
privateslot

slot connected to signal gotRedirect

◆ getErrorMessage()

const String& getErrorMessage ( ) const

returns the error message, if hasError can be used to check whether an error has occurred

◆ getMascotXMLDecoyResponse()

const QByteArray& getMascotXMLDecoyResponse ( ) const

returns the Mascot XML response which contains the decoy identifications (note: setExportDecoys must be set to true, otherwise result will be empty)

◆ getMascotXMLResponse()

const QByteArray& getMascotXMLResponse ( ) const

returns the Mascot XML response which contains the identifications

◆ getResults()

void getResults ( const QString &  results_path)
private

download result file

◆ getSearchIdentifier()

String getSearchIdentifier ( ) const

returns the search number

◆ getSearchIdentifierFromFilePath()

String getSearchIdentifierFromFilePath ( const String path) const
private

◆ gotRedirect

void gotRedirect ( QNetworkReply *  reply)
signal

signal when class got a redirect

◆ hasError()

bool hasError ( ) const

predicate which returns true if an error occurred during the query

◆ logHeader_() [1/2]

void logHeader_ ( const QNetworkReply *  header,
const String what 
)
private

Write HTTP header to error stream (for debugging)

◆ logHeader_() [2/2]

void logHeader_ ( const QNetworkRequest &  header,
const String what 
)
private

Write HTTP header to error stream (for debugging)

◆ login()

void login ( )
private

login to Mascot server

◆ operator=()

MascotRemoteQuery& operator= ( const MascotRemoteQuery rhs)
delete

assignment operator

◆ readResponse

void readResponse ( QNetworkReply *  reply)
privateslot

slot connected to the QNetworkAccessManager::finished signal

◆ readResponseHeader()

void readResponseHeader ( const QNetworkReply *  reply)
private

parse new response header

◆ removeHostName_()

void removeHostName_ ( QString &  url)
private

Remove host name information from an url, e.g., "http://www.google.de/search" -> "search".

Parameters
urlThe url that will be manipulated.

◆ run

void run ( )
slot

◆ setExportDecoys()

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)

◆ setQuerySpectra()

void setQuerySpectra ( const String exp)

sets the query spectra, given in MGF file format

◆ timedOut

void timedOut ( ) const
privateslot

slot connected to QTimer (timeout_)

◆ updateMembers_()

void updateMembers_ ( )
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.

◆ uploadProgress

void uploadProgress ( qint64  bytes_read,
qint64  bytes_total 
)
privateslot

slot connected to signal uploadProgress

Member Data Documentation

◆ boundary_

String boundary_
private

boundary string that will be embedded into the HTTP requests

◆ cookie_

QString cookie_
private

◆ error_message_

String error_message_
private

◆ export_decoys_

bool export_decoys_ = false
private

◆ host_name_

String host_name_
private

Hostname of the mascot server.

◆ manager_

QNetworkAccessManager* manager_
private

◆ mascot_decoy_xml_

QByteArray mascot_decoy_xml_
private

◆ mascot_xml_

QByteArray mascot_xml_
private

◆ query_spectra_

String query_spectra_
private

◆ requires_login_

bool requires_login_
private

Login required.

◆ search_identifier_

String search_identifier_
private

◆ server_path_

String server_path_
private

Path on mascot server.

◆ timeout_

QTimer timeout_
private

◆ to_

Int to_
private

Timeout after these many seconds.

◆ use_ssl_

bool use_ssl_
private

Use SSL connection.