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

An object of this class represent a single modification group element in quantitation.xml. More...

#include <ms_quant_modgroup.hpp>

Inherits ms_xml_IValidatable.

Public Member Functions

 ms_quant_modgroup ()
 Default constructor.
 
 ms_quant_modgroup (const ms_quant_modgroup &src)
 Copying constructor.
 
virtual ~ms_quant_modgroup ()
 Destructor.
 
void appendLocalDefinition (const ms_quant_localdef *localdef)
 Adds a new local_definition element at the end of the list.
 
void appendModFile (const char *mod)
 Adds a new mod_file at the end of the list.
 
void appendUnmodified (const ms_quant_unmodified *unmodified)
 Adds a new unmodified element at the end of the list.
 
void clearLocalDefinitions ()
 Deletes all local_definition elements from the list.
 
void clearModFiles ()
 Deletes all mod_file elements from the list.
 
void clearUnmodified ()
 Deletes all unmodified elements from the list.
 
void copyFrom (const ms_quant_modgroup *right)
 Copies all content from another instance.
 
void defaultValues ()
 Call this member if you want to start again.
 
bool deleteLocalDefinition (const int idx)
 Removes a local_definition element from the list.
 
bool deleteModFile (const int idx)
 Removes mod_file element from the list.
 
bool deleteUnmodified (const int idx)
 Removes an unmodified element from the list.
 
void dropMode ()
 Delete the mode attribute.
 
void dropName ()
 Delete the name attribute.
 
void dropRequired ()
 Delete the required attribute.
 
int findModFile (const char *mod) const
 Return zero-based index of a mod_file if it is found in the list, -1 otherwise.
 
const ms_quant_localdefgetLocalDefinition (const int idx) const
 Returns a local_definition element object by its number.
 
std::string getLocalDefinitionSchemaType () const
 Obtain a symbolic name for the local_definition element schema type.
 
std::string getMode () const
 Returns the value of the mode attribute.
 
std::string getModeSchemaType () const
 Obtain a symbolic name for the mode attribute schema type.
 
std::string getModFile (const int idx) const
 Returns mod_file element content by its number.
 
std::string getModFileSchemaType () const
 Obtain a symbolic name for the mod_file element schema type.
 
std::string getName () const
 Returns the value of the name attribute.
 
std::string getNameSchemaType () const
 Obtain a symbolic name for the name attribute schema type.
 
int getNumberOfLocalDefinitions () const
 Returns the number of nested local_definition elements.
 
int getNumberOfModFiles () const
 Returns the number of nested mod_file elements.
 
int getNumberOfUnmodified () const
 Returns the number of nested unmodified elements.
 
std::string getRequiredSchemaType () const
 Obtain a symbolic name for the required attribute schema type.
 
virtual std::string getSchemaType () const
 Returns name of the schema type that can be used to validate this element.
 
const ms_quant_unmodifiedgetUnmodified (const int idx) const
 Returns an unmodified element object by its number.
 
std::string getUnmodifiedSchemaType () const
 Obtain a symbolic name for the unmodified element schema type.
 
bool haveMode () const
 Indicates presence of the mode attribute.
 
bool haveName () const
 Check for presence of the name attribute.
 
bool haveRequired () const
 Indicates presence of the required attribute.
 
bool isRequired () const
 Returns the value of the required attribute.
 
ms_quant_modgroupoperator= (const ms_quant_modgroup &right)
 C++ style assignment operator.
 
void setMode (const char *value)
 Set a custom value for the mode attribute.
 
void setName (const char *value)
 Set a custom value for the name attribute.
 
void setRequired (bool value)
 Set a custom value for the required attribute.
 
bool updateLocalDefinition (const int idx, const ms_quant_localdef *localdef)
 Supply new content for one of the local_definition elements in the list.
 
bool updateUnmodified (const int idx, const ms_quant_unmodified *unmodified)
 Supply new content for one of the unmodified elements in the list.
 
virtual std::string validateDeep (const ms_xml_schema *pSchemaFileObj) const
 Performs validation of all child elements in addition to 'shallow' validation.
 
virtual std::string validateShallow (const ms_xml_schema *pSchemaFileObj) const
 Performs simple validation of the top-level elements only.
 

Detailed Description

An object of this class represent a single modification group element in quantitation.xml.

Grouping to enable mode constraint (e.g. exclusive) to apply to a set of modifications.

