kzblast.h
Go to the documentation of this file.00001 #ifndef KZBLAST_H
00002 #define KZBLAST_H
00003
00004 #include "linktrie.h"
00005 #include "alignseg.h"
00006 #include <list>
00007
00008 using namespace std;
00009
00010 struct BlastParameter {
00011 BlastParameter() : wordSize(3), neighborThreshold(wordSize*3.3),
00012 neighborFraction(0.7), wordjoin(4), extDropoff(-1),
00013 extCutoff(11), gapOpen(-11), gapExtend(-1), gapAlignDropOff(12) { }
00014
00015 int wordSize;
00016 float neighborThreshold;
00017 float neighborFraction;
00018 int wordjoin;
00019 int extDropoff;
00020 int extCutoff;
00021 int gapOpen;
00022 int gapExtend;
00023 int gapAlignDropOff;
00024 };
00025
00034 class Lale {
00035 public:
00036 Lale() : qseq(0), mtx("blosum62.50"), param(), fsa(new ltrie(4)), maxss() { }
00037 Lale(int ws, const BlastParameter& bp)
00038 : mtx("blosum62.50"), param(bp), fsa(new ltrie(ws)), maxss() { }
00039 void readQuery(const string &file);
00040 void buildfsa() { fsa->build(qseq->toString(), mtx, param.neighborThreshold, param.neighborFraction); }
00041
00044 void showfsa(ostream &ous) const { fsa->showLeafs(ous); }
00048 list<Alignseg>& findMatch(const bioseq &s);
00059 int extendhit(Alignseg &as, const int* tc, const int tclen);
00060 void showseg_debug(const Alignseg &as, const bioseq& ss) const;
00061 void showmaxss_debug(const bioseq* tseq) const;
00062
00067 bool isComplete(const Alignseg& as, const bioseq &ss);
00068 void setMatrix(const Matrix& mt) { mtx=mt; }
00069 const Matrix* getMatrix() const { return &mtx; }
00070 const bioseq* getQuery() const { return qseq; }
00071
00072 private:
00073 void mergeNeighbor(list<Alignseg> &segs, const int* qsc, const int* tsc);
00074 bioseq *qseq;
00075 Matrix mtx;
00076 BlastParameter param;
00077 list<Alignseg> maxss;
00078 ltrie* fsa;
00079 };
00080
00081 #endif