Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_taxonomyrules Class Reference

This class represents a single Taxonomy_XXX section in mascot.dat. More...

#include <ms_taxonomyrules.hpp>

Inheritance diagram for ms_taxonomyrules:
Collaboration diagram for ms_taxonomyrules:

Public Member Functions

 ms_taxonomyrules ()
 Default constructor.
 
 ms_taxonomyrules (const ms_taxonomyrules &src)
 Copying constructor.
 
 ~ms_taxonomyrules ()
 Destructor.
 
void appendGencodeFile (const ms_taxnodesfiles *item)
 Adds an entry into the GencodeFiles list.
 
void appendNoBreakDescLineIf (const char *str)
 Adds an entry into the NoBreakDescLineIf list.
 
void appendNodesFile (const ms_taxnodesfiles *item)
 Adds an entry into the NodesFiles list.
 
void appendPerDbSrcRule (const ms_parserule_plus *item)
 Adds a new database source string into the list.
 
void appendPrefixRemove (const char *item)
 Adds an entry into the PrefixRemoves list.
 
void appendProperty (const char *name, const char *value, const char *delimiter, const bool bFirstPlace=false)
 Adds a new property with the given parameters.
 
void appendSpeciesFile (const ms_taxspeciesfiles *item)
 Adds an entry into the SpeciesFiles list.
 
void appendStrFile (const ms_taxspeciesfiles *item)
 
void appendSuffixRemove (const char *item)
 Adds an entry into the SuffixRemoves list.
 
void appendText (const char *line, const bool bFirstPlace=false)
 Adds a new non-parsed property.
 
void clearDBLevelTaxId ()
 Deletes DBLevelTaxId; it will not be saved in the file.
 
void clearGencodeFiles ()
 Deletes all GencodeFiles entries.
 
void clearNoBreakDescLineIf ()
 Deletes all NoBreakDescLineIf entries.
 
void clearNodesFiles ()
 Deletes all NodesFiles entries.
 
void clearPerDbSrcRules ()
 Deletes all database source strings.
 
void clearPrefixRemoves ()
 Deletes all PrefixRemoves entries.
 
void clearSpeciesFiles ()
 Deletes all entries for SpeciesFiles.
 
void clearSuffixRemoves ()
 Deletes all SuffixRemoves entries.
 
void copyFrom (const ms_customproperty *src)
 Copies all properties and comments from another instance.
 
void copyFrom (const ms_taxonomyrules *right)
 Can be used to create a copy of another object.
 
void defaultValues ()
 Initialises the instance with default values.
 
void delNonEmpty ()
 Deletes all non-comment properties.
 
void delProp (const char *name)
 Deletes all properties with the specified name.
 
void delPropByNumber (const int index)
 Deletes a single property with the specified number only.
 
void delPropStart (const char *nameBeginning)
 Deletes all properties whose names start with the given string.
 
int findProperty (const char *name, const int startFrom=0) const
 Searches the list for a property with the given name.
 
int findPropertyBeginning (const char *nameBeginning, const int startFrom=0) const
 Searches the list for a property with the partially matching name.
 
const ms_parserulegetAccFromSpeciesLine () const
 Returns the value of AccFromSpeciesLine.
 
int getDBLevelTaxId () const
 Returns the value of DBLevelTaxId.
 
std::string getDefaultDelimiter () const
 Return current default delimiter string used for parsing/storing properties.
 
const ms_parserule_plusgetDefaultRule () const
 Returns the value of DefaultRule.
 
std::string getDelimiterByNumber (const int index) const
 Returns a specific delimiter used for the property.
 
char getDescriptionLineSep () const
 Returns the value of DescriptionLineSep.
 
const ms_parserulegetDoThisRuleFirst () const
 Returns the value of DoThisRuleFirst.
 
int getErrorLevel () const
 Returns the value of ErrorLevel.
 
const ms_taxnodesfilesgetGencodeFile (const int index) const
 Returns an instance of ms_taxnodesfiles describing an entry in GencodeFiles.
 
std::string getIdentifier () const
 Returns the value of Identifier.
 
std::string getNoBreakDescLineIf (const int index) const
 Returns a NoBreakDescLineIf entry by its number.
 
const ms_taxnodesfilesgetNodesFile (const int index) const
 Returns an instance of ms_taxnodesfiles describing an entry in NodesFiles.
 