Constructor & Destructor Documentation

◆ ms_quant_modgroup() [1/2]

Default constructor.

Assigns reasonable default values to all internal members.

◆ ms_quant_modgroup() [2/2]

Copying constructor.

Parameters
srcanother instance of this class to copy the content from.

Member Function Documentation

◆ appendLocalDefinition()

void appendLocalDefinition ( const ms_quant_localdef localdef)

Adds a new local_definition element at the end of the list.

Parameters
localdefa new element to be added to the list.

◆ appendModFile()

void appendModFile ( const char *  mod)

Adds a new mod_file at the end of the list.

Parameters
moda title from the Mascot mod_file.

◆ appendUnmodified()

void appendUnmodified ( const ms_quant_unmodified unmodified)

Adds a new unmodified element at the end of the list.

Parameters
unmodifieda new element to be added to the list.

◆ copyFrom()

void copyFrom ( const ms_quant_modgroup right)

Copies all content from another instance.

Parameters
rightanother instance of this class to copy the content from.

◆ defaultValues()

void defaultValues ( )

Call this member if you want to start again.

All internal values are reset to their defaults, as if the object had been freshly created with the default constructor.

◆ deleteLocalDefinition()

bool deleteLocalDefinition ( const int  idx)

Removes a local_definition element from the list.

Parameters
idxa zero based index of the local_definition element to delete from the list.
Returns
true if the index is in rage, false otherwise

◆ deleteModFile()

bool deleteModFile ( const int  idx)

Removes mod_file element from the list.

Parameters
idxzero based index of the element to remove.
Returns
TRUE if the element has been successfully removed and FALSE otherwise.

◆ deleteUnmodified()

bool deleteUnmodified ( const int  idx)

Removes an unmodified element from the list.

Parameters
idxa zero based index of the unmodified element to delete from the list.
Returns
true if the index is in range, false otherwise

◆ dropMode()

void dropMode ( )

Delete the mode attribute.

Disables the attribute until it is re-set.

◆ dropName()

void dropName ( )

Delete the name attribute.

Deletes the attribute until it is re-set.

◆ dropRequired()

void dropRequired ( )

Delete the required attribute.

Disables the attribute until it is re-set.

◆ findModFile()

int findModFile ( const char *  mod) const

Return zero-based index of a mod_file if it is found in the list, -1 otherwise.

Parameters
moda title from the Mascot mod_file.
Returns
zero-based index of a mod_file if it is found in the list, otherwise -1.

◆ getLocalDefinition()

const ms_quant_localdef * getLocalDefinition ( const int  idx) const

Returns a local_definition element object by its number.

Parameters
idxa zero based index of the element to retrieve.
Returns
a read-only pointer to the retrieved element. See Maintaining object references: two rules of thumb.

◆ getLocalDefinitionSchemaType()

std::string getLocalDefinitionSchemaType ( ) const

Obtain a symbolic name for the local_definition element schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ getMode()

std::string getMode ( ) const

Returns the value of the mode attribute.

"Mode" is one of fixed, variable or exclusive. Applies to all the modifications in the group.

Returns
current value of the mode attribute.

◆ getModeSchemaType()

std::string getModeSchemaType ( ) const

Obtain a symbolic name for the mode attribute schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ getModFile()

std::string getModFile ( const int  idx) const

Returns mod_file element content by its number.

Parameters
idxzero based index of the mod_file element.
Returns
mod_file element content.

◆ getModFileSchemaType()

std::string getModFileSchemaType ( ) const

Obtain a symbolic name for the mod_file element schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ getName()

std::string getName ( ) const

Returns the value of the name attribute.

Returns
a descriptive name that will appear in drop down lists, etc.

◆ getNameSchemaType()

std::string getNameSchemaType ( ) const

Obtain a symbolic name for the name attribute schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ getNumberOfLocalDefinitions()

int getNumberOfLocalDefinitions ( ) const

Returns the number of nested local_definition elements.

Returns
total number of nested local_definition elements.

◆ getNumberOfModFiles()

int getNumberOfModFiles ( ) const

Returns the number of nested mod_file elements.

Returns
total number of nested mod_file elements.

◆ getNumberOfUnmodified()

int getNumberOfUnmodified ( ) const

Returns the number of nested unmodified elements.

Returns
total number of nested unmodified elements.

◆ getRequiredSchemaType()

