align1.
GetTo() + (seq2_length - 1 - align2.
GetTo()));
68second =
min(second, seq1_length - 1);
77vector<double>& self_score,
82 intnum_queries = query_data.size();
83vector<TRange> seq_ranges(num_queries);
88 for(
int i= 0;
i< num_queries;
i++) {
89self_score[
i] = 0.0;
90seq_ranges[
i].SetEmpty();
97 for(
int i= 0;
i< hitlist.
Size();
i++) {
101 TRange& range1 = seq_ranges[seq1];
102 TRange& range2 = seq_ranges[seq2];
114 for(
int i= 0;
i< num_queries;
i++) {
117 TRange& range = seq_ranges[
i];
133 for(
intj = range.
GetFrom(); j <= range.
GetTo(); j++) {
134 unsigned charc = query_data[
i].GetLetter(j);
135score += score_matrix.
s[c][c];
137self_score[
i] = karlin_blk.
Lambda* score - karlin_blk.
logK;
142printf(
"Self scores:\n");
143 for(
int i= 0;
i< num_queries;
i++) {
144printf(
"query %d(%d): range %d-%d score %lf\n",
i,
146seq_ranges[
i].GetFrom(), seq_ranges[
i].GetTo(),
161 intnum_queries = query_data.size();
162vector<double> self_score(num_queries);
167self_score, karlin_blk);
184 for(
int i= 0;
i< hitlist.
Size();
i++) {
188 doublealign_score = karlin_blk.
Lambda*
192 m_Matrix(j,k) -= 0.5 * align_score *
193(1.0 / self_score[j] + 1.0 / self_score[k]);
198 for(
int i= 0;
i< num_queries;
i++) {
200 for(
intj = 0; j <
i; j++) {
int TOffset
Basic data type for offsets into a sequence.
CDistMethods::TMatrix m_Matrix
Current distance matrix.
void x_GetSelfScores(vector< CSequence > &query_data, CHitList &hitlist, SNCBIFullScoreMatrix &score_matrix, vector< double > &self_score, Blast_KarlinBlk &karlin_blk)
Compute the self-scores of the input sequences.
void ComputeMatrix(vector< CSequence > &query_data, CHitList &hitlist, SNCBIFullScoreMatrix &score_matrix, Blast_KarlinBlk &karlin_blk)
Recompute the distance matrix using new parameters.
An ordered collection of CHit objects.
int Size() const
Retrieve number of hits in list.
CHit * GetHit(int index)
Retrieve a hit from the hitlist.
A generalized representation of a pairwise alignment.
int m_Score
Score of alignment.
int m_SeqIndex1
Numerical identifier for first sequence in alignment.
int m_SeqIndex2
Numerical identifier for second sequence in alignment.
TRange m_SeqRange1
The range of offsets on the first sequence.
TRange m_SeqRange2
The range of offsets on the second sequence.
void Resize(size_t i, size_t j, T val=T())
resize this matrix, filling the empty cells with a known value
void Set(T val)
set all values in the matrix to a known value
static void x_UpdateRanges(TRange &seq1, TRange align1, int seq1_length, TRange align2, int seq2_length)
Update the extent of a sequence that figures into its self score, based upon the sequence ranges of a...
Interface for CDistances class.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
position_type GetLength(void) const
TThisType & Set(position_type from, position_type to)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
Structure to hold the Karlin-Altschul parameters.
double Lambda
Lambda value used in statistics.
double logK
natural log of K value used in statistics
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4