int getNumberOfGencodeFiles () const
 Returns the number of file names specified in GencodeFiles.
 
int getNumberOfNoBreakDescLineIf () const
 Returns the number of NoBreakDescLineIf entries.
 
int getNumberOfNodesFiles () const
 Returns the number of file names specified in NodesFiles.
 
int getNumberOfPerDbSrcRules () const
 Returns the number of database source strings.
 
int getNumberOfPrefixRemoves () const
 Returns the number of PrefixRemoves entries.
 
int getNumberOfProperties () const
 Returns a total number of property/comment entries.
 
int getNumberOfSpeciesFiles () const
 Returns the number of file names specified in SpeciesFiles.
 
int getNumberOfStrFiles () const
 
int getNumberOfSuffixRemoves () const
 Returns the number of SuffixRemoves entries.
 
const ms_parserule_plusgetPerDbSrcRule (const int index) const
 Returns a database source string by its number.
 
std::string getPreceedingComments () const
 Returns any comments preceeding the section.
 
std::string getPrefixRemove (const int index) const
 Returns the PrefixRemoves string by number.
 
std::string getPropertyName (const int index) const
 Returns a property name for a given index.
 
std::string getPropValStringByName (const char *name) const
 Retrieves property value by name.
 
std::string getPropValStringByNumber (const int index) const
 Retrieves property raw text values by number.
 
std::string getQuickRefSearch () const
 Returns the value of QuickRefSearch.
 
const ms_taxspeciesfilesgetSpeciesFile (const int index) const
 Returns an instance of ms_taxspeciesfiles describing an entry in SpeciesFiles.
 
std::string getSpeciesFormatRegex (const TAX_SPECIES_FORMAT format) const
 Returns a regular expression, if any for the species format.
 
const ms_parserulegetSrcDatabaseRule () const
 Returns the value of SrcDatabaseRule.
 
const ms_taxspeciesfilesgetStrFile (const int index) const
 
const ms_parserule_plusgetStrRule () const
 
std::string getSuffixRemove (const int index) const
 Returns a SuffixRemoves string by number.
 
bool isConcatRefFileLines () const
 Returns TRUE if ConcatRefFileLines parameter is set to 1 and FALSE otherwise.
 
bool isDBLevelTaxId () const
 Returns TRUE if there is a database level taxonomy ID in the file.
 
bool isEnabled () const
 Returns TRUE if Enabled parameter is set to 1 and FALSE otherwise.
 
bool isFromRefFile () const
 Returns TRUE if FromRefFile parameter is set to 1 and FALSE otherwise.
 
bool isMitochondrialTranslation () const
 Returns TRUE if MitochondrialTranslation parameter is set to 1 and FALSE otherwise.
 
bool isSectionAvailable () const
 Checks whether the section has been actually read from the file.
 
ms_taxonomyrulesoperator= (const ms_taxonomyrules &right)
 Assignment operator for C++ client applications.
 
void setAccFromSpeciesLine (const ms_parserule *src)
 Change the value of AccFromSpeciesLine.
 
void setConcatRefFileLines (const bool flag)
 Change the value of ConcatRefFileLines.
 
void setDBLevelTaxId (const int value)
 Change the value of DBLevelTaxId.
 
void setDefaultDelimiter (const char *delim)
 Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied.
 
void setDefaultRule (const ms_parserule_plus *src)
 Change the value of DefaultRule.
 
void setDescriptionLineSep (const char value)
 Change the value of DescriptionLineSep.
 
void setDoThisRuleFirst (const ms_parserule *src)
 Change the value of DoThisRuleFirst.
 
void setEnabled (const bool flag)
 Change the value of Enabled.
 
void setErrorLevel (const int value)
 Change the value of ErrorLevel.
 
void setFromRefFile (const bool flag)
 Change the value of FromRefFile.
 
void setIdentifier (const char *str)
 Change the value of Identifier.
 
void setMitochondrialTranslation (const bool flag)
 Set the value of MitochondrialTranslation.
 
void setPreceedingComments (const std::string &comments)
 Sets any comments preceeding the section.
 
void setPropertyName (const int index, const char *name)
 Changes name of the property with the given index.
 
