#include <HashTableTranslated.h>
Inheritance diagram for HashTableComponent:


Public Member Functions | |
| HashTableComponent (ostream &monitoringStream, string name, Allocator< PositionPacked > &hitListAllocator=defaultHitListAllocator, Allocator< PositionInHitList > &arrayAllocator=defaultArrayAllocator) | |
| virtual void | convertHits (PackedHitStore &hits, HitList &hitListFwd) |
| void | setQueryFrame (int qf) |
Private Attributes | |
| int | queryFrame_ |
Definition at line 55 of file HashTableTranslated.h.
| HashTableComponent::HashTableComponent | ( | ostream & | monitoringStream, | |
| string | name, | |||
| Allocator< PositionPacked > & | hitListAllocator = defaultHitListAllocator, |
|||
| Allocator< PositionInHitList > & | arrayAllocator = defaultArrayAllocator | |||
| ) |
Definition at line 49 of file HashTableTranslated.cpp.
References HashTableGeneric::bitsPerSymbol_, g32BitPackedProtein, generateSubstitutesProtein(), gResidueBits, HashTableGeneric::hitListFormat_, HashTableGeneric::monitoringStream_, HashTablePacked::pGenerateSubstitutes_, and HashTableGeneric::pNameReader_.
00052 : 00053 queryFrame_(0), 00054 HashTablePacked( monitoringStream, name, 00055 hitListAllocator, arrayAllocator ) 00056 { 00057 hitListFormat_ = g32BitPackedProtein; 00058 bitsPerSymbol_ = gResidueBits; 00059 pGenerateSubstitutes_ = &generateSubstitutesProtein; 00060 monitoringStream_ << "constructing HashTableComponent" << endl; 00061 pNameReader_ = new NameReader; // dummy, component contains no name info 00062 } // ~constructor
Here is the call graph for this function:

| void HashTableComponent::convertHits | ( | PackedHitStore & | hits, | |
| HitList & | hitListFwd | |||
| ) | [virtual] |
Reimplemented from HashTablePacked.
Definition at line 67 of file HashTableTranslated.cpp.
References HitListVector::addHit(), gNumReadingFrames, queryFrame_, HashTablePacked::seqStarts_, HashTablePacked::sorter_, and HashTableGeneric::stepLength_.
00068 { 00069 00070 // sort(packedHits.begin(),packedHits.end()); 00071 sorter_(packedHits); 00072 00073 vector<HitPacked>::iterator i(packedHits.begin()); 00074 vector<SeqStartPos>::iterator j(seqStarts_.begin()); 00075 HitListVector::size_type sortStart; 00076 00077 SequenceNumber adjustedSeqNum; 00078 int subjectFrame; 00079 00080 // hitListFwd.reserve(hitListFwd.size()+packedHits.size()); 00081 00082 // NB seqStarts_ must not be empty else call to back() segfaults 00083 00084 while 00085 ( (j!=static_cast<vector<SeqStartPos>::iterator>(&seqStarts_.back())) 00086 && (i!=packedHits.end()) ) 00087 { 00088 vector<SeqStartPos>::iterator ub(upper_bound(j,seqStarts_.end(),i->first)); 00089 j=ub; j--; 00090 00091 sortStart=hitListFwd.size(); 00092 while ((i!=packedHits.end())&&(i->first<*ub)) 00093 { 00094 // cout << "Hit: " << i->first << " ... " 00095 // << ub-seqStarts_.begin() << " " 00096 // << stepLength_*(i->first - *j) << " " 00097 // << i->second << endl; 00098 00099 adjustedSeqNum 00100 = ub-seqStarts_.begin() - 1; // 0,1,2 ... etc. 00101 subjectFrame = adjustedSeqNum % gNumReadingFrames; 00102 adjustedSeqNum /= gNumReadingFrames; 00103 adjustedSeqNum++; 00104 00105 00106 // cout 00107 // << "aHit: " 00108 //<< adjustedSeqNum << " " 00109 // << (gNumReadingFrames*stepLength_*(i->first - *j))+subjectFrame << " " 00110 // << (gNumReadingFrames*i->second)+queryFrame_ << endl; 00111 hitListFwd.addHit 00112 ( adjustedSeqNum, 00113 (gNumReadingFrames*stepLength_*(i->first - *j))+subjectFrame, 00114 (gNumReadingFrames*i->second)+queryFrame_); 00115 // hitListFwd.addHit( ub-seqStarts_.begin(), 00116 // stepLength_*(i->first - *j), 00117 // i->second ); 00118 i++; 00119 00120 } // ~while i 00121 sort 00122 ( static_cast<HitList::iterator>(&hitListFwd[sortStart]), 00123 hitListFwd.end(), 00124 LessThanDiff() ); 00125 j=ub; 00126 } // ~while j 00127 00128 } // ~HashTableComponent::convertHits
Here is the call graph for this function:

| void HashTableComponent::setQueryFrame | ( | int | qf | ) | [inline] |
Definition at line 68 of file HashTableTranslated.h.
References queryFrame_.
Referenced by HashTableTranslated::matchSequenceProtein(), and HashTableTranslated::matchSequenceTranslatedDNA().
00068 { queryFrame_ = qf; }
Here is the caller graph for this function:

int HashTableComponent::queryFrame_ [private] |
Definition at line 72 of file HashTableTranslated.h.
Referenced by HashTablePackedProtein::convertHits(), convertHits(), HashTablePackedProtein::matchSequenceTranslatedDNA(), and setQueryFrame().
1.5.2