00001 #ifndef NGALIGN_BLAST_ALIGNER__HPP
00002 #define NGALIGN_BLAST_ALIGNER__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/ncbistd.hpp>
00036 #include <corelib/ncbiobj.hpp>
00037 #include <objects/seqloc/Na_strand.hpp>
00038
00039 #include <objects/seqloc/Seq_loc.hpp>
00040 #include <objects/seqloc/Seq_id.hpp>
00041 #include <objmgr/scope.hpp>
00042 #include <algo/blast/api/blast_types.hpp>
00043 #include <algo/blast/api/bl2seq.hpp>
00044 #include <algo/blast/api/blast_options_handle.hpp>
00045 #include <algo/blast/api/blast_nucl_options.hpp>
00046 #include <objects/seqalign/Seq_align.hpp>
00047 #include <objects/seqalign/Seq_align_set.hpp>
00048 #include <objects/seqalign/Dense_seg.hpp>
00049
00050 #include <algo/blast/api/blast_types.hpp>
00051 #include <algo/blast/api/blast_options_handle.hpp>
00052 #include <algo/blast/api/sseqloc.hpp>
00053
00054 #include <algo/align/ngalign/ngalign_interface.hpp>
00055
00056 BEGIN_NCBI_SCOPE
00057
00058 BEGIN_SCOPE(objects)
00059 class CScope;
00060 class CSeq_align;
00061 class CSeq_align_set;
00062 class CSeq_id;
00063 class CDense_seg;
00064 END_SCOPE(objects)
00065
00066 BEGIN_SCOPE(blast)
00067 class SSeqLoc;
00068 class CBlastOptionsHandle;
00069 END_SCOPE(blast)
00070
00071
00072
00073
00074 class CBlastArgs
00075 {
00076 public:
00077 static void s_CreateBlastArgDescriptions(CArgDescriptions& ArgDesc);
00078 static CRef<blast::CBlastOptionsHandle> s_ExtractBlastArgs(CArgs& Args);
00079 static CRef<blast::CBlastOptionsHandle> s_CreateBlastOptions(const string& Params);
00080 private:
00081 static void x_ParseOptionsString(const string& Params, vector<string>& Tokens);
00082 };
00083
00084
00085 class CBlastAligner : public IAlignmentFactory
00086 {
00087 public:
00088 CBlastAligner(blast::CBlastOptionsHandle& Options, int Threshold)
00089 : m_BlastOptions(&Options), m_Threshold(Threshold), m_Filter(0) { ; }
00090
00091 CBlastAligner(const string& Params, int Threshold)
00092 : m_BlastOptions(CBlastArgs::s_CreateBlastOptions(Params))
00093 , m_Threshold(Threshold), m_Filter(0) { ; }
00094
00095
00096 TAlignResultsRef GenerateAlignments(objects::CScope& Scope,
00097 ISequenceSet* QuerySet,
00098 ISequenceSet* SubjectSet,
00099 TAlignResultsRef AccumResults);
00100
00101 void SetSoftFiltering(int Filter) { m_Filter = Filter; }
00102
00103 typedef CRef<blast::CBlastOptionsHandle> TBlastOptionsRef;
00104 typedef CRef<CBlastAligner> TBlastAlignerRef;
00105
00106 static list<TBlastAlignerRef> CreateBlastAligners(list<TBlastOptionsRef>& Options, int Threshold);
00107 static list<TBlastAlignerRef> CreateBlastAligners(const list<string>& Params, int Threshold);
00108
00109 private:
00110
00111 CRef<blast::CBlastOptionsHandle> m_BlastOptions;
00112 int m_Threshold;
00113 int m_Filter;
00114 };
00115
00116
00117 END_NCBI_SCOPE
00118
00119 #endif
00120
00121