Spec
ProfileSeq ScoreScore for sequence-to-profile alignments.
Extends | Score |
---|---|
All Extended | Score |
Defined in | <seqan/align_profile.h> |
Signature |
template <typename TValue>
class Score<TValue, ProfileSeqScore>;
|
Template Parameters
TValue |
The integer type to use for representing scores. |
---|
Member Function Overview
-
Score::Score();, Score::Score(profile);
Constructor
Interface Function Overview
-
void assignProfile(score, profile);
Assign profile to ProfileSeqScore.
Interface Functions Inherited From Score
Interface Metafunction Overview
Interface Metafunctions Inherited From Score
Detailed Description
Using this class, you can align sequences to profiles. The profile is assumed to be in the horizontal direction (first row), the sequence in the vertical direction (second row).
Scoring works as follows.
The integer SEQAN_CONSENSUS_UNITY and fractions thereof are used to express scores. Gap opens in the profile are scored proportional to the number of gaps in the profile with two times unity, gap extends with one times unity at the position.
Gap opens in the sequence are scored with two times unity, gap extends in the sequence with unity. Alignments of profile characters to sequence characters are scored with the fraction of profile characters that match the sequence characters times unity.
Examples
The following example uses the ProfileSeq Score to align a sequence against a profile. Note that we print the gap state for each position since profiles cannot be printed to one stdout character.
#include <iostream>
#include <seqan/align_profile.h>
using namespace seqan2;
int main()
{
typedef ProfileChar<Dna, int> TDnaProfile;
typedef String<TDnaProfile> TProfileString;
TProfileString profile = "CGAT";
DnaString seq = "CGGAAT";
Gaps<TProfileString> gapsH(profile);
Gaps<DnaString> gapsV(seq);
Score<int, ProfileSeqScore> sScheme(profile);
int val = globalAlignment(gapsH, gapsV, sScheme, NeedlemanWunsch());
std::cout << "score value = " << val << "\n";
std::cout << "gaps in profile/sequence\n"
<< "pos\tG\tS\n";
for (unsigned i = 0; i < length(gapsH); ++i)
std::cerr << i << "\t" << isGap(gapsH, i) << "\t" << isGap(gapsV, i) << "\n";
return 0;
}
The output is as follows:
score value = -2097152 gaps in profile/sequence pos G S 0 0 0 1 1 0 2 0 0 3 1 0 4 0 0 5 0 0
Member Functions Detail
Score::Score();
Score::Score(profile);
Parameters
profile
|
The profile to copy from (AllocString of ProfileChar objects). |
---|
When providing profile, the function assignProfile is automatically used to assign the profile to this class.
Data Races
Interface Functions Detail
void assignProfile(score, profile);
Parameters
score
|
The ProfileSeqScore object to assign the profile for. |
---|---|
profile
|
The profile to assign to the score. AllocString of ProfileChar. |