FPGModel.h
Go to the documentation of this file.00001 #ifndef FPGMODEL_H
00002 #define FPGMODEL_H
00003
00004 #include "GModel.h"
00005
00022 class fpkey {
00023 public:
00024 fpkey(const string &q, const string &t, const int n) : qid(q), tid(t), fpnum(n) { }
00025 bool operator==(const fpkey &k) const { return qid==k.qid && tid==k.tid && fpnum==k.fpnum; }
00026 bool operator<(const fpkey &k) const {
00027 if (qid < k.qid) return true;
00028 if (qid > k.qid) return false;
00029 if (tid < k.tid) return true;
00030 if (tid > k.tid) return false;
00031 if (fpnum < k.fpnum) return true; return false;
00032 }
00033 bool operator>(const fpkey &k) const { return !(*this < k); }
00034 string qid, tid;
00035 int fpnum;
00036 friend ostream& operator<<(ostream &ous, const fpkey &k) {
00037 ous << k.qid << "\t" << k.tid << "\t" << k.fpnum;
00038 return ous; }
00039 };
00040
00041 class FPGModel : public GModel<fpkey> {
00042 public:
00043
00044
00045
00046 FPGModel(const string &qid, const string &tid, int fpnum,
00047 int ql, int tl, int qb, int qe, int tb, int te,
00048 int nx, double ss, double ai, double qc, double so)
00049 : GModel<fpkey>(fpkey(qid,tid,fpnum)),
00050 qlen(ql), tlen(tl), qbegin(qb), qend(qe), tbegin(tb), tend(te),
00051 numexon(nx), sumscore(ss), avgiden(ai), qcov(qc), sumoverlap(so)
00052 { }
00053 friend ostream& operator<<(ostream& ous, const FPGModel &mm);
00059 bool cover(const FPGModel &mm) const;
00063 bool similar(const FPGModel &mm, float fr=0.15) const;
00064 double getSumscore() const { return sumscore; }
00065 double getNormSumscore() const { return sumscore*(1-sumoverlap); }
00066 double getAvgiden() const { return avgiden; }
00067
00068 private:
00069 int qlen, tlen, qbegin,qend,tbegin,tend,numexon;
00070 double sumscore,avgiden,qcov,sumoverlap;
00071 };
00072
00073 #endif