void setPropValBoolByName (const char *name, const bool value, const bool bFirstPlace=false)
 Changes a boolean value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValCharByName (const char *name, const char value, const bool bFirstPlace=false)
 Changes a single character value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValFloatByName (const char *name, const double value, const bool bFirstPlace=false)
 Changes an floating point value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValInt64ByName (const char *name, const INT64 value, const bool bFirstPlace=false)
 Changes a long 64-bit integer value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValIntByName (const char *name, const int value, const bool bFirstPlace=false)
 Changes an integer value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValStringByName (const char *name, const char *value, const bool bFirstPlace=false)
 Changes a string value of the first entry with the given name or creates a new property if it is not found.
 
void setPropValStringByNumber (const int index, const char *value)
 Changes an string value of an existing property with the given index.
 
void setQuickRefSearch (const char *str)
 Change the value of QuickRefSearch.
 
void setSectionAvailable (const bool value)
 Changes availability of the section, i.e. whether it should be saved in a file.
 
void setSpeciesFormatRegex (const TAX_SPECIES_FORMAT format, const std::string regex)
 Set the regular expression, if any, for the species format.
 
void setSrcDatabaseRule (const ms_parserule *src)
 Change the value of SrcDatabaseRule.
 
void setStrRule (const ms_parserule_plus *src)
 
bool uncommentProp (const int index, const char *delimeter=0)
 Uncomments a line in the configuration file.
 

Detailed Description

This class represents a single Taxonomy_XXX section in mascot.dat.

The Taxonomy section defines a set of taxonomy rules that can be selected for a database. Usage of taxonomy rules can be turned off by setting Enabled property to 0. See isEnabled() for more information.

Instances of this class are created in ms_datfile.

Also get yourselves acquainted with the base class ms_customproperty. It facilitates the following tasks:

  • Retrieving an unsupported property.
  • Retrieving a raw/text/XML property representation.
  • Checking for existence of a certain property rather than dealing with its default value.
  • Accessing commented lines in a section.

More functionality is described in the documentation for ms_customproperty.

Member Function Documentation

◆ appendGencodeFile()

void appendGencodeFile ( const ms_taxnodesfiles item)

Adds an entry into the GencodeFiles list.

See getGencodeFile() for more information.

Parameters
iteman item to add a copy of into the list.

◆ appendNoBreakDescLineIf()

void appendNoBreakDescLineIf ( const char *  str)

Adds an entry into the NoBreakDescLineIf list.

See getNoBreakDescLineIf() for more information.

Parameters
stran item to add a copy of into the list.

◆ appendNodesFile()

void appendNodesFile ( const ms_taxnodesfiles item)

Adds an entry into the NodesFiles list.

See getNodesFile() for more information.

Parameters
iteman item to add a copy of into the list.

◆ appendPerDbSrcRule()

void appendPerDbSrcRule ( const ms_parserule_plus item)

Adds a new database source string into the list.

See getPerDbSrcRule() for more information.

Parameters
iteman item to add a copy of into the list

◆ appendPrefixRemove()

void appendPrefixRemove ( const char *  item)

Adds an entry into the PrefixRemoves list.

See getPrefixRemove() for more information.

Parameters
iteman item to add a copy of into the list.

◆ appendProperty()

void appendProperty ( const char *  name,
const char *  value,
const char *  delimiter,
const bool  bFirstPlace = false 
)
inherited

Adds a new property with the given parameters.

Parameters
namea property name to use.
valuea property value to use.
delimitera specific delimiter or an empty string for a default one to be used.
bFirstPlaceforces a new property to be put on top of the list.

◆ appendSpeciesFile()

void appendSpeciesFile ( const ms_taxspeciesfiles item)

Adds an entry into the SpeciesFiles list.

See getSpeciesFile() for more information.

Parameters
iteman item to add a copy of into the list.

◆ appendStrFile()

void appendStrFile ( const ms_taxspeciesfiles item)
Parameters
itempointer to a taxonomy species file

◆ appendSuffixRemove()

void appendSuffixRemove ( const char *  item)

Adds an entry into the SuffixRemoves list.

See getSuffixRemove() for more information.

Parameters
iteman item to add a copy of into the list.

◆ appendText()

void appendText ( const char *  l,
const bool  bFirstPlace = false 
)
inherited

Adds a new non-parsed property.

All property elements will be retrieved from the first parameter. Before calling this method, a specific default delimiter can be set using setDefaultDelimiter().

Parameters
lraw text representation of the property to be parsed.
bFirstPlaceforces a new property to be put on top of the list.

