1 #ifndef ALGO_BLAST_API___BLAST_RPS_OPTIONS__HPP
2 #define ALGO_BLAST_API___BLAST_RPS_OPTIONS__HPP
3 
4 /*  $Id: blast_rps_options.hpp 383627 2012-12-17 15:57:20Z boratyng $
5  * ===========================================================================
6  *
7  *                            PUBLIC DOMAIN NOTICE
8  *               National Center for Biotechnology Information
9  *
10  *  This software/database is a "United States Government Work" under the
11  *  terms of the United States Copyright Act.  It was written as part of
12  *  the author's official duties as a United States Government employee and
13  *  thus cannot be copyrighted.  This software/database is freely available
14  *  to the public for use. The National Library of Medicine and the U.S.
15  *  Government have not placed any restriction on its use or reproduction.
16  *
17  *  Although all reasonable efforts have been taken to ensure the accuracy
18  *  and reliability of the software and data, the NLM and the U.S.
19  *  Government do not and cannot warrant the performance or results that
20  *  may be obtained by using this software or data. The NLM and the U.S.
21  *  Government disclaim all warranties, express or implied, including
22  *  warranties of performance, merchantability or fitness for any particular
23  *  purpose.
24  *
25  *  Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors:  Tom Madden
30  *
31  */
32 
33 /// @file blast_rps_options.hpp
34 /// Declares the CBlastRPSOptionsHandle class.
35 
36 
37 #include <algo/blast/api/blast_prot_options.hpp>
38 
39 /** @addtogroup AlgoBlast
40  *
41  * @{
42  */
43 
44 BEGIN_NCBI_SCOPE
45 BEGIN_SCOPE(blast)
46 
47 /// Handle to the rpsblast options to the BLAST algorithm.
48 ///
49 /// Adapter class for rpsblast BLAST comparisons.
50 /// Exposes an interface to allow manipulation the options that are relevant to
51 /// this type of search.
52 
53 class NCBI_XBLAST_EXPORT CBlastRPSOptionsHandle : public CBlastOptionsHandle
54 {
55 public:
56 
57     /// Creates object with default options set
58     CBlastRPSOptionsHandle(EAPILocality locality = CBlastOptions::eLocal);
59 
60     /// Create Options Handle from Existing CBlastOptions Object
61     CBlastRPSOptionsHandle(CRef<CBlastOptions> opt);
62 
63     /******************* Lookup table options ***********************/
64     /// Returns WordThreshold
GetWordThreshold() const65     double GetWordThreshold() const { return m_Opts->GetWordThreshold(); }
66     /// Returns WordSize
GetWordSize() const67     int GetWordSize() const { return m_Opts->GetWordSize(); }
68 
69     /******************* Initial word options ***********************/
70 
71     /// Returns XDropoff
GetXDropoff() const72     double GetXDropoff() const { return m_Opts->GetXDropoff(); }
73     /// Sets XDropoff
74     /// @param x XDropoff [in]
SetXDropoff(double x)75     void SetXDropoff(double x) { m_Opts->SetXDropoff(x); }
76 
77     /******************* Query setup options ************************/
78     /// Is SEG filtering enabled?
GetSegFiltering() const79     bool GetSegFiltering() const { return m_Opts->GetSegFiltering(); }
80     /// Enable SEG filtering.
81     /// @param val enable SEG filtering [in]
SetSegFiltering(bool val)82     void SetSegFiltering(bool val) { m_Opts->SetSegFiltering(val); }
83 
84     /// Get window parameter for seg
GetSegFilteringWindow() const85     int GetSegFilteringWindow() const { return m_Opts->GetSegFilteringWindow(); }
86     /// Set window parameter for seg.  Acceptable value are > 0.
87     /// @param window seg filtering parameter window [in]
SetSegFilteringWindow(int window)88     void SetSegFilteringWindow(int window) { m_Opts->SetSegFilteringWindow(window); }
89 
90     /// Get locut parameter for seg
GetSegFilteringLocut() const91     double GetSegFilteringLocut() const { return m_Opts->GetSegFilteringLocut(); }
92     /// Set locut parameter for seg.  Acceptable values are greater than 0.
93     /// @param locut seg filtering parameter locut [in]
SetSegFilteringLocut(double locut)94     void SetSegFilteringLocut(double locut) { m_Opts->SetSegFilteringLocut(locut); }
95 
96     /// Get hicut parameter for seg
GetSegFilteringHicut() const97     double GetSegFilteringHicut() const { return m_Opts->GetSegFilteringHicut(); }
98     /// Set hicut parameter for seg.  Acceptable values are greater than Locut
99     /// @param hicut seg filtering parameter hicut [in]
SetSegFilteringHicut(double hicut)100     void SetSegFilteringHicut(double hicut) { m_Opts->SetSegFilteringHicut(hicut); }
101 
102     /// Get composition based statistics mode
103     /// @return True if composition based statistics mode is enabled, false
104     /// otherwise
GetCompositionBasedStats(void) const105     bool GetCompositionBasedStats(void) const
106     {return !(m_Opts->GetCompositionBasedStats() == eNoCompositionBasedStats);}
107 
108     /// Set composition based statistics mode
109     /// @param mode Composition based statistics mode
SetCompositionBasedStats(bool mode)110     void SetCompositionBasedStats(bool mode)
111     {m_Opts->SetCompositionBasedStats(mode ? eCompositionBasedStats
112                                       : eNoCompositionBasedStats);}
113 
114     /************************ Scoring options ************************/
115     /// Returns GapOpeningCost
GetGapOpeningCost() const116     int GetGapOpeningCost() const { return m_Opts->GetGapOpeningCost(); }
117     /// Returns GapExtensionCost
GetGapExtensionCost() const118     int GetGapExtensionCost() const { return m_Opts->GetGapExtensionCost(); }
119 
120 protected:
121     /// Set the program and service name for remote blast.
SetRemoteProgramAndService_Blast3()122     virtual void SetRemoteProgramAndService_Blast3()
123     {
124         m_Opts->SetRemoteProgramAndService_Blast3("blastp", "rpsblast");
125     }
126 
127     /// Overrides LookupTableDefaults for RPS-BLAST options
128     virtual void SetLookupTableDefaults();
129     /// Overrides QueryOptionDefaults for RPS-BLAST options
130     virtual void SetQueryOptionDefaults();
131     /// Overrides InitialWordOptionsDefaults for RPS-BLAST options
132     virtual void SetInitialWordOptionsDefaults();
133     /// Overrides GappedExtensionDefaults for RPS-BLAST options
134     virtual void SetGappedExtensionDefaults();
135     /// Overrides ScoringOptionsDefaults for RPS-BLAST options
136     virtual void SetScoringOptionsDefaults();
137     /// Overrides HitSavingOptionsDefaults for RPS-BLAST options
138     virtual void SetHitSavingOptionsDefaults();
139     /// Overrides EffectiveLengthsOptionsDefaults for RPS-BLAST options
140     virtual void SetEffectiveLengthsOptionsDefaults();
141     /// Overrides SubjectSequenceOptionsDefaults for RPS-BLAST options
142     virtual void SetSubjectSequenceOptionsDefaults();
143 
144 private:
145     /// Disallow copy constructor
146     CBlastRPSOptionsHandle(const CBlastRPSOptionsHandle& rhs);
147     /// Disallow assignment operator
148     CBlastRPSOptionsHandle& operator=(const CBlastRPSOptionsHandle& rhs);
149 };
150 
151 END_SCOPE(blast)
152 END_NCBI_SCOPE
153 
154 
155 /* @} */
156 
157 #endif  /* ALGO_BLAST_API___BLAST_RPS_OPTIONS__HPP */
158