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


Public Types | |
| typedef void(HashTablePackedProtein::*) | MatchSequencePointer (WordSequence &, HitList &) |
Public Member Functions | |
| HashTablePackedProtein (ostream &monitoringStream, string name="", Allocator< PositionPacked > &hitListAllocator=defaultHitListAllocator, Allocator< PositionInHitList > &arrayAllocator=defaultArrayAllocator) | |
| virtual void | convertHits (PackedHitStore &packedHits, HitList &hitListFwd) |
| virtual void | matchSequence (WordSequence &seq, HitList &hitListFwd) |
| void | matchSequenceProtein (WordSequence &seq, HitList &hitListFwd) |
| void | matchSequenceTranslatedDNA (WordSequence &seq, HitList &hitListFwd) |
| void | setQueryProtein (void) |
| void | setQueryTranslatedDNA (void) |
Private Attributes | |
| CodonList | codons_ |
| SequenceEncoderCodon | codonEncoder_ |
| int | queryFrame_ |
| int | queryMult_ |
| MatchSequencePointer | pMatchSequence_ |
Definition at line 85 of file HashTableTranslated.h.
| typedef void(HashTablePackedProtein::* ) HashTablePackedProtein::MatchSequencePointer(WordSequence &, HitList &) |
| HashTablePackedProtein::HashTablePackedProtein | ( | ostream & | monitoringStream, | |
| string | name = "", |
|||
| Allocator< PositionPacked > & | hitListAllocator = defaultHitListAllocator, |
|||
| Allocator< PositionInHitList > & | arrayAllocator = defaultArrayAllocator | |||
| ) |
Definition at line 134 of file HashTableTranslated.cpp.
References HashTableGeneric::bitsPerSymbol_, g32BitPackedProtein, generateSubstitutesProtein(), gResidueBits, HashTableGeneric::hitListFormat_, HashTableGeneric::monitoringStream_, and HashTablePacked::pGenerateSubstitutes_.
00137 : 00138 queryFrame_(0), 00139 queryMult_(1), 00140 codonEncoder_(5), 00141 pMatchSequence_( &HashTablePackedProtein::matchSequenceProtein ), 00142 HashTablePacked( monitoringStream, name, 00143 hitListAllocator, arrayAllocator ) 00144 { 00145 hitListFormat_ = g32BitPackedProtein; 00146 bitsPerSymbol_ = gResidueBits; 00147 pGenerateSubstitutes_ = &generateSubstitutesProtein; 00148 monitoringStream_ << "constructing HashTablePackedProtein" << endl; 00149 } // constructor
Here is the call graph for this function:

