Encapsulates the mascot.dat
file that contains the most important parameters.
More...
#include <ms_datfile.hpp>
Public Member Functions | |
ms_datfile () | |
Default constructor. | |
ms_datfile (const char *filename, const int timeoutSec=0, const matrix_science::ms_connection_settings *cs=0) | |
Immediate action constructor. | |
ms_datfile (const ms_datfile &src) | |
Copying constructor. | |
~ms_datfile () | |
Destructor. | |
void | appendErrors (const ms_errors &src) |
Copies all errors from another instance and appends them at the end of own list. | |
unsigned int | checkSeqDBInstallRequest (const std::string &dbName, const double newFastaSize) const |
Utility function for the installation program. | |
void | clearAllErrors () |
Remove all errors from the current list of errors. | |
void | copyFrom (const ms_datfile *right) |
Use this member to make a copy of another instance. | |
void | copyFrom (const ms_errors *right) |
Use this member to make a copy of another instance. | |
void | defaultValues () |
Can be used for initialising an instance with default values. | |
bool | editedByDatabaseManager () const |
This function returns true if Database Manager has edited the mascot.dat file. | |
const ms_clusterparams * | getClusterParams () const |
Returns an instance of the class representing the Cluster section. | |
matrix_science::ms_connection_settings | getConnectionSettings () const |
Returns the sessionID and proxy server for use with an HTTP transfer. | |
const ms_cronoptions * | getCronOptions () const |
Returns an instance of the class representing the Cron section. | |
const ms_databases * | getDatabases () const |
Returns an instance of the class representing the Databases section. | |
const ms_errs * | getErrorHandler () const |
Retrive the error object using this function to get access to all errors and error parameters. | |
std::string | getFileName () const |
Returns a path to the file that was set explicitly or the default file name. | |
int | getFindFileTimeout () const |
Returns current time out value in seconds for open file operation. | |
std::string | getHeaderComments () const |
Returns comment lines at the start of mascot.dat. | |
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. | |
const ms_libraryoptions * | getLibraryOptions () const |
Returns an instance of the class representing the LibraryOptions section. | |
const ms_mascotfiles * | getMascotFiles () const |
Returns an instance of the class containing location of other configuration files. | |
const ms_mascotoptions * | getMascotOptions () const |
Returns an instance of the class representing the Options section. | |
int | getMaxTaxonomyRules () const |
Returns a maximum possible Taxonomy section number that can be used to retrieve/set the section content. | |
const ms_parseoptions * | getParseOptions () const |
Returns an instance of the class representing the PARSE section. | |
const ms_processoroptions * | getProcessors () const |
Returns an instance of the class representing the Processors section. | |
const ms_taxonomyrules * | getTaxonomyRules (const int idx) const |
Returns an instance of the class representing one of the Taxonomy_XXX sections. | |
const ms_unigeneoptions * | getUniGeneOptions () const |
Returns an instance of the class representing the UniGene section. | |
const ms_wwwoptions * | getWWWOptions () const |
Returns an instance of the class representing the WWW section. | |
bool | isValid () const |
Call this function to determine if there have been any errors. | |
ms_datfile & | operator= (const ms_datfile &right) |
C++ style assignment operator. | |
void | read_file () |
Call this method in order to read the configuration information from the file. | |
void | save_file () |
Saves the content in the file. | |
void | setClusterParams (const ms_clusterparams *params) |
Update the content of the Cluster section. | |
void | setConnectionSettings (const matrix_science::ms_connection_settings &cs) |
Sets the sessionID and proxy server for use with an HTTP transfer. | |
void | setCronOptions (const ms_cronoptions *options) |
Update the content of the Cron section. | |
void | setDatabases (const ms_databases *dbs) |
Update the content of the Databases section. | |
void | setFileName (const char *name) |
Set the file name explicitly, before saving or loading. | |
void | setFindFileTimeout (const int seconds) |
Sets the time out for local file search. | |
void | setHeaderComments (const std::string headerComments) |
Sets comment lines at the start of mascot.dat. | |
void | setLibraryOptions (const ms_libraryoptions *spectralLibraryOptions) |
Update the content of the LibraryOptions section. | |
void | setMascotFiles (const ms_mascotfiles *src) |
Update the location of other configuration files. | |
void | setMascotOptions (const ms_mascotoptions *opt) |
Update the content of the Options section. | |
void | setParseOptions (const ms_parseoptions *rules) |
Update the content of the PARSE section. | |
void | setProcessors (const ms_processoroptions *info) |
Update the content of the Processors section. | |
void | setTaxonomyRules (const int idx, const ms_taxonomyrules *rules) |
Update or create an existing the Taxonomy_XXX section. | |
void | setUniGeneOptions (const ms_unigeneoptions *uoptions) |
Update the content of the UniGene section. | |
void | setWWWOptions (const ms_wwwoptions *www) |
Update the content of the WWW section. | |
bool | updateForInstaller (ms_errs &log, const char *not_mascot_dat_path, const char *mascot_dat_path, const char *licenseFilePath, const char *pathToMascot, const char *mascotURL, const char *sequenceDatabases, const bool clusterEnable, const WST wst, const char *NTGuestName, const char *NTAdminName, const unsigned int flags) |
Creates and updates mascot.dat for the Mascot Installation programs. | |
Encapsulates the mascot.dat
file that contains the most important parameters.
The file is divided into several sections. Each section has corresponding accessor methods (getXXX/setXXX).
The path to mascot.dat
can be specified explicitly. However, several default locations will be tried if the object is used without setting a file name. Before obtaining any section content check the object for any errors that might occur using isValid() method.
enum INST_FLAGS |
Flags for the updateForInstaller() function.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
Enumerator | |
---|---|
IFLG_UPDATETAXONOMY | Inserts missing taxonomy sections. |
IFLG_UPDATEPARSERULES | Inserts missing parse rules. |
IFLG_UPDATESWISSPROT | Add an entry for SwissProt if it doesn't exist, or update it if parse rules are wrong. |
IFLG_UPDATECLUSTER | Update the cluster section. |
IFLG_UPDATEESTTAX | Update EST_human, EST_mouse if very old taxonomy. |
IFLG_ADDMISSINGOPTIONS | Add entries missing options from the default values in not.mascot.dat. |
IFLG_ADDREPORTAUTO | Add AUTO to the list in ReportNumberChoices if it isn't already present. |
IFLG_UPDATEAPACHEFORKOPT | Update ForkForUnixApache using the value specified by the wst parameter. From Parser 2.5.2 onwards, under Windows, the value in wst is ignored and it is assumed to be WST_IIS. |
IFLG_ADDPERCOLATOROPT | Add -U to the flags in PercolatorExeFlags if it doesn't already exist. |
IFLG_UPDATENCBIHTTPS | Change TaxBrowserUrl http://www.ncbi... to TaxBrowserUrl https://www.ncbi... |
IFLG_UPDATEPRIDECONTAMINANTS | Add an entry for PRIDE_Contaminants if it doesn't exist, or update it if parse rules are wrong. |
IFLG_UPDATEDBMANAGERPERLPATH | If the path to perl for the dbman_process_tasks.pl script in the cron section is missing, or wrong, then insert ot replace. |
IFLG_UPDATEMSPEPSEARCHOPTS | If the LibrarySearch line in the Options section of mascot.dat contains ' m G ' then change this to ' m a P '. Also, if it contains " /HITS 100 " change this to " /HITS 10 ". |
IFLG_UPDATEEXECAFTERSEARCH | Update ExecAfterSearch_* lines and remove ms-createpip.exe from it. |
IFLG_UPDATEPERCOLATORFEATS | Update Percolator features set. |
IFLG_UPDATEPROTFAMILYSWITCH | Update ProteinFamilySwitch. |
IFLG_UPDATEPERCOLATORUSERT | Update PercolatorUseRT. |
IFLG_UPDATESPLITNUMOFQUERIES | Update SplitNumberOfQueries. |
IFLG_UPDATESPLITDATAFILESIZE | Update SplitDataFileSize. |
IFLG_DEFAULTNEWINSTALL | Default flags for a new installation. Just the IFLG_UPDATECLUSTER and IFLG_UPDATEAPACHEFORKOPT flag. |
IFLG_DEFAULTUPGRADE | Default flags for an upgrade. All flags except IFLG_UPDATECLUSTER, IFLG_UPDATESWISSPROT and IFLG_UPDATEPRIDECONTAMINANTS. |
enum SEQDB_INSTALL |
Flags for checkSeqDBInstallRequest().
See Using enumerated values and static const ints in Perl, Java, Python and C#.
These values may be bitwise 'ORd' together.
Enumerator | |
---|---|
SEQDB_INSTALL_SHOULD_QUERY_USER | Bitwise 'and' the return value from checkSeqDBInstallRequest() with this value to determine if an update of the fasta files may be unwise. |
SEQDB_INSTALL_CUSTOMISED | User has an unrecognised configuration, possibly with a customised SwissProt, so installing an update may be unwise. |
SEQDB_INSTALL_INACTIVE | User has an existing configuration, but it is disabled. |
SEQDB_INSTALL_INVALID_CONFIG | User has an invalid configuration. For example, missing parse rules or specifying to use accession from the fasta and ID from the .dat. |
SEQDB_INSTALL_EXISTING_LARGER | User has an existing fasta file larger (and presumably later) than the one on the installer CD. |
SEQDB_INSTALL_INVALID_DBNAME | An unsupported dbName was passed to the function. |
SEQDB_INSTALL_MUST_UPDATE_CFG | The configuration must be updated if the newer fasta files are to be installed. |
SEQDB_INSTALL_MISSING_CONFIG | There is no configuration for the database. Installing should not give any conflict. |
SEQDB_INSTALL_OLD_RULES | For example, the rules for SwissProt are for version 51 to version 55. |
SEQDB_INSTALL_WRONG_WILDCARD | For example, could be Sprot_*.fasta rather than SwissProt_*.fasta. |
SEQDB_INSTALL_CURRENT_RULES | Currently set if the rules for SwissProt are for version 56 to version ... |
enum WST |
Web server type for the updateForInstaller() function.
See Using enumerated values and static const ints in Perl, Java, Python and C#.
ms_datfile | ( | ) |
Default constructor.
The default constructor can be used to create a new ms_datfile programmatically.
ms_datfile | ( | const ms_datfile & | src | ) |
Copying constructor.
Create a new copy of the object from an existing one.
src | is the datfile to copy from. |
ms_datfile | ( | const char * | filename, |
const int | timeoutSec = 0 , |
||
const matrix_science::ms_connection_settings * | cs = 0 |
||
) |
Immediate action constructor.
filename | The file name parameter can be either a local file path or a Mascot server URL. It cannot be an empty string or NULL pointer. If it is a URL it should be of the form http://your-server/mascot/cgi . |
timeoutSec | timeout for open operation. For more information, see setFindFileTimeout(). |
cs | is a pointer to the connection settings. This should contain a sessionID and optionally the proxy server settings. |
~ms_datfile | ( | ) |
Destructor.
Releases all memory. Called automatically from all supported languages.
|
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. |
unsigned int checkSeqDBInstallRequest | ( | const std::string & | dbName, |
const double | newFastaSize | ||
) | const |
Utility function for the installation program.
This function is called by an installer to determine whether it is 'safe' to update a particular database. The return value is an integer that comprises one or more flags, bitwise ANDed together.
After calling this function, any errors can be found by calling isValid() and getLastErrorString().
The return value should be OR'd with ms_datfile::SEQDB_INSTALL_SHOULD_QUERY_USER to determine whether to ask the end user to confirm that they wish to continue with the installation/update of the specified database.
dbName | Currently only "SwissProt" and "PRIDE_Contaminants" are supported. Passing any other string will result in ms_datfile::SEQDB_INSTALL_INVALID_DBNAME being returned. |
newFastaSize | is the size in bytes of the new fasta file. This is passed as a double because there is no guarantee of 64 bit integer support in Perl. |
|
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_datfile * | right | ) |
Use this member to make a copy of another instance.
C++: use the copy constructor instead.
right | is the object to copy from. |
|
inherited |
Use this member to make a copy of another instance.
right | is the source to initialise from |
void defaultValues | ( | ) |
Can be used for initialising an instance with default values.
All existing settings, apart from the filename, are lost.
bool editedByDatabaseManager | ( | ) | const |
This function returns true if Database Manager has edited the mascot.dat file.
If Database Manager is being used, then most sections of the file should not be edited in a text editor or by using this Mascot Parser class. See comments at the top of the mascot.dat file for further information.
# WARNING: Do not edit this file to make changes to #is found near the top of the file
const ms_clusterparams * getClusterParams | ( | ) | const |
Returns an instance of the class representing the Cluster
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setClusterParams().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_cronoptions * getCronOptions | ( | ) | const |
Returns an instance of the class representing the Cron
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setCronOptions().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_databases * getDatabases | ( | ) | const |
Returns an instance of the class representing the Databases
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setDatabases().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
|
inherited |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
std::string getFileName | ( | ) | const |
Returns a path to the file that was set explicitly or the default file name.
The filename should include the complete or relative path, or it can be a URL to a Mascot server.
mascot.dat
. int getFindFileTimeout | ( | ) | const |
Returns current time out value in seconds for open file operation.
This may be useful for the file that is being periodically updated or downloaded by another application. During file-copying operations the file might be inacessible. The library will still try to open it during the specified period of time.
By default, the timeout is set to zero meaning no further attempts are made to find and open the file.
std::string getHeaderComments | ( | ) | const |
Returns comment lines at the start of mascot.dat.
Multiple lines are separated by \n
The first section in the mascot.dat file is the Databases section and this must exist.
Comments before sections other than the databases section can be returned using ms_customproperty::getPreceedingComments(). The ms_databases class inherits from ms_customproperty, but due to historical reasons the comments preceding it are stored separately.
|
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.
|
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.
const ms_libraryoptions * getLibraryOptions | ( | ) | const |
Returns an instance of the class representing the LibraryOptions section.
const ms_mascotfiles * getMascotFiles | ( | ) | const |
Returns an instance of the class containing location of other configuration files.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setMascotFiles().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_mascotoptions * getMascotOptions | ( | ) | const |
Returns an instance of the class representing the Options
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setMascotOptions().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
int getMaxTaxonomyRules | ( | ) | const |
Returns a maximum possible Taxonomy section number that can be used to retrieve/set the section content.
There are multiple taxonomy rules sections in mascot.dat
: Taxonomy_1
, Taxonomy_2
, etc. This value is the maximum number that can be used for a taxonomy section.
mascot.dat
. const ms_parseoptions * getParseOptions | ( | ) | const |
Returns an instance of the class representing the PARSE
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setParseOptions().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_processoroptions * getProcessors | ( | ) | const |
Returns an instance of the class representing the Processors
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setProcessors().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_taxonomyrules * getTaxonomyRules | ( | const int | idx | ) | const |
Returns an instance of the class representing one of the Taxonomy_XXX
sections.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setTaxonomyRules().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
Taxonomy rules sections can be listed in mascot.dat
in a random order and with gaps between numbers. Therefore, it is essential that the return value is checked to be not null before accessing its properties. A NULL value indicates 'no such taxonomy section'.
idx | is the ID of the taxonomy rules section. There are multiple taxonomy rules sections mascot.dat : Taxonomy_1 , Taxonomy_2 etc. The value should be in the range 1 to getMaxTaxonomyRules(). |
const ms_unigeneoptions * getUniGeneOptions | ( | ) | const |
Returns an instance of the class representing the UniGene
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setUniGeneOptions().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
const ms_wwwoptions * getWWWOptions | ( | ) | const |
Returns an instance of the class representing the WWW
section.
This function returns a pointer to the object held internally in the ms_datfile object. A pointer, rather than a copy of the object is returned for performance reasons.
C++: The pointer returned is 'const' so the contents cannot be altered by a C++ application. To update a mascot.dat file, create a copy of the object returned from this function using the supplied copy constructor, make the modifications and then call setWWWOptions().
Other languages: Any change to the parameters returned by this function will be 'global' to the ms_datfile object.
|
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_datfile & operator= | ( | const ms_datfile & | right | ) |
C++ style assignment operator.
right | is the object to copy from. |
void read_file | ( | ) |
Call this method in order to read the configuration information from the file.
It shouldn't normally be necessary to call this function as it will be called automatically from the constructor. See ms_datfile::ms_datfile for further information.
void save_file | ( | ) |
Saves the content in the file.
Saves the file using the current filename. Can only be saved as a local file.
void setClusterParams | ( | const ms_clusterparams * | params | ) |
Update the content of the Cluster
section.
The ms_datfile object is updated with a copy of the data passed.
params | is a pointer to the new ms_clusterparams. |
void setConnectionSettings | ( | const matrix_science::ms_connection_settings & | cs | ) |
Sets the sessionID and proxy server for use with an HTTP transfer.
This value would normally be passed in the constructor.
cs | is the new connection settings. |
void setCronOptions | ( | const ms_cronoptions * | options | ) |
Update the content of the Cron
section.
The ms_datfile object is updated with a copy of the data passed.
options | is a pointer to the new ms_cronoptions. |
void setDatabases | ( | const ms_databases * | dbs | ) |
Update the content of the Databases
section.
The ms_datfile object is updated with a copy of the data passed.
dbs | is a pointer to the new ms_databases. |
void setFileName | ( | const char * | name | ) |
Set the file name explicitly, before saving or loading.
The filename should include the complete or relative path, or it can be a URL to a Mascot server.
name | is the new filename for mascot.dat . |
void setFindFileTimeout | ( | const int | seconds | ) |
Sets the time out for local file search.
This may be useful for the file that is being periodically updated or downloaded by another application. During file-copying operations the file might be inacessible. The library will still try to open it during the specified period of time.
By default, the timeout is set to zero meaning no further attempts are made to find and open the file.
seconds | is the time in seconds. |
void setHeaderComments | ( | const std::string | headerComments | ) |
Sets comment lines at the start of mascot.dat.
Multiple lines are separated by \n
The first section in the mascot.dat file is the Databases section and this must exist.
Comments before sections other than the databases section can be set using ms_customproperty::setPreceedingComments(). The ms_databases class inherits from ms_customproperty, but due to historical reasons the comments preceding it are stored separately.
headerComments | are new comments to replace the old ones. |
void setLibraryOptions | ( | const ms_libraryoptions * | spectralLibraryOptions | ) |
Update the content of the LibraryOptions section.
call ms_datfile::save_file() after calling this function.
spectralLibraryOptions | is the new LibraryOptions section. |
void setMascotFiles | ( | const ms_mascotfiles * | src | ) |
Update the location of other configuration files.
The ms_datfile object is updated with a copy of the data passed.
src | is a pointer to the new ms_mascotfiles. |
void setMascotOptions | ( | const ms_mascotoptions * | opt | ) |
Update the content of the Options
section.
The ms_datfile object is updated with a copy of the data passed.
opt | is a pointer to the new ms_mascotoptions. |
void setParseOptions | ( | const ms_parseoptions * | rules | ) |
Update the content of the PARSE
section.
The ms_datfile object is updated with a copy of the data passed.
rules | is a pointer to the new ms_parseoptions. |
void setProcessors | ( | const ms_processoroptions * | info | ) |
Update the content of the Processors
section.
The ms_datfile object is updated with a copy of the data passed.
info | is a pointer to the new ms_processoroptions. |
void setTaxonomyRules | ( | const int | idx, |
const ms_taxonomyrules * | rules | ||
) |
Update or create an existing the Taxonomy_XXX
section.
The ms_datfile object is updated with a copy of the data passed.
idx | is the ID of the taxonomy rules section. There are multiple taxonomy rules sections in mascot.dat : Taxonomy_1 , Taxonomy_2 etc. The value should be in the range 1 to getMaxTaxonomyRules(). |
rules | is a pointer to the new ms_taxonomyrules. In order to erase an existing section submit NULL as this parameter. |
void setUniGeneOptions | ( | const ms_unigeneoptions * | uoptions | ) |
Update the content of the UniGene
section.
The ms_datfile object is updated with a copy of the data passed.
uoptions | is a pointer to the new ms_unigeneoptions. |
void setWWWOptions | ( | const ms_wwwoptions * | www | ) |
Update the content of the WWW
section.
The ms_datfile object is updated with a copy of the data passed.
www | is a pointer to the new ms_wwwoptions. |
bool updateForInstaller | ( | ms_errs & | log, |
const char * | not_mascot_dat_path, | ||
const char * | mascot_dat_path, | ||
const char * | licenseFilePath, | ||
const char * | pathToMascot, | ||
const char * | mascotURL, | ||
const char * | sequenceDatabasePath, | ||
const bool | clusterEnable, | ||
const WST | wst, | ||
const char * | NTGuestName, | ||
const char * | NTAdminName, | ||
const unsigned int | flags | ||
) |
Creates and updates mascot.dat
for the Mascot Installation programs.
To use, first create a new ms_datfile using the default constructor. Then, create an ms_errs object and call ms_errs::setLoggingLevel() to set the severity level to ms_errs::sev_info. After calling updateForInstaller(), call isValid() on the passed ms_errs object, to check for any errors. If there are no errors, then call setFileName() followed by save_file(). Finally, call the isValid() function (on this object) to check that the file has been saved without error.
For a new installation, the passed mascot_dat_path must be null/empty.
The following actions are performed for both installation and upgrades:
not.mascot.dat
file is read. NTIUserGroup
is changed to the passed value. If null or an empty string is passed, then the setting is not changed. NTIMonitorGroup
is changed to the passed value. If null or an empty string is passed, then the setting is not changed. ###ROOT###/sequence
is replaced with the value passed in sequenceDatabasePath. ###ROOT###
are replaced with pathToMascot. ###HOSTNAME###
is replaced with the computer hostname. ###URL###
is replaced with mascotURL. The following actions are performed for a new install:
not.mascot.dat
are copied to this instance of ms_datfile. The following actions are performed for an upgrade:
mascot.dat
are loaded into this instance of ms_datfile. The following actions are performed depending on the passed flags:
RULE_32
in mascot.dat, but there is a RULE_32
in not.mascot.dat
, then RULE_32
is added. From version 2.5.1 onwards, this flag is ignored if the file has been editedByDatabaseManager() because database manager will add extra parse rules when required and it gets upset if the parse rules in the mascot.dat file aren't the same as those in its 'source' xml file. ###ROOT###/sequence
with the value passed in sequenceDatabasePath, and possibly changing the rule numbers as appropriate. SwissProt_*.fasta
. ###ROOT###/sequence
with the value passed in sequenceDatabasePath, and possibly changing the rule numbers as appropriate. PRIDE_Contaminants_*.msp
. Taxonomy_10
section was added, then change the rule to Taxonomy_10
. Taxonomy_11
. not.mascot.dat
. config/db_manager/global.conf
file is read if it exists, and proxy settings copied over. If mascot.dat
already contains proxy settings, the global.conf
file is ignored. ReportNumberChoices
, then this is added. PercolatorExeFlags
, then this is added. LibrarySearch
contains " m G " (the 2.6 option) then replace this with " m a P ". See ms_mascotoptions::getPepSearchTool for further details. LibrarySearch
contains " /HITS 100 " (the 2.6 option) then replace this with " /HITS 10 ". Possible error messages:
mascot.dat
or not.mascot.dat
will be reported. All other issues are treated as warnings.
log | is used to collect errors and information messages. |
not_mascot_dat_path | The file must exist or an error will be reported. |
mascot_dat_path | may be null (or an empty string) for a clean installation where there is no existing mascot.dat If specified, the file must exist. |
licenseFilePath | not used in Parser version 2.4.1 and later. The number of threads to use for each database is set to an 'auto' value in Mascot 2.4 and later. |
pathToMascot | is used for when mascot_dat_path is null, and is used to replace ###ROOT### . Any backslashes will be replaced with forward slashes. The caller is responsible for ensuring that the string doesn't contain any spaces. |
mascotURL | is used to replace ###URL### . It doesn't matter if the URL ends with a '/' or not. This parameter is also used to explicitly update ResultsFullURL to mascotURL/cgi/master_results.pl unless a null pointer or an empty string is passed. It is not used to update ResultsFullURL_2 because this may have been manually set to master_results.pl because a user does not like the family reports. |
sequenceDatabasePath | is used to replace ###ROOT###/sequence . Any backslashes will be replaced with forward slashes. The caller is responsible for ensuring that the string doesn't contain any spaces. |
clusterEnable | should be set to true to enable cluster mode. If IFLG_UPDATECLUSTER is not set, this flag is ignored. |
wst | Should be set to WST_APACHE or WST_IIS . |
NTGuestName | Should be set to the guest group name (Windows only). Should only be passed for a new installation. |
NTAdminName | Should be set to Administrators group name (Windows only). Should only be passed for a new installation. |
flags | Specifies which actions to take. See ms_datfile::INST_FLAGS for further information. Most common values to use are ms_datfile::IFLG_DEFAULTNEWINSTALL or ms_datfile::IFLG_DEFAULTUPGRADE. |