std::string getRequiredSchemaType ( ) const

Obtain a symbolic name for the required attribute schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ getSchemaType()

std::string getSchemaType ( ) const
virtual

Returns name of the schema type that can be used to validate this element.

Additional information about the current object can be retrieved from the associated XML schema file. Every element in an XML document is defined with a named type, which you can use to find out what kind of limits (numerical or otherwise) are defined for values of that type.

See also
validateShallow(), validateDeep()
Returns
a symbolic fully qualified type name (for example, "mqm:nameType").

◆ getUnmodified()

const ms_quant_unmodified * getUnmodified ( const int  idx) const

Returns an unmodified element object by its number.

Parameters
idxa zero based index of the element to retrieve.
Returns
a read-only pointer to the retrieved element. See Maintaining object references: two rules of thumb.

◆ getUnmodifiedSchemaType()

std::string getUnmodifiedSchemaType ( ) const

Obtain a symbolic name for the unmodified element schema type.

The obtained type name can be used to get a corresponding type description object from ms_xml_schema.

Returns
symbolic type name for the element.

◆ haveMode()

bool haveMode ( ) const

Indicates presence of the mode attribute.

You should always check for the presence of an attribute before retrieving its actual value.

Returns
TRUE if the attribute is present in current element and FALSE otherwise.

◆ haveName()

bool haveName ( ) const

Check for presence of the name attribute.

Returns
TRUE if the attribute is present and FALSE otherwise.

◆ haveRequired()

bool haveRequired ( ) const

Indicates presence of the required attribute.

You should always check for the presence of an attribute before retrieving its actual value.

Returns
TRUE if the attribute is present in current element and FALSE otherwise.

◆ isRequired()

bool isRequired ( ) const

Returns the value of the required attribute.

Modification required for a peptide to be part of a component. Does not affect the Mascot search.

Returns
current value of the required attribute.

◆ operator=()

ms_quant_modgroup & operator= ( const ms_quant_modgroup right)

C++ style assignment operator.

Parameters
rightanother instance of this class to copy the content from.
Returns
reference to the current object

◆ setMode()

void setMode ( const char *  value)

Set a custom value for the mode attribute.

An attribute becomes present after it is value has been set at least once. To disable it again call dropMode().

Parameters
valuea new value for the attribute.

◆ setName()

void setName ( const char *  value)

Set a custom value for the name attribute.

Parameters
valuea new value for the attribute.

◆ setRequired()

void setRequired ( bool  value)

Set a custom value for the required attribute.

An attribute becomes present after it is value has been set at least once. To disable it again call dropRequired().

Parameters
valuea new value for the attribute.

◆ updateLocalDefinition()

bool updateLocalDefinition ( const int  idx,
const ms_quant_localdef localdef 
)

Supply new content for one of the local_definition elements in the list.

Parameters
idxa zero based index of the element to update.
localdefa source to copy the content from.
Returns
TRUE if the element has been successfully updated.

◆ updateUnmodified()

bool updateUnmodified ( const int  idx,
const ms_quant_unmodified unmodified 
)

Supply new content for one of the unmodified elements in the list.

Parameters
idxa zero based index of the element to update.
unmodifieda source to copy the content from.
Returns
TRUE if the element has been successfully updated.

◆ validateDeep()

std::string validateDeep ( const ms_xml_schema *  pSchemaFileObj) const
virtual

Performs validation of all child elements in addition to 'shallow' validation.

The current object can be checked against an XML schema. When using this method all possible checks are performed. However, this is not a substitute for the schema: some schema-defined constraint are not applied (unique fields, foreign keys etc.).

In order to make sure that current object is free from all syntax errors validate it as a part of the whole document.

See also
validateShallow(), getSchemaType()
Parameters
pSchemaFileObja valid schema object instance to validate against.
Returns
user-friendly description of any errors found during validation or an empty string if no errors detected.

◆ validateShallow()

std::string validateShallow ( const ms_xml_schema *  pSchemaFileObj) const
virtual

Performs simple validation of the top-level elements only.

The current object can be checked against some basic constraints in a schema without looking at children element types. When using this method only the current object and children derived from standard types (for example, restrictions with enumerations) are checked. For more thorough validation, use validateDeep().

See also
getSchemaType()
Parameters
pSchemaFileObja valid schema object instance to validate against.
Returns
user-friendly description of any errors found during validation or an empty string if no errors detected.

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