◆ clearGencodeFiles()

void clearGencodeFiles ( )

Deletes all GencodeFiles entries.

See getGencodeFile() for more information.

◆ clearNoBreakDescLineIf()

void clearNoBreakDescLineIf ( )

Deletes all NoBreakDescLineIf entries.

See getNoBreakDescLineIf() for more information.

◆ clearNodesFiles()

void clearNodesFiles ( )

Deletes all NodesFiles entries.

See getNodesFile() for more information.

◆ clearPerDbSrcRules()

void clearPerDbSrcRules ( )

Deletes all database source strings.

See getPerDbSrcRule() for more information.

◆ clearPrefixRemoves()

void clearPrefixRemoves ( )

Deletes all PrefixRemoves entries.

See getPrefixRemove() for more information.

◆ clearSpeciesFiles()

void clearSpeciesFiles ( )

Deletes all entries for SpeciesFiles.

See getSpeciesFile() for more information.

◆ clearSuffixRemoves()

void clearSuffixRemoves ( )

Deletes all SuffixRemoves entries.

See getSuffixRemove() for more information.

◆ delProp()

void delProp ( const char *  str)
inherited

Deletes all properties with the specified name.

Parameters
strProperty name to find a match and then delete.

◆ delPropStart()

void delPropStart ( const char *  str)
inherited

Deletes all properties whose names start with the given string.

Parameters
strBeginning a first part of the property name to delete.

◆ findProperty()

int findProperty ( const char *  name,
const int  startFrom = 0 
) const
inherited

Searches the list for a property with the given name.

If no property found with the given name -1 will be returned. There may be several property entries in the list with the same name.

Parameters
namea property name to be found.
startFroma minimal property index to start search from.
Returns
a property index or -1 if no property found.

◆ findPropertyBeginning()

int findPropertyBeginning ( const char *  nameBeginning,
const int  startFrom = 0 
) const
inherited

Searches the list for a property with the partially matching name.

If no property found with the given name part -1 will be returned. There may be several property entries in the list whose names start with the given string.

Parameters
nameBeginningfirst part of a property name to be found.
startFroma minimal property index to start search from.
Returns
a property index or -1 if no property found.

◆ getAccFromSpeciesLine()

const ms_parserule * getAccFromSpeciesLine ( ) const

Returns the value of AccFromSpeciesLine.

MSDB database explicitly associates each species line with the accession string of the primary database entry. A further rule, AccFromSpeciesLine, is used to extract this accession string.

Returns
pointer to a parser rule

◆ getDBLevelTaxId()

int getDBLevelTaxId ( ) const

Returns the value of DBLevelTaxId.

Database level taxonomy ID can be specified in order to find proper NA translation table without names.dmp and nodes.dmp files usage.

Default is -1, which is not a valid taxonomy ID.

Returns
database level taxonomy id

◆ getDefaultDelimiter()

std::string getDefaultDelimiter ( ) const
inherited

Return current default delimiter string used for parsing/storing properties.

Returns
default delimiter

◆ getDefaultRule()

const ms_parserule_plus * getDefaultRule ( ) const

Returns the value of DefaultRule.

The DefaultRule describes how to find the species name in the line of text in the reference file. The string in quotes is a regular expression. All words in the PrefixRemoves and SuffixRemoves keywords should be removed before trying to do a match. For more detailed information on how to specify this parameter consult Mascot manual.

If specified, DoThisRuleFirst is applied first, and the default rule would only be used if this failed.

See also
getQuickRefSearch(), getDoThisRuleFirst(), getAccFromSpeciesLine()
Returns
pointer to a parser rule

◆ getDelimiterByNumber()

std::string getDelimiterByNumber ( const int  index) const
inherited

Returns a specific delimiter used for the property.

Parameters
indexIndex for which to get a delimiter
Returns
corresponding delimiter

◆ getDescriptionLineSep()

char getDescriptionLineSep ( ) const

Returns the value of DescriptionLineSep.

The line that contains the species IDs has multiple IDs, separated by a character, whose ASCII code is specified by DescriptionLineSep.

There is no default value for this parameter.

Returns
description line separator for this taxonomy

◆ getDoThisRuleFirst()

const ms_parserule * getDoThisRuleFirst ( ) const

Returns the value of DoThisRuleFirst.

See getDefaultRule().

