(m_Script.empty()) {
58 if(last_op.
op_type== op_type) {
129 for(
int i= tback_range.
GetFrom();
i<= tback_range.
GetTo();
i++) {
130 switch(tback[
i]) {
160TScriptOps::iterator itr(
m_Script.begin());
162 if(link_start + itr->num_ops > tback_range.
GetFrom())
165link_start += itr->num_ops;
173 intcurr_tback = tback_range.
GetFrom();
175curr_tback <= tback_range.
GetTo()) {
181 intnum_ops =
min(tback_range.
GetTo() - curr_tback + 1,
182link_start + itr->num_ops - curr_tback);
184new_script.
AddOps(itr->op_type, num_ops);
185curr_tback += num_ops;
186link_start += itr->num_ops;
199 boolgo_past_seq1_gap)
202 TOffsetq = start_offsets.first;
203 TOffsets = start_offsets.second;
204TScriptOps::iterator itr(
m_Script.begin());
216 if(s + itr->num_ops > seq2_target) {
217 if(go_past_seq1_gap ==
false) {
218q--; s--; curr_tback--;
222curr_tback += itr->num_ops;
229curr_tback += itr->num_ops;
236 if(s + itr->num_ops > seq2_target) {
237curr_tback += seq2_target - s;
238q += seq2_target - s;
244curr_tback += itr->num_ops;
253curr_tback += itr->num_ops;
263new_offsets.first = q;
264new_offsets.second = s;
265new_tback = curr_tback;
273 boolgo_past_seq2_gap)
276 TOffsetq = start_offsets.first;
277 TOffsets = start_offsets.second;
278TScriptOps::iterator itr(
m_Script.begin());
291curr_tback += itr->num_ops;
298 if(q + itr->num_ops > seq1_target) {
299curr_tback += seq1_target - q;
300s += seq1_target - q;
306curr_tback += itr->num_ops;
314 if(q + itr->num_ops > seq1_target) {
315 if(go_past_seq2_gap ==
false) {
316q--; s--; curr_tback--;
320curr_tback += itr->num_ops;
327curr_tback += itr->num_ops;
337new_offsets.first = q;
338new_offsets.second = s;
339new_tback = curr_tback;
346 int**seq2_pssm,
intgap_open,
intgap_extend)
348 TOffsetq = start_offsets.first;
349 TOffsets = start_offsets.second;
356TScriptOps::iterator itr(
m_Script.begin());
358 if(link_start + itr->num_ops > tback_range.
GetFrom())
361 switch(itr->op_type) {
376link_start += itr->num_ops;
383 switch(itr->op_type) {
385s += tback_range.
GetFrom() - link_start;
388s += tback_range.
GetFrom() - link_start;
389q += tback_range.
GetFrom() - link_start;
392q += tback_range.
GetFrom() - link_start;
401curr_tback <= tback_range.
GetTo()) {
407 intnum_ops =
min(tback_range.
GetTo() - curr_tback + 1,
408link_start + itr->num_ops - curr_tback);
411 switch(itr->op_type) {
413score += gap_open + num_ops * gap_extend;
417 for(
int i= 0;
i< num_ops;
i++) {
419score += seq2_pssm[s +
i][c];
425score += gap_open + num_ops * gap_extend;
432curr_tback += num_ops;
433link_start += itr->num_ops;
446vector<TOffsetPair> region_list;
447 intq = start_offsets.first;
448 ints = start_offsets.second;
450TScriptOps::iterator itr(
m_Script.begin());
452 switch(itr->op_type) {
int TOffset
Basic data type for offsets into a sequence.
pair< TOffset, TOffset > TOffsetPair
Basic type specifying a range on a sequence.
Interface for the traceback from blast hits.
void VerifyScript(TRange seq1_range, TRange seq2_range)
Validate that the alignment described by the CEditScript has the same size for each sequence as the i...
int GetScore(TRange tback_range, TOffsetPair start_offsets, CSequence &seq1, int **seq2_pssm, int gap_open, int gap_extend)
Compute the score associated with (a portion of) an alignment Assumes that seq1 is a sequence and tha...
void FindOffsetFromSeq2(TOffsetPair start_offsets, TOffsetPair &new_offsets, TOffset seq2_target, TOffset &new_tback, bool go_past_seq1_gap)
Given a subject offset, find the corresponding query offset.
TScriptOps m_Script
The list of edit operations in the current edit script.
CEditScript()
Generate empty traceback.
void FindOffsetFromSeq1(TOffsetPair start_offsets, TOffsetPair &new_offsets, TOffset seq1_target, TOffset &new_tback, bool go_past_seq2_gap)
Given a query offset, find the corresponding subject offset.
CEditScript MakeEditScript(TRange tback_range)
Return an edit script corresponding to a subset of the complete traceback available.
vector< TOffsetPair > ListMatchRegions(TOffsetPair start_offsets)
Compile a list of regions in the current edit script that contain substitutions.
void AddOps(EGapAlignOpType op_type, int num_ops)
Add a new edit operation to the current list.
Class for representing protein sequences.
unsigned char GetLetter(int pos) const
Access the sequence letter at a specified position.
EGapAlignOpType
Operation types within the edit script.
@ eGapAlignIns
Insertion: a gap in subject.
@ eGapAlignSub
Substitution.
@ eGapAlignDel
Deletion: a gap in query.
vector< ETranscriptSymbol > TTranscript
int TSignedSeqPos
Type for signed sequence position.
int32_t Int4
4-byte (32-bit) signed integer
position_type GetLength(void) const
#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.
const TStarts & GetStarts(void) const
Get the Starts member data.
const TLens & GetLens(void) const
Get the Lens member data.
TLen GetLen(void) const
Get the Len member data.
vector< TSignedSeqPos > TStarts
TDim GetDim(void) const
Get the Dim member data.
TDim GetDim(void) const
Get the Dim member data.
TNumseg GetNumseg(void) const
Get the Numseg member data.
unsigned int
A callback function used to compare two keys in a database.
Runlength-encoded representation of a traceback operation.
int num_ops
number of such operations
EGapAlignOpType op_type
type of operation
Edit script: linked list of correspondencies between two sequences.
Int4 * num
Array of number of operations.
Int4 size
Size of above arrays.
EGapAlignOpType * op_type
Array of type of operation.
Interface for CEditScript class.
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