| void HashTablePackedProtein::convertHits | ( | PackedHitStore & | packedHits, | |
| HitList & | hitListFwd | |||
| ) | [virtual] |
Reimplemented from HashTablePacked.
Definition at line 156 of file HashTableTranslated.cpp.
References HitListVector::addHit(), HashTableComponent::queryFrame_, HashTablePacked::seqStarts_, HashTablePacked::sorter_, and HashTableGeneric::stepLength_.
00157 { 00158 00159 00160 // sort(packedHits.begin(),packedHits.end()); 00161 sorter_(packedHits); 00162 00163 vector<HitPacked>::iterator i(packedHits.begin()); 00164 vector<SeqStartPos>::iterator j(seqStarts_.begin()); 00165 HitListVector::size_type sortStart; 00166 00167 //SequenceNumber adjustedSeqNum; 00168 //int subjectFrame; 00169 00170 // hitListFwd.reserve(hitListFwd.size()+packedHits.size()); 00171 00172 // NB seqStarts_ must not be empty else call to back() segfaults 00173 00174 while 00175 ( (j!=static_cast<vector<SeqStartPos>::iterator>(&seqStarts_.back())) 00176 && (i!=packedHits.end()) ) 00177 { 00178 vector<SeqStartPos>::iterator ub(upper_bound(j,seqStarts_.end(),i->first)); 00179 j=ub; j--; 00180 00181 sortStart=hitListFwd.size(); 00182 while ((i!=packedHits.end())&&(i->first<*ub)) 00183 { 00184 // cout << "Hit: " << i->first << " ... " 00185 // << ub-seqStarts_.begin() << " " 00186 // << stepLength_*(i->first - *j) << " " 00187 // << i->second << endl; 00188 00189 // cout 00190 // << "aHit: " 00191 // << ub-seqStarts_.begin() << " " 00192 // << queryMult_*stepLength_*(i->first - *j) << " " 00193 //<< (queryMult_*i->second)+queryFrame_ << endl; 00194 hitListFwd.addHit 00195 ( ub-seqStarts_.begin(), 00196 (queryMult_*stepLength_*(i->first - *j)), 00197 (queryMult_*i->second)+queryFrame_); 00198 // hitListFwd.addHit( ub-seqStarts_.begin(), 00199 // stepLength_*(i->first - *j), 00200 // i->second ); 00201 i++; 00202 00203 } // ~while i 00204 sort 00205 ( static_cast<HitList::iterator>(&hitListFwd[sortStart]), 00206 hitListFwd.end(), 00207 LessThanDiff() ); 00208 j=ub; 00209 } // ~while j 00210 00211 00212 } // ~HashTablePackedProtein::convertHits
Here is the call graph for this function:

| virtual void HashTablePackedProtein::matchSequence | ( | WordSequence & | seq, | |
| HitList & | hitListFwd | |||
| ) | [inline, virtual] |
Reimplemented from HashTablePacked.
Definition at line 102 of file HashTableTranslated.h.
References pMatchSequence_.
Referenced by main().
00103 { 00104 (this->*pMatchSequence_)(seq, hitListFwd); 00105 } // ~matchSequence
Here is the caller graph for this function:

| void HashTablePackedProtein::matchSequenceProtein | ( | WordSequence & | seq, | |
| HitList & | hitListFwd | |||
| ) |
Definition at line 215 of file HashTableTranslated.cpp.
References HashTablePacked::matchSequence().
Referenced by setQueryProtein().
00216 { 00217 HashTablePacked::matchSequence( seq, hitListFwd ); 00218 } // ~HashTablePackedProtein::matchSequenceProtein
Here is the call graph for this function:

Here is the caller graph for this function:

| void HashTablePackedProtein::matchSequenceTranslatedDNA | ( | WordSequence & | seq, | |
| HitList & | hitListFwd | |||
| ) |
Definition at line 222 of file HashTableTranslated.cpp.
References HashTableTranslated::codonEncoder_, codonize(), HashTableTranslated::codons_, SequenceEncoder::encode(), gNumReadingFrames, SequenceEncoder::linkSeq(), HashTablePacked::matchSequence(), HashTableComponent::queryFrame_, SequenceEncoder::setWordLength(), SequenceEncoder::unlinkSeq(), and HashTableGeneric::wordLength_.
Referenced by setQueryTranslatedDNA().
00223 { 00224 codonEncoder_.setWordLength( wordLength_ ); 00225 00226 WordSequence translatedSeq; 00227 for (queryFrame_ = 0; queryFrame_ < gNumReadingFrames; queryFrame_++) 00228 { 00229 codons_.clear(); 00230 codonize ( seq, codons_, queryFrame_ ); 00231 translatedSeq.clear(); 00232 codonEncoder_.linkSeq( translatedSeq ); 00233 codonEncoder_.encode( codons_ ); 00234 codonEncoder_.unlinkSeq(); 00235 HashTablePacked::matchSequence( translatedSeq, hitListFwd ); 00236 } // ~for 00237 00238 } // ~HashTablePackedProtein::matchSequenceTranslatedDNA
Here is the call graph for this function:

Here is the caller graph for this function:

| void HashTablePackedProtein::setQueryProtein | ( | void | ) | [inline] |
Definition at line 110 of file HashTableTranslated.h.
References matchSequenceProtein(), pMatchSequence_, queryFrame_, and queryMult_.
Referenced by doSearch().
00111 { 00112 pMatchSequence_ = &HashTablePackedProtein::matchSequenceProtein; 00113 queryMult_ = 1; 00114 queryFrame_ = 0; 00115 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void HashTablePackedProtein::setQueryTranslatedDNA | ( | void | ) | [inline] |
Definition at line 116 of file HashTableTranslated.h.
References gNumReadingFrames, matchSequenceTranslatedDNA(), pMatchSequence_, queryFrame_, and queryMult_.
00117 { 00118 pMatchSequence_ = &HashTablePackedProtein::matchSequenceTranslatedDNA; 00119 queryMult_ = gNumReadingFrames; 00120 queryFrame_ = 0; 00121 }
Here is the call graph for this function:

CodonList HashTablePackedProtein::codons_ [private] |
Definition at line 124 of file HashTableTranslated.h.
Definition at line 125 of file HashTableTranslated.h.
int HashTablePackedProtein::queryFrame_ [private] |
Definition at line 127 of file HashTableTranslated.h.
Referenced by setQueryProtein(), and setQueryTranslatedDNA().
int HashTablePackedProtein::queryMult_ [private] |
Definition at line 128 of file HashTableTranslated.h.
Referenced by setQueryProtein(), and setQueryTranslatedDNA().
Reimplemented from HashTablePacked.
Definition at line 130 of file HashTableTranslated.h.
Referenced by matchSequence(), setQueryProtein(), and setQueryTranslatedDNA().
1.5.2