Returns
a pointer to the parser rule for which to do this rule first

◆ getErrorLevel()

int getErrorLevel ( ) const

Returns the value of ErrorLevel.

ErrorLevel indicates the type of warnings or errors that are found when creating the taxonomy information. Possible values and their meanings:

  • 0 - an entry is put into the NoTaxonomyMatch.txt file for every sequence where no taxonomy information is found.
  • 1+ (severe) - an entry is put into the NoTaxonomyMatch.txt file for every sequence that had any accession string without a match. Since some sequences in NCBI will have up to 200 gi numbers (sources), there is a reasonable chance that some of these entries will not have species information, and this would cause the errors files to become very large.

Default is 1.

Returns
error level

◆ getGencodeFile()

const ms_taxnodesfiles * getGencodeFile ( const int  index) const

Returns an instance of ms_taxnodesfiles describing an entry in GencodeFiles.

The GencodeFiles file is used to find a proper NA translation table for a given taxonomy. For more detailed information on how to configure this parameter consult Mascot manual and documentation for ms_taxnodesfiles.

By default the list of files is empty.

Parameters
indexfile number from 0 to (getNumberOfGencodeFiles()-1).
Returns
instance of ms_taxnodesfiles class describing one of the files specified in GencodeFiles parameter of the Taxonomy section.

◆ getIdentifier()

std::string getIdentifier ( ) const

Returns the value of Identifier.

This parameter contains a symbolic name for the taxonomy specification as seen, for instance, in the database GUI utility.

By default this is empty.

Returns
identifier of the taxonomy
Examples
config_mascotdat.cpp.

◆ getNoBreakDescLineIf()

std::string getNoBreakDescLineIf ( const int  index) const

Returns a NoBreakDescLineIf entry by its number.

NoBreakDescLineIf specifies keywords that prevent description line from being broken into separate words.

By default this is an empty list.

Parameters
indexnumber of entry from 0 to (getNumberOfNoBreakDescLineIf()-1).
Returns
a string value.

◆ getNodesFile()

const ms_taxnodesfiles * getNodesFile ( const int  index) const

Returns an instance of ms_taxnodesfiles describing an entry in NodesFiles.

The NodesFiles file is used to traverse taxonomy hierarchy. It contains taxonomy ID nodes together with their parents IDs. For more detailed information on how to configure this parameter consult Mascot manual and documentation for ms_taxnodesfiles.

By default the list of files is empty.

Parameters
indexfile number from 0 to (getNumberOfNodesFiles()-1).
Returns
instance of ms_taxnodesfiles class describing one of the files specified in NodesFiles parameter of the Taxonomy section.

◆ getNumberOfGencodeFiles()

int getNumberOfGencodeFiles ( ) const

Returns the number of file names specified in GencodeFiles.

See getGencodeFile() and documentation for ms_taxnodesfiles.

Returns
number of gencode files

◆ getNumberOfNoBreakDescLineIf()

int getNumberOfNoBreakDescLineIf ( ) const

Returns the number of NoBreakDescLineIf entries.

See getNoBreakDescLineIf() for explanations.

Returns
number of keywords which prevent breaking description lines

◆ getNumberOfNodesFiles()

int getNumberOfNodesFiles ( ) const

Returns the number of file names specified in NodesFiles.

See getNodesFile() and documentation for ms_taxnodesfiles.

Returns
number of nodes files

◆ getNumberOfPerDbSrcRules()

int getNumberOfPerDbSrcRules ( ) const

Returns the number of database source strings.

See getPerDbSrcRule() and documentation for ms_parserule_plus.

Returns
number of database source strings

◆ getNumberOfPrefixRemoves()

int getNumberOfPrefixRemoves ( ) const

Returns the number of PrefixRemoves entries.

See getPrefixRemove().

Returns
number of prefix removes

◆ getNumberOfProperties()

int getNumberOfProperties ( ) const
inherited

Returns a total number of property/comment entries.

Returns
Number of property/comment entries

◆ getNumberOfSpeciesFiles()

int getNumberOfSpeciesFiles ( ) const

Returns the number of file names specified in SpeciesFiles.

See getSpeciesFile() and documentation for ms_taxspeciesfiles.

Returns
number of species files

◆ getNumberOfStrFiles()

int getNumberOfStrFiles ( ) const
Returns
number of taxonomy species files

