00001 #ifndef ALGO_ALIGN_UTIL___SCORE_BUILDER__HPP
00002 #define ALGO_ALIGN_UTIL___SCORE_BUILDER__HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <corelib/ncbiobj.hpp>
00036 #include <algo/blast/api/blast_types.hpp>
00037
00038 struct BlastScoreBlk;
00039
00040 BEGIN_NCBI_SCOPE
00041
00042 BEGIN_SCOPE(blast)
00043 class CBlastOptionsHandle;
00044 END_SCOPE(blast)
00045
00046 BEGIN_SCOPE(objects)
00047
00048 class CScope;
00049 class CSeq_align;
00050
00051 class CScoreBuilder
00052 {
00053 public:
00054
00055 CScoreBuilder();
00056 CScoreBuilder(enum blast::EProgram program_type);
00057 CScoreBuilder(blast::CBlastOptionsHandle& options);
00058 ~CScoreBuilder();
00059
00060 enum EScoreType {
00061
00062 eScore_Blast,
00063
00064
00065 eScore_Blast_BitScore,
00066
00067
00068 eScore_Blast_EValue,
00069
00070
00071 eScore_IdentityCount,
00072
00073
00074 eScore_MismatchCount,
00075
00076
00077
00078 eScore_PercentIdentity,
00079
00080
00081 eScore_PercentCoverage
00082 };
00083
00084
00085
00086
00087 void AddScore(CScope& scope, CSeq_align& align,
00088 EScoreType score);
00089 void AddScore(CScope& scope, list< CRef<CSeq_align> >& aligns,
00090 EScoreType score);
00091
00092
00093
00094
00095
00096
00097
00098 double GetPercentIdentity(CScope& scope, const CSeq_align& align);
00099
00100
00101 double GetPercentCoverage(CScope& scope, const CSeq_align& align);
00102
00103 int GetIdentityCount (CScope& scope, const CSeq_align& align);
00104 int GetMismatchCount (CScope& scope, const CSeq_align& align);
00105 void GetMismatchCount (CScope& scope, const CSeq_align& align,
00106 int& identities, int& mismatches);
00107 int GetBlastScore (CScope& scope, const CSeq_align& align);
00108 double GetBlastBitScore(CScope& scope, const CSeq_align& align);
00109 double GetBlastEValue (CScope& scope, const CSeq_align& align);
00110 int GetGapCount (const CSeq_align& align);
00111 TSeqPos GetAlignLength(const CSeq_align& align);
00112
00113
00114
00115
00116
00117
00118 void SetEffectiveSearchSpace(Int8 searchsp)
00119 {
00120 m_EffectiveSearchSpace = searchsp;
00121 }
00122
00123
00124
00125 private:
00126
00127 struct BlastScoreBlk *m_ScoreBlk;
00128 enum blast::EProgram m_BlastType;
00129 int m_GapOpen;
00130 int m_GapExtend;
00131 Int8 m_EffectiveSearchSpace;
00132
00133 void x_Initialize(blast::CBlastOptionsHandle& options);
00134 };
00135
00136
00137
00138 END_SCOPE(objects)
00139 END_NCBI_SCOPE
00140
00141 #endif // ALGO_ALIGN_UTIL___SCORE_BUILDER__HPP
00142
00143