# Spec MatrixScore
A general scoring matrix.

Extends | Score
All Extended | Score
Defined in | <seqan/score.h>
Signature | `template <typename TValue, typename TSeqValue, typename TSpec> class Score<TValue, ScoreMatrix<[TSeqValue[, TSpec]]> >;`

## Template Parameters

`TValue` | The score value.
`TSeqValue` | The alphabet type, defaults to AminoAcid.
`TSpec` | Further specialization, defaults to Default.

## Member Function Overview

- `MatrixScore::Score(gapExtend[, gapOpen]);, MatrixScore::Score(fileName, gapExtend[, gapOpen]);`
  Constructor

## Interface Function Overview

- `void setDefaultScoreMatrix(score, tag);`
  Set the score matrix of a Score to one of the default matrixes.
- `void setScore(score, x, y, v);`
  Set the substitution score between to values.
- `int write(stream, scoreMatrix[, meta]);`
  Write a score matrix to a stream.

### Interface Functions Inherited From Score

- `loadScoreMatrix`
- `score`
- `scoreGapExtendHorizontal`
- `scoreGapExtendVertical`
- `scoreGapHorizontal`
- `scoreGapOpenHorizontal`
- `scoreGapOpenVertical`
- `scoreGapVertical`
- `sequenceEntryForScore`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From Score

- `SequenceEntryForScore`
- `Spec`
- `Value`

## Detailed Description

The TSpec argument can be used to obtain a predefined matrix. Specify one of the following tags:

ScoreSpecBlosum30, ScoreSpecBlosum45, ScoreSpecBlosum62, ScoreSpecBlosum80, ScoreSpecPam40, ScoreSpecPam120, ScoreSpecPam200, ScoreSpecPam250, ScoreSpecVtml200.

This will internally call setDefaultScoreMatrix.

In order to provide a more user-friendly access to the predefined scoring matrixes, typedefs exist: Blosum30, Blosum45, Blosum62, Blosum80, Pam40, Pam120, Pam200, Pam250 and Vtml200.

## Member Functions Detail

### `MatrixScore::Score(gapExtend[, gapOpen]); MatrixScore::Score(fileName, gapExtend[, gapOpen]);`

Constructor

#### Parameters

`fileName` | Path to load the matrix from, type is `char const *`.
`gapExtend` | Gap extension score, type is TValue.
`gapOpen` | Gap open score, defaults to gapExtend, type is TValue.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## Interface Functions Detail

### `void setDefaultScoreMatrix(score, tag);`

Set the score matrix of a Score to one of the default matrixes.

#### Parameters

`score` | The MatrixScore to update.
`tag` | The tag to select the default matrix, see description below.

#### Remarks

The tag must be one of the following: Default, ScoreSpecBlosum30, ScoreSpecBlosum45, ScoreSpecBlosum62, ScoreSpecBlosum80, ScoreSpecPam40, ScoreSpecPam120, ScoreSpecPam200, ScoreSpecPam250, ScoreSpecVtml200.

If Default is used for tag then the matrix will be filled with default-constructed TValue values.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `void setScore(score, x, y, v);`

Set the substitution score between to values.

#### Parameters

`score` | The MatrixScore to set the value for.
`x` | The substituted alphabet value.
`y` | The alphabet value to substitute x for.
`v` | The score value to set.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `int write(stream, scoreMatrix[, meta]);`

Write a score matrix to a stream.

#### Parameters

`stream` | Stream to write to.
`scoreMatrix` | MatrixScore object.
`meta` | Meta information is stored here.

#### Returns

`int` | Status code, 0 on success, a different value on errors.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### Dox Sources

    /*!
     * @class MatrixScore
     *
     * @extends Score
     *
     * @headerfile <seqan/score.h>
     *
     * @brief A general scoring matrix.
     *
     * @signature template <typename TValue, typename TSeqValue, typename TSpec>
     *            class Score<TValue, ScoreMatrix<[TSeqValue[, TSpec]]> >;
     *
     * @tparam TValue The score value.
     * @tparam TSeqValue The alphabet type, defaults to AminoAcid.
     * @tparam TSpec Further specialization, defaults to Default.
     *
     * The TSpec argument can be used to obtain a predefined matrix. Specify one of
     * the following tags:
     *
     * ScoreSpecBlosum30, ScoreSpecBlosum45, ScoreSpecBlosum62, ScoreSpecBlosum80,
     * ScoreSpecPam40, ScoreSpecPam120, ScoreSpecPam200, ScoreSpecPam250,
     * ScoreSpecVtml200.
     *
     * This will internally call @link MatrixScore#setDefaultScoreMatrix
     * setDefaultScoreMatrix@endlink.
     *
     * In order to provide a more user-friendly access to the predefined scoring
     * matrixes, typedefs exist: @link Blosum30 @endlink, @link Blosum45 @endlink,
     * @link Blosum62 @endlink, @link Blosum80 @endlink, @link Pam40 @endlink, @link
     * Pam120 @endlink, @link Pam200 @endlink, @link Pam250 @endlink and @link
     * Vtml200 @endlink.
     *
     * @fn MatrixScore::Score
     *
     * @brief Constructor
     *
     * @signature MatrixScore::Score(gapExtend[, gapOpen]);
     * @signature MatrixScore::Score(fileName, gapExtend[, gapOpen]);
     *
     * @param[in] fileName Path to load the matrix from, type is <tt>char const
     *                     *</tt>.
     * @param[in] gapExtend Gap extension score, type is TValue.
     * @param[in] gapOpen Gap open score, defaults to gapExtend, type is TValue.
     *
     * @fn MatrixScore#setScore
     *
     * @brief Set the substitution score between to values.
     *
     * @signature void setScore(score, x, y, v);
     *
     * @param[in,out] score The MatrixScore to set the value for.
     * @param[in] x The substituted alphabet value.
     * @param[in] y The alphabet value to substitute x for.
     * @param[in] v The score value to set.
     *
     * @fn MatrixScore#setDefaultScoreMatrix
     *
     * @brief Set the score matrix of a Score to one of the default matrixes.
     *
     * @signature void setDefaultScoreMatrix(score, tag);
     *
     * @param[in,out] score The MatrixScore to update.
     * @param[in] tag The tag to select the default matrix, see description below.
     *
     * @section Remarks
     *
     * The tag must be one of the following: Default, ScoreSpecBlosum30,
     * ScoreSpecBlosum45, ScoreSpecBlosum62, ScoreSpecBlosum80, ScoreSpecPam40,
     * ScoreSpecPam120, ScoreSpecPam200, ScoreSpecPam250, ScoreSpecVtml200.
     *
     * If Default is used for tag then the matrix will be filled with default-
     * constructed TValue values.
     *
     * @fn MatrixScore#write
     *
     * @brief Write a score matrix to a stream.
     *
     * @signature int write(stream, scoreMatrix[, meta]);
     *
     * @param[in,out] stream Stream to write to.
     * @param[out] scoreMatrix MatrixScore object.
     * @param[out] meta Meta information is stored here.
     *
     * @return int Status code, 0 on success, a different value on errors.
     */