◆ getNumberOfSuffixRemoves()

int getNumberOfSuffixRemoves ( ) const

Returns the number of SuffixRemoves entries.

See getSuffixRemove().

Returns
number of suffix removes

◆ getPerDbSrcRule()

const ms_parserule_plus * getPerDbSrcRule ( const int  index) const

Returns a database source string by its number.

Database source strings contained in taxonomy section all look like RULE_XXX or OTHERRULE.

By default the list of rules is empty.

Parameters
indexdatabase source string number from 0 to (getNumberOfPerDbSrcRules()-1).
Returns
pointer to a parser rule

◆ getPreceedingComments()

std::string getPreceedingComments ( ) const
inherited

Returns any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also
setPreceedingComments()
Returns
any comments preceeding the section

◆ getPrefixRemove()

std::string getPrefixRemove ( const int  index) const

Returns the PrefixRemoves string by number.

See getDefaultRule() for information on this parameter.

By default the list of prefixes is empty.

Parameters
indexnumber of a string specified in the parameter from 0 to (getNumberOfPrefixRemoves()-1).
Returns
one of the string specifed in the parameter.

◆ getPropertyName()

std::string getPropertyName ( const int  index) const
inherited

Returns a property name for a given index.

Parameters
indexproperty number from 0 to (getNumberOfProperties()-1).
Returns
Rroperty name of an empty string for comments.

◆ getPropValStringByName()

std::string getPropValStringByName ( const char *  name) const
inherited

Retrieves property value by name.

Don't use this method for comments as they all have empty name. Also note that there might be several entries corresponding to the same name . – only the first value will be returned. If in doubt use findProperty() and getPropValStringByNumber() instead.

Parameters
nameName for which to get a property value
Returns
corresponding property value

◆ getPropValStringByNumber()

std::string getPropValStringByNumber ( const int  index) const
inherited

Retrieves property raw text values by number.

Parameters
indexIndex for which to get a property value
Returns
corresponding property value

◆ getQuickRefSearch()

std::string getQuickRefSearch ( ) const

Returns the value of QuickRefSearch.

The QuickRefSearch string is used to speed up the compressing of the database. Rather than use the regular expression for each line in the .ref file, this text is used for a fast compare to the string C;Species. Other lines are ignored.

By default this is empty.

Returns
quick ref search for the taxonomy rule

◆ getSpeciesFile()

const ms_taxspeciesfiles * getSpeciesFile ( const int  index) const

Returns an instance of ms_taxspeciesfiles describing an entry in SpeciesFiles.

The SpeciesFiles file is used to convert a species name to a taxonomy ID. For more detailed information on how to configure this parameter consult Mascot manual and documentation for ms_taxspeciesfiles.

By default the list is empty.

Parameters
indexfile number from 0 to (getNumberOfSpeciesFiles()-1).
Returns
instance of ms_taxspeciesfiles class describing one of the files specified in SpeciesFiles parameter of the Taxonomy section.

◆ getSpeciesFormatRegex()

std::string getSpeciesFormatRegex ( const TAX_SPECIES_FORMAT  format) const

Returns a regular expression, if any for the species format.

Introduced in Mascot 2.4, allows the use of a regular expression for a species file. The regular expression needs to return two values: the 'accession' or 'id' and the taxonomy_id

For example, in the Taxonomy_X section of mascot.dat, there is, for example an entry:

* SWISSPROTRegex "^\\‍([A-Z0-9]*\\‍) *[ABEV] *\\‍([0-9]*\\‍):" 

which has two bracketed expressions intended to extract AADNV and 648330 from

AADNV V 648330: N=Aedes albopictus densovirus (isolate Boublik/1994) 

If there is no value for SWISSPROTRegex in the mascot.dat file, then the value returned is the default as shown above.

Parameters
formatcan be any TAX_SPECIES_FORMAT value, although only TAX_SPECIES_SWISSPROT is currently supported in Mascot Server.
Returns
the regular expression or an empty string.

◆ getSrcDatabaseRule()

const ms_parserule * getSrcDatabaseRule ( ) const

Returns the value of SrcDatabaseRule.

The parameter is used for finding database source string with regular expression.

See also
getPerDbSrcRule()
Returns
pointer to a parser rule

◆ getStrFile()

const ms_taxspeciesfiles * getStrFile ( const int  index) const
Parameters
indexfile index to look for
Returns
taxonomy species file

