📄 blast_options.hpp
字号:
{ x_SetOneParam(name, & value); } void x_SetOneParam(const char * name, const int * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetInteger(*x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, const char ** x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetString().assign((x && (*x)) ? (*x) : ""); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, const bool * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetBoolean(*x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, CRef<objects::CBlast4_cutoff> * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetCutoff(**x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, const double * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetReal(*x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, const Int8 * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetBig_integer(*x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_SetOneParam(const char * name, objects::EBlast4_strand_type * x) { CRef<objects::CBlast4_value> v(new objects::CBlast4_value); v->SetStrand_type(*x); CRef<objects::CBlast4_parameter> p(new objects::CBlast4_parameter); p->SetName(name); p->SetValue(*v); m_ReqOpts->Set().push_back(p); } void x_Throwx(const string& msg) const { cout << "thrown: " << msg << endl; NCBI_THROW(CBlastException, eInternal, msg); }};/// Encapsulates all blast input parametersclass NCBI_XBLAST_EXPORT CBlastOptions : public CObject{public: enum EAPILocality { eLocal, eRemote, eBoth }; CBlastOptions(EAPILocality locality = eLocal); ~CBlastOptions(); EAPILocality GetLocality(void) { if (! m_Remote) { return eLocal; } if (! m_Local) { return eRemote; } return eBoth; } // void SetProgramService(const char * program, const char * service)// {// if (m_Remote) {// m_Remote->SetProgramService(program, service);// }// } /// Validate the options bool Validate() const { bool local_okay = m_Local ? (m_Local ->Validate()) : true; return local_okay; } /// Accessors/Mutators for individual options EProgram GetProgram() const { if (! m_Local) { x_Throwx("Error: GetProgram() not available."); } return m_Local->GetProgram(); } void SetProgram(EProgram p) { if (m_Local) { m_Local->SetProgram(p); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_Program, p); } } /******************* Lookup table options ***********************/ int GetWordThreshold() const { if (! m_Local) { x_Throwx("Error: GetWordThreshold() not available."); } return m_Local->GetWordThreshold(); } void SetWordThreshold(int w) { if (m_Local) { m_Local->SetWordThreshold(w); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_WordThreshold, w); } } int GetLookupTableType() const { if (! m_Local) { x_Throwx("Error: GetLookupTableType() not available."); } return m_Local->GetLookupTableType(); } void SetLookupTableType(int type) { if (m_Local) { m_Local->SetLookupTableType(type); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_LookupTableType, type); } } short GetWordSize() const { if (! m_Local) { x_Throwx("Error: GetWordSize() not available."); } return m_Local->GetWordSize(); } void SetWordSize(short ws) { if (m_Local) { m_Local->SetWordSize(ws); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_WordSize, ws); } } int GetAlphabetSize() const { if (! m_Local) { x_Throwx("Error: GetAlphabetSize() not available."); } return m_Local->GetAlphabetSize(); } void SetAlphabetSize(int s) { if (m_Local) { m_Local->SetAlphabetSize(s); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_AlphabetSize, s); } } unsigned char GetScanStep() const { if (! m_Local) { x_Throwx("Error: GetScanStep() not available."); } return m_Local->GetScanStep(); } void SetScanStep(unsigned char s) { if (m_Local) { m_Local->SetScanStep(s); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_ScanStep, s); } } /// Megablast only lookup table options unsigned char GetMBTemplateLength() const { if (! m_Local) { x_Throwx("Error: GetMBTemplateLength() not available."); } return m_Local->GetMBTemplateLength(); } void SetMBTemplateLength(unsigned char len) { if (m_Local) { m_Local->SetMBTemplateLength(len); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_MBTemplateLength, len); } } unsigned char GetMBTemplateType() const { if (! m_Local) { x_Throwx("Error: GetMBTemplateType() not available."); } return m_Local->GetMBTemplateType(); } void SetMBTemplateType(unsigned char type) { if (m_Local) { m_Local->SetMBTemplateType(type); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_MBTemplateType, type); } } int GetMBMaxPositions() const { if (! m_Local) { x_Throwx("Error: GetMBMaxPositions() not available."); } return m_Local->GetMBMaxPositions(); } void SetMBMaxPositions(int m) { if (m_Local) { m_Local->SetMBMaxPositions(m); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_MBMaxPositions, m); } } /******************* Query setup options ************************/ const char* GetFilterString() const { if (! m_Local) { x_Throwx("Error: GetFilterString() not available."); } return m_Local->GetFilterString(); } void SetFilterString(const char* f) { if (m_Local) { m_Local->SetFilterString(f); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_FilterString, f); } } objects::ENa_strand GetStrandOption() const { if (! m_Local) { x_Throwx("Error: GetStrandOption() not available."); } return m_Local->GetStrandOption(); } void SetStrandOption(objects::ENa_strand s) { if (m_Local) { m_Local->SetStrandOption(s); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_StrandOption, s); } } int GetQueryGeneticCode() const { if (! m_Local) { x_Throwx("Error: GetQueryGeneticCode() not available."); } return m_Local->GetQueryGeneticCode(); } void SetQueryGeneticCode(int gc) { if (m_Local) { m_Local->SetQueryGeneticCode(gc); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_QueryGeneticCode, gc); } } /******************* Initial word options ***********************/ int GetWindowSize() const { if (! m_Local) { x_Throwx("Error: GetWindowSize() not available."); } return m_Local->GetWindowSize(); } void SetWindowSize(int w) { if (m_Local) { m_Local->SetWindowSize(w); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_WindowSize, w); } } SeedContainerType GetSeedContainerType() const { if (! m_Local) { x_Throwx("Error: GetSeedContainerType() not available."); } return m_Local->GetSeedContainerType(); } void SetSeedContainerType(SeedContainerType type) { if (m_Local) { m_Local->SetSeedContainerType(type); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_SeedContainerType, type); } } SeedExtensionMethod GetSeedExtensionMethod() const { if (! m_Local) { x_Throwx("Error: GetSeedExtensionMethod() not available."); } return m_Local->GetSeedExtensionMethod(); } void SetSeedExtensionMethod(SeedExtensionMethod method) { if (m_Local) { m_Local->SetSeedExtensionMethod(method); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_SeedExtensionMethod, method); } } bool GetVariableWordSize() const { if (! m_Local) { x_Throwx("Error: GetVariableWordSize() not available."); } return m_Local->GetVariableWordSize(); } void SetVariableWordSize(bool val = true) { if (m_Local) { m_Local->SetVariableWordSize(val); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_VariableWordSize, val); } } bool GetUngappedExtension() const { if (! m_Local) { x_Throwx("Error: GetUngappedExtension() not available."); } return m_Local->GetUngappedExtension(); } void SetUngappedExtension(bool val = true) { if (m_Local) { m_Local->SetUngappedExtension(val); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_UngappedExtension, val); } } double GetXDropoff() const { if (! m_Local) { x_Throwx("Error: GetXDropoff() not available."); } return m_Local->GetXDropoff(); } void SetXDropoff(double x) { if (m_Local) { m_Local->SetXDropoff(x); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_XDropoff, x); } } /******************* Gapped extension options *******************/ double GetGapXDropoff() const { if (! m_Local) { x_Throwx("Error: GetGapXDropoff() not available."); } return m_Local->GetGapXDropoff(); } void SetGapXDropoff(double x) { if (m_Local) { m_Local->SetGapXDropoff(x); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_GapXDropoff, x); } } double GetGapXDropoffFinal() const { if (! m_Local) { x_Throwx("Error: GetGapXDropoffFinal() not available."); } return m_Local->GetGapXDropoffFinal(); } void SetGapXDropoffFinal(double x) { if (m_Local) { m_Local->SetGapXDropoffFinal(x); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_GapXDropoffFinal, x); } } double GetGapTrigger() const { if (! m_Local) { x_Throwx("Error: GetGapTrigger() not available."); } return m_Local->GetGapTrigger(); } void SetGapTrigger(double g) { if (m_Local) { m_Local->SetGapTrigger(g); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_GapTrigger, g); } } EBlastPrelimGapExt GetGapExtnAlgorithm() const { if (! m_Local) { x_Throwx("Error: GetGapExtnAlgorithm() not available."); } return m_Local->GetGapExtnAlgorithm(); } void SetGapExtnAlgorithm(EBlastPrelimGapExt a) { if (m_Local) { m_Local->SetGapExtnAlgorithm(a); } if (m_Remote) { m_Remote->SetValue(eBlastOpt_GapExtnAlgorithm, a); } } EBlastTbackExt GetGapTracebackAlgorithm() const { if (! m_Local) { x_Throwx("Error: GetGapTracebackAlgorithm() not available."); } return m_Local->GetGapTracebackAlgorithm(); } void SetGapTracebackAlgorithm(EBlastTbackExt a) { if (m_Local) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -