#include <MatchAligner.h>
Inheritance diagram for MatchAlignerTranslatedDNA:


Public Member Functions | |
| MatchAlignerTranslatedDNA (int numCols=80, int bandExtension=0, ostream &outputStream=cout) | |
| virtual void | formatAlignment (Alignment &alignment, const char *pQuery, int queryStart, int queryEnd, const char *pSubject, int subjectStart, int subjectEnd) |
Definition at line 357 of file MatchAligner.h.
| MatchAlignerTranslatedDNA::MatchAlignerTranslatedDNA | ( | int | numCols = 80, |
|
| int | bandExtension = 0, |
|||
| ostream & | outputStream = cout | |||
| ) | [inline] |
Definition at line 360 of file MatchAligner.h.
00362 : 00363 MatchAlignerTranslated( numCols, 00364 bandExtension, 00365 false, 00366 false, 00367 outputStream ) 00368 {} // ~MatchAlignerTranslatedDNA::MatchAlignerTranslatedDNA
| void MatchAlignerTranslatedDNA::formatAlignment | ( | Alignment & | alignment, | |
| const char * | pQuery, | |||
| int | queryStart, | |||
| int | queryEnd, | |||
| const char * | pSubject, | |||
| int | subjectStart, | |||
| int | subjectEnd | |||
| ) | [virtual] |
Reimplemented from MatchAligner.
Definition at line 874 of file MatchAligner.cpp.
References alignBreakFrameShiftQuery, alignBreakFrameShiftSubject, alignBreakMismatch, MatchAligner::matchChar(), MatchAligner::numCols_, MatchAligner::outputAlignmentColumn(), MatchAligner::outputAlignmentLine(), MatchAligner::outputStream_, MatchAligner::pBufSeq1_, MatchAligner::pCursorAlign_, MatchAligner::pCursorSeq1_, MatchAligner::pCursorSeq2_, and Alignment::totalScore_.
00877 { 00878 00879 outputStream_ << "Alignment score: " << alignment.totalScore_ << endl; 00880 00881 int queryNext(queryStart); 00882 int subjectNext(subjectStart); 00883 char codonChar; 00884 00885 pCursorSeq1_ = &pBufSeq1_[numCols_]; // triggers reset to start of line 00886 00887 *pBufSeq1_='\0'; // ensures 3 null strings are printed at first line break 00888 // *pBufSeq2_='\0'; // - this line not necessary?? 00889 // *pBufAlign_='\0'; // - this line not necessary?? 00890 00891 Alignment::iterator i(alignment.begin()); 00892 00893 while( i!=alignment.end() ) 00894 { 00895 // cout << queryNext << " " << subjectNext << endl; 00896 00897 if (i->numMatches>0) 00898 { // TBD do these en masse? 00899 codonChar = getCodon( pQuery ); 00900 if ((codonChar!='X')&&(codonChar == getCodon(pSubject))) 00901 { 00902 outputAlignmentColumn 00903 ( 00904 *(pQuery++), 00905 codonChar, 00906 *(pSubject++), 00907 queryNext++, 00908 subjectNext++ 00909 ); 00910 outputAlignmentColumn 00911 (*(pQuery++), '.', *(pSubject++), queryNext++, subjectNext++ ); 00912 outputAlignmentColumn 00913 (*(pQuery++), '.', *(pSubject++), queryNext++, subjectNext++ ); 00914 } // ~if 00915 else 00916 { 00917 outputAlignmentColumn 00918 ( *pQuery, matchChar(*pQuery,*pSubject) ? '|' : 'x', *pSubject, queryNext++, subjectNext++ ); 00919 pQuery++; pSubject++; 00920 outputAlignmentColumn 00921 ( *pQuery, matchChar(*pQuery,*pSubject) ? '|' : 'x', *pSubject, queryNext++, subjectNext++ ); 00922 pQuery++; pSubject++; 00923 outputAlignmentColumn 00924 ( *pQuery, matchChar(*pQuery,*pSubject) ? '|' : 'x', *pSubject, queryNext++, subjectNext++ ); 00925 pQuery++; pSubject++; 00926 } // ~else 00927 00928 i->numMatches--; 00929 } 00930 else 00931 { 00932 #ifdef XXX 00933 if (i->breakType==alignBreakMismatch) 00934 { 00935 outputAlignmentColumn 00936 (*(pQuery++), 'x', *(pSubject++), queryNext++, subjectNext++ ); 00937 outputAlignmentColumn 00938 (*(pQuery++), 'x', *(pSubject++), queryNext++, subjectNext++ ); 00939 outputAlignmentColumn 00940 (*(pQuery++), 'x', *(pSubject++), queryNext++, subjectNext++ ); 00941 } // ~if 00942 else 00943 #endif 00944 if (i->breakType==alignBreakFrameShiftQuery) 00945 { 00946 outputAlignmentColumn 00947 (*(pQuery++), ' ', '-', queryNext++, subjectNext ); 00948 00949 } // ~else if 00950 else if (i->breakType==alignBreakFrameShiftSubject) 00951 { 00952 outputAlignmentColumn 00953 ( '-', ' ', *(pSubject++), queryNext, subjectNext++ ); 00954 } // ~else if 00955 i++; 00956 } // ~else 00957 00958 } // ~while 00959 00960 *pCursorSeq1_='\0'; 00961 *pCursorSeq2_='\0'; 00962 *pCursorAlign_='\0'; 00963 00964 outputAlignmentLine(); 00965 00966 00967 00968 } // ~MatchAlignerTranslatedDNA::formatAlignment
Here is the call graph for this function:

1.5.2