◆ getStrRule()

const ms_parserule_plus * getStrRule ( ) const
Returns
pointer to a parser rule

◆ getSuffixRemove()

std::string getSuffixRemove ( const int  index) const

Returns a SuffixRemoves string by number.

See getDefaultRule() for information on this parameter.

By default the list of suffixes is empty.

Parameters
indexnumber of a string specified in the parameter from 0 to (getNumberOfSuffixRemoves()-1).
Returns
one of the string specifed in the parameter.

◆ isConcatRefFileLines()

bool isConcatRefFileLines ( ) const

Returns TRUE if ConcatRefFileLines parameter is set to 1 and FALSE otherwise.

A value of 1 (default) means that there might be multiple lines in reference file describing the same entry of the database.

See also
isFromRefFile(), getDescriptionLineSep().
Returns
true is ConcatRefFileLines equals 1, false otherwise

◆ isEnabled()

bool isEnabled ( ) const

Returns TRUE if Enabled parameter is set to 1 and FALSE otherwise.

Set Enabled parameter to 0 to disable the taxonomy. Most of the other parameters will be ignored although the taxonomy will be available for a database to select in database maintenance utility.

Default is 0.

Returns
true if taxonomy rules are enabled, false otherwise

◆ isFromRefFile()

bool isFromRefFile ( ) const

Returns TRUE if FromRefFile parameter is set to 1 and FALSE otherwise.

FromRefFile is set to 0 to indicate that the taxonomy should be found in the .fasta file rather than in a reference file.

Default is 0.

See also
isConcatRefFileLines(), getDescriptionLineSep().
Returns
true if the taxonomy should be found in the fasta file, false otherwise

◆ isMitochondrialTranslation()

bool isMitochondrialTranslation ( ) const

Returns TRUE if MitochondrialTranslation parameter is set to 1 and FALSE otherwise.

Two types of NA translation tables can be used: nuclear and mitochondrial. Setting this parameter to 0 indicates the first type whereas 1 indicates the second one.

Default is 0.

Returns
true if NA translation tables used are mitochondrial, false if they are nuclear

◆ isSectionAvailable()

bool isSectionAvailable ( ) const

Checks whether the section has been actually read from the file.

By default a Taxonomy section is unavailable until it has been set to a different state.

Returns
true if the section has been set to available

◆ setAccFromSpeciesLine()

void setAccFromSpeciesLine ( const ms_parserule src)

Change the value of AccFromSpeciesLine.

See getAccFromSpeciesLine() for more information.

Parameters
srcpointer to a parser rule

◆ setConcatRefFileLines()

void setConcatRefFileLines ( const bool  flag)

Change the value of ConcatRefFileLines.

See isConcatRefFileLines() for more information.

Parameters
flagboolean value to set whether there might be multiple lines for the same entry

◆ setDefaultDelimiter()

void setDefaultDelimiter ( const char *  delim)
inherited

Allows to set a specific delimiter string to be used when no property-specific delimiter is supplied.

Parameters
delimString to set the default delimiter

◆ setDefaultRule()

void setDefaultRule ( const ms_parserule_plus src)

Change the value of DefaultRule.

See getDefaultRule().

Parameters
srcpointer to a parser rule

◆ setDescriptionLineSep()

void setDescriptionLineSep ( const char  value)

Change the value of DescriptionLineSep.

See getDescriptionLineSep() for more information.

Parameters
valuedescription line separator

◆ setDoThisRuleFirst()

void setDoThisRuleFirst ( const ms_parserule src)

Change the value of DoThisRuleFirst.

See getDoThisRuleFirst().

Parameters
srcpointer to a parser rule for which it should do this rule first

◆ setEnabled()

void setEnabled ( const bool  flag)

Change the value of Enabled.

See isEnabled() for more information.

Parameters
flagwhether the taxonomy rules are enabled or not

◆ setErrorLevel()

void setErrorLevel ( const int  value)

Change the value of ErrorLevel.

See getErrorLevel() for more information.

Parameters
valueerror level

◆ setFromRefFile()

void setFromRefFile ( const bool  flag)

Change the value of FromRefFile.

See isFromRefFile() for more information.

Parameters
flagboolean value to define if the taxonomy should be found in the fasta file

◆ setIdentifier()

void setIdentifier ( const char *  str)

Change the value of Identifier.

