Class BlastScoringScheme
Wrapper around a SeqAn scoring scheme

Defined in <seqan/blast.h>
Signature struct BlastScoringScheme<TScoringScheme> { ... };

Template Parameters

TScoringScheme A SeqAn Score type

Interface Function Overview

Detailed Description

This class wraps around a SeqAn scoring scheme and add functions for the retrievel of pre-computed Karlin-Altschul-Values (required for e-value statistics) and it modifies the gap-scoring slightly. If you use high-level IO (BlastReport, BlastTabular) you need not worry about the specifics, however you should always make sure that the scoring scheme isValid after you modify it (or check the return values of the set* functions).

To retrieve a score-object compatible with regular SeqAn-functions, call seqanScheme.

Gap cost computation

Gap-costs are computed differently in SeqAn and in BLAST. Blast (and many other tools) compute scores of a stretch of gaps as s = gO + n * gE where gO is the gapOpen score, gE is the gap extend score and n ist the total number of gap characters.

SeqAn, however, normally computes them as as s = gO + (n-1) * gE.

Effectively this results only in a different gap open score. To make dealing with this easier, there are convenience functions for setting and getting the gap open score in blast convention: scoreGapOpenBlast and setScoreGapOpenBlast.

Karlin-Altschul values

E-Value statistics require certain pre-computed constants. The BlastScoringScheme picks these automatically whenever you modify it. Unfortunately there aren't parameters for all combinations of scoring schemes and gap costs, so you have to check isValid after modifying it or verify the return value of the set* functions which is bool here (instead of void).

More details on the scoring parameters is in these slides: https://www.cs.umd.edu/class/fall2011/cmsc858s/Local_Alignment_Statistics.pdf.

The constants used in SeqAn were imported from the NCBI blast source code (blast-2.2.26)

Interface Functions Detail

double computeBitScore(rawScore, blastScoringScheme);

Compute the bit-score for a given raw score.

Parameters

rawScore The raw score of the alignment.
blastScoringScheme The BlastScoringScheme.

Returns

double The bit-score computed.

Data Races

Thread safety unknown!

double computeEValue(rawScore, queryLength, dbLength, blastScoringScheme);

Compute the E-Value for a given raw score and sequence lengths.

Parameters

rawScore The raw score of the alignment.
queryLength The length of the query sequence.
dbLength The length of the database in case of many subject sequences, otherwise the length of the subject sequence.
blastScoringScheme The BlastScoringScheme.

Returns

double The e-value computed.

Data Races

Thread safety unknown!

double getAlpha(blastScoringScheme);

Get the α value of the Karlin-Altschul parameters.

Data Races

Thread safety unknown!

double getBeta(blastScoringScheme);

Get the β value of the Karlin-Altschul parameters.

Data Races

Thread safety unknown!

double getH(blastScoringScheme);

Get the H value of the Karlin-Altschul parameters.

Data Races

Thread safety unknown!

double getKappa(blastScoringScheme);

Get the Κ value of the Karlin-Altschul parameters.

Data Races

Thread safety unknown!

double getLambda(blastScoringScheme);

Get the λ value of the Karlin-Altschul parameters.

Data Races

Thread safety unknown!

bool isValid(blastScoringScheme);

check whether valid KarlinAltschulValues are selected

Data Races

Thread safety unknown!

TValue scoreGapExtend(blastScoringScheme);

The Gap Extend score.

Data Races

Thread safety unknown!

TValue scoreGapOpen(blastScoringScheme);

The Gap Open score in SeqAn convention.

Data Races

Thread safety unknown!

TValue scoreGapOpenBlast(blastScoringScheme);

The Gap Open score in Blast convention.

Data Races

Thread safety unknown!

int scoreMatch(blastScoringScheme);

The Match score (only for SimpleScore specialization).

Data Races

Thread safety unknown!

int scoreMismatch(blastScoringScheme);

The Mismatch score (only for SimpleScore specialization).

Data Races

Thread safety unknown!

TScoringScheme const & seqanScheme(blastScoringScheme);

Retrieve a Score object for use with e.g. localAlignment.

Returns

TScoringScheme_const_& the internal scoring object for use with other SeqAn functions.

Remarks

The reference returned is always const, because you should not modify the internal score object directly. Use BlastScoringScheme's interface instead.

Data Races

Thread safety unknown!

bool setScoreGapExtend(blastScoringScheme, value);

Set gap extend score.

Parameters

blastScoringScheme The BlastScoringScheme to modify.
value The new value.

Returns

isValid(blastScoringScheme) whether Karlin-Altschul values for the new scheme exist.

Data Races

Thread safety unknown!

bool setScoreGapOpen(blastScoringScheme, value);

Set gap open score in SeqAn convention.

Parameters

blastScoringScheme The BlastScoringScheme to modify.
value The new value.

Returns

isValid(blastScoringScheme) whether Karlin-Altschul values for the new scheme exist.

Data Races

Thread safety unknown!

bool setScoreGapOpenBlast(blastScoringScheme, value);

Set gap open score in BLAST convention.

Parameters

blastScoringScheme The BlastScoringScheme to modify.
value The new value.

Returns

isValid(blastScoringScheme) whether Karlin-Altschul values for the new scheme exist.

Data Races

Thread safety unknown!

bool setScoreMatch(blastScoringScheme, value);

Set match score.

Parameters

blastScoringScheme The BlastScoringScheme to modify.
value The new value.

Returns

isValid(blastScoringScheme) whether Karlin-Altschul values for the new scheme exist.

Data Races

Thread safety unknown!

bool setScoreMismatch(blastScoringScheme, value);

Set mismatch score.

Parameters

blastScoringScheme The BlastScoringScheme to modify.
value The new value.

Returns

isValid(blastScoringScheme) whether Karlin-Altschul values for the new scheme exist.

Data Races

Thread safety unknown!