# fn() localAlignmentScore
Computes the best global pairwise alignment score.

Defined in | <seqan/align.h>
Signature | `TScoreVal localAlignmentScore([exec,] subject, query, scoringScheme[, lowerDiag, upperDiag]);`

## Parameters

`exec` | Policy to select execution mode of alignment algorithm.
`subject` | Subject sequence(s) (horizontal in alignment matrix). Must satisfy ContainerConcept or container-of-container concept.
`query` | Query sequence(s) (vertical in alignment matrix). Must satisfy ContainerConcept or container-of-container concept.
`scoringScheme` | The scoring scheme to use for the alignment. Note that the user is responsible for ensuring that the scoring scheme is compatible with `algorithmTag`. Type: Score.
`lowerDiag` | Optional lower diagonal. Types: `int`
`upperDiag` | Optional upper diagonal. Types: `int`

## Return Values

`TScoreVal` | Score value of the resulting alignment (Metafunction: Value of the type of `scoringScheme`). If subject and query are sets the function returns a set of scores representing the score for each pairwise alignment (`subject[i]` with `query[i]`).

## Detailed Description

This function does not perform the (linear time) traceback step after the (mostly quadratic time) dynamic programming step. Local alignment score can be either used with two sequences or two sets of sequences of equal size.

### Parallel execution

Some of the local alingment score functions are parallelized and vectorized. The parallelization mode can be selected via the ExecutionPolicy as first argument. Following execution modes are possible: sequential, parallel, wave-front, vectorized, parallel+vectorized and wave-front+vectorized.

The wave-front execution can be selected via the WavefrontExecutionPolicy, which can also be combined with a vectorized execution. In addition the wave-front execution parallelizes a single pairwise alignment, while the standard Parallel specialization does only parallelizes the sequence set via chunking. Note, the banded version is at the moment only supported for the following execution modes: sequential, parallel, vectorized and parallel+vectorized. At the moment the vectorized version only works reliable if all subject sequences and respectively all query sequences have the same length.

## Data Races

thread-safe. No shared state is modified during the execution and concurrent invocations of this function on the same data does not cause any race conditions.

## See Also

- https://seqan.readthedocs.io/en/develop/Tutorial/Algorithms/Alignment/PairwiseSequenceAlignment.html
- localAlignment

#### Dox Sources

    /*!
     * @fn localAlignmentScore
     *
     * @headerfile <seqan/align.h>
     *
     * @brief Computes the best global pairwise alignment score.
     *
     * @signature TScoreVal localAlignmentScore([exec,] subject, query,
     *            scoringScheme[, lowerDiag, upperDiag]);
     *
     * @param[in] exec @link ExecutionPolicy Policy@endlink to select execution mode
     *                 of alignment algorithm.
     * @param[in] subject Subject sequence(s) (horizontal in alignment matrix). Must
     *                    satisfy @link ContainerConcept @endlink or container-of-
     *                    container concept.
     * @param[in] query Query sequence(s) (vertical in alignment matrix). Must
     *                  satisfy @link ContainerConcept @endlink or container-of-
     *                  container concept.
     * @param[in] scoringScheme The scoring scheme to use for the alignment. Note
     *                          that the user is responsible for ensuring that the
     *                          scoring scheme is compatible with
     *                          <tt>algorithmTag</tt>. Type: @link Score @endlink.
     * @param[in] lowerDiag Optional lower diagonal. Types: <tt>int</tt>
     * @param[in] upperDiag Optional upper diagonal. Types: <tt>int</tt>
     *
     * @return TScoreVal Score value of the resulting alignment (Metafunction: @link
     *                   Score#Value @endlink of the type of
     *                   <tt>scoringScheme</tt>). If subject and query are sets the
     *                   function returns a set of scores representing the score for
     *                   each pairwise alignment (<tt>subject[i]</tt> with
     *                   <tt>query[i]</tt>).
     *
     * @datarace thread-safe. No shared state is modified during the execution and
     *           concurrent invocations of this function on the same data does not
     *           cause any race conditions.
     *
     * This function does not perform the (linear time) traceback step after the
     * (mostly quadratic time) dynamic programming step. Local alignment score can
     * be either used with two sequences or two sets of sequences of equal size.
     *
     * @section Parallel execution
     *
     * Some of the local alingment score functions are parallelized and vectorized.
     * The parallelization mode can be selected via the @link ExecutionPolicy
     * @endlink as first argument. Following execution modes are possible:
     * <i>sequential</i>, <i>parallel</i>, <i>wave-front</i>, <i>vectorized</i>,
     * <i>parallel+vectorized</i> and <i>wave-front+vectorized</i>.
     *
     * The wave-front execution can be selected via the @link
     * WavefrontExecutionPolicy @endlink, which can also be combined with a
     * vectorized execution. In addition the wave-front execution parallelizes a
     * single pairwise alignment, while the standard @link ParallelismTags#Parallel
     * @endlink specialization does only parallelizes the sequence set via chunking.
     * Note, the banded version is at the moment only supported for the following
     * execution modes: <i>sequential</i>, <i>parallel</i>, <i>vectorized</i> and
     * <i>parallel+vectorized</i>. At the moment the vectorized version only works
     * reliable if all subject sequences and respectively all query sequences have
     * the same length.
     *
     * @see https://seqan.readthedocs.io/en/develop/Tutorial/Algorithms/Alignment/Pa
     *      irwiseSequenceAlignment.html
     * @see localAlignment
     */