For more information see getIdentifier().

Parameters
stridentifier for the taxonomy

◆ setMitochondrialTranslation()

void setMitochondrialTranslation ( const bool  flag)

Set the value of MitochondrialTranslation.

See isMitochondrialTranslation().

Parameters
flagtrue if NA translation tables used are mitochondrial, false if they are nuclear

◆ setPreceedingComments()

void setPreceedingComments ( const std::string &  comments)
inherited

Sets any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also
getPreceedingComments()
Parameters
commentsany comments preceeding the section

◆ setPropertyName()

void setPropertyName ( const int  index,
const char *  name 
)
inherited

Changes name of the property with the given index.

Parameters
indexproperty number from 0 to (getNumberOfProperties()-1).
namenew name to be given to the property.

◆ setPropValBoolByName()

void setPropValBoolByName ( const char *  name,
const bool  value,
const bool  bFirstPlace = false 
)
inherited

Changes a boolean value of the first entry with the given name or creates a new property if it is not found.

A new value will be converted into 1 (for TRUE) or 0 (for FALSE) character.

Parameters
namea name of the property to find or add.
valuea new boolean value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValCharByName()

void setPropValCharByName ( const char *  name,
const char  value,
const bool  bFirstPlace = false 
)
inherited

Changes a single character value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new single character value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValFloatByName()

void setPropValFloatByName ( const char *  name,
const double  value,
const bool  bFirstPlace = false 
)
inherited

Changes an floating point value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new floating point value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValInt64ByName()

void setPropValInt64ByName ( const char *  name,
const INT64  value,
const bool  bFirstPlace = false 
)
inherited

Changes a long 64-bit integer value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new long 64-bit integer value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValIntByName()

void setPropValIntByName ( const char *  name,
const int  value,
const bool  bFirstPlace = false 
)
inherited

Changes an integer value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new integer value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValStringByName()

void setPropValStringByName ( const char *  name,
const char *  value,
const bool  bFirstPlace = false 
)
inherited

Changes a string value of the first entry with the given name or creates a new property if it is not found.

Parameters
namea name of the property to find or add.
valuea new string value for the property.
bFirstPlaceif not found a new property can be put on top of the list.

◆ setPropValStringByNumber()

void setPropValStringByNumber ( const int  index,
const char *  str 
)
inherited

Changes an string value of an existing property with the given index.

Parameters
indexan index of an existing property.
strString value for the property.

◆ setQuickRefSearch()

void setQuickRefSearch ( const char *  str)

Change the value of QuickRefSearch.

See getQuickRefSearch().

Parameters
strstring used to speed up database compression

◆ setSpeciesFormatRegex()

void setSpeciesFormatRegex ( const TAX_SPECIES_FORMAT  format,
const std::string  regex 
)

Set the regular expression, if any, for the species format.

Instroduced in Mascot 2.4, allows the use of a regular expression for a species file. The regular expression needs to return two values: the 'accession' or 'id' and the taxonomy_id

For example, in the Taxonomy_X section of mascot.dat, there is, for example an entry:

* SWISSPROTRegex "^\\‍([A-Z0-9]*\\‍) *[ABEV] *\\‍([0-9]*\\‍):" 

which has two bracketed expressions intended to extract AADNV and 648330 from

AADNV V 648330: N=Aedes albopictus densovirus (isolate Boublik/1994) 
Parameters
formatcan be any TAX_SPECIES_FORMAT value, although only TAX_SPECIES_SWISSPROT is currently supported in Mascot Server.
regexis the new regular expression or an empty string.

◆ setSrcDatabaseRule()

void setSrcDatabaseRule ( const ms_parserule src)

Change the value of SrcDatabaseRule.

See getSrcDatabaseRule().

Parameters
srcpointer to a parser rule

◆ setStrRule()

void setStrRule ( const ms_parserule_plus src)
Parameters
srcpointer to a parser str rule

◆ uncommentProp()

bool uncommentProp ( const int  index,
const char *  delimeter = 0 
)
inherited

Uncomments a line in the configuration file.

Removes a # and any white space. Finds the delimeter and extracts the property name and value.

Parameters
indexmust be a value between 0 and getNumberOfProperties().
delimeterwill often be a space. If not supplied, the default delimeter will be used.
Returns
true if the delimiter was found, false otherwise

The documentation for this class was generated from the following files: