Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _REGULATORYMODULESSTRINGKERNEL_H___
00012 #define _REGULATORYMODULESSTRINGKERNEL_H___
00013
00014 #include <shogun/lib/common.h>
00015 #include <shogun/kernel/string/StringKernel.h>
00016 #include <shogun/features/DenseFeatures.h>
00017
00018 namespace shogun
00019 {
00025 class CRegulatoryModulesStringKernel: public CStringKernel<char>
00026 {
00027 public:
00029 CRegulatoryModulesStringKernel();
00030
00039 CRegulatoryModulesStringKernel(int32_t size, float64_t width, int32_t degree, int32_t shift, int32_t window);
00040
00053 CRegulatoryModulesStringKernel(CStringFeatures<char>* lstr, CStringFeatures<char>* rstr,
00054 CDenseFeatures<uint16_t>* lpos, CDenseFeatures<uint16_t>* rpos,
00055 float64_t width, int32_t degree, int32_t shift, int32_t window, int32_t size=10);
00056
00058 virtual ~CRegulatoryModulesStringKernel();
00059
00066 virtual bool init(CFeatures* l, CFeatures* r);
00067
00072 virtual EKernelType get_kernel_type() { return K_REGULATORYMODULES; }
00073
00078 virtual const char* get_name() const { return "RegulatoryModulesStringKernel"; }
00079
00085 void set_motif_positions(
00086 CDenseFeatures<uint16_t>* positions_lhs, CDenseFeatures<uint16_t>* positions_rhs);
00087
00088
00089 virtual void register_params();
00090
00091 protected:
00100 virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00101
00109 float64_t compute_wds(char* avec, char* bvec, int32_t len);
00110
00111
00113 void set_wd_weights();
00114
00115 protected:
00117 float64_t width;
00118
00120 int32_t degree;
00122 int32_t shift;
00123
00125 int32_t window;
00126
00128 CDenseFeatures<uint16_t>* motif_positions_lhs;
00129
00131 CDenseFeatures<uint16_t>* motif_positions_rhs;
00132
00134 int32_t alen;
00136 int32_t blen;
00137
00139 float64_t* position_weights;
00140
00142 float64_t* weights;
00143 };
00144 }
00145 #endif