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