NCBI C++ ToolKit
psiblast_args.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: psiblast_args.cpp 83851 2018-09-25 13:30:42Z fongah2 $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Christiam Camacho
27  *
28  */
29 
30 /** @file psiblast_args.cpp
31  * Implementation of the PSI-BLAST command line arguments
32  */
33 #include <ncbi_pch.hpp>
39 
41 BEGIN_SCOPE(blast)
43 
45 {
46  bool const kQueryIsProtein = true;
47  bool const kFilterByDefault = false;
48  static const string kProgram("psiblast");
50  arg.Reset(new CProgramDescriptionArgs(kProgram,
51  "Position-Specific Iterated BLAST"));
52  m_Args.push_back(arg);
53  m_ClientId = kProgram + " " + CBlastVersion().Print();
54 
55  static const char kDefaultTask[] = "psiblast";
56  SetTask(kDefaultTask);
57 
58  m_BlastDbArgs.Reset(new CBlastDatabaseArgs);
59  m_BlastDbArgs->SetIPGFilteringSupport(true);
60  arg.Reset(m_BlastDbArgs);
61  m_Args.push_back(arg);
62 
63  m_StdCmdLineArgs.Reset(new CStdCmdLineArgs);
64  arg.Reset(m_StdCmdLineArgs);
65  m_Args.push_back(arg);
66 
67  arg.Reset(new CGenericSearchArgs(kQueryIsProtein));
68  m_Args.push_back(arg);
69 
70  arg.Reset(new CFilteringArgs(kQueryIsProtein, kFilterByDefault));
71  m_Args.push_back(arg);
72 
73  arg.Reset(new CMatrixNameArg);
74  m_Args.push_back(arg);
75 
76  arg.Reset(new CWordThresholdArg);
77  m_Args.push_back(arg);
78 
79  m_HspFilteringArgs.Reset(new CHspFilteringArgs);
80  arg.Reset(m_HspFilteringArgs);
81  m_Args.push_back(arg);
82 
83  arg.Reset(new CWindowSizeArg);
84  m_Args.push_back(arg);
85 
86  m_QueryOptsArgs.Reset(new CQueryOptionsArgs(kQueryIsProtein));
87  arg.Reset(m_QueryOptsArgs);
88  m_Args.push_back(arg);
89 
90  m_FormattingArgs.Reset(new CFormattingArgs);
91  arg.Reset(m_FormattingArgs);
92  m_Args.push_back(arg);
93 
94  m_MTArgs.Reset(new CMTArgs);
95  arg.Reset(m_MTArgs);
96  m_Args.push_back(arg);
97 
98  m_RemoteArgs.Reset(new CRemoteArgs);
99  arg.Reset(m_RemoteArgs);
100  m_Args.push_back(arg);
101 
103  m_Args.push_back(arg);
104 
105  arg.Reset(new CGapTriggerArgs(kQueryIsProtein));
106  m_Args.push_back(arg);
107 
108  m_PsiBlastArgs.Reset(new CPsiBlastArgs(CPsiBlastArgs::eProteinDb));
109  arg.Reset(m_PsiBlastArgs);
110  m_Args.push_back(arg);
111 
112  arg.Reset(new CPssmEngineArgs);
113  m_Args.push_back(arg);
114 
115  arg.Reset(new CPhiBlastArgs);
116  m_Args.push_back(arg);
117 
118  m_DebugArgs.Reset(new CDebugArgs);
119  arg.Reset(m_DebugArgs);
120  m_Args.push_back(arg);
121 }
122 
125  const CArgs& args)
126 {
127  if (args.Exist(kArgPHIPatternFile) && args[kArgPHIPatternFile])
129  else
131 }
132 
133 size_t
135 {
137 }
138 
141 {
142  return m_PsiBlastArgs->GetInputPssm();
143 }
144 
145 void
147 {
149 }
150 
151 void
153 {
155 }
156 
157 int
159 {
160  bool is_remote = (m_RemoteArgs.NotEmpty() && m_RemoteArgs->ExecuteRemotely());
161  return blast::GetQueryBatchSize(ePSIBlast, m_IsUngapped, is_remote);
162 }
163 
164 bool
166 {
168 }
169 
172 {
174 }
175 
176 bool
178 {
180 }
181 
184 {
186 }
187 
188 bool
190 {
192 }
193 
194 END_SCOPE(blast)
196 
Declares singleton objects to store the version and reference for the BLAST engine.
Auxiliary classes/functions for BLAST input library.
int GetQueryBatchSize(EProgram program, bool is_ungapped=false, bool remote=false, bool use_default=true, string task="", bool mt_mode=false)
Retrieve the appropriate batch size for the specified task.
@ ePSIBlast
PSI Blast.
Definition: blast_types.hpp:67
CArgs –.
Definition: ncbiargs.hpp:379
CRef< CRemoteArgs > m_RemoteArgs
remote vs. local execution options
bool m_IsUngapped
Is this application being run ungapped.
Argument class to collect database/subject arguments.
Definition: blast_args.hpp:889
EAPILocality
Enumerates the possible contexts in which objects of this type can be used.
Keeps track of the version of the BLAST engine in the NCBI C++ toolkit.
Definition: version.hpp:53
Argument class for collecting composition based statistics options.
Definition: blast_args.hpp:397
Argument class to collect debugging options.
Argument class for collecting filtering options.
Definition: blast_args.hpp:333
Argument class to collect formatting options, use this to create a CBlastFormat object.
Argument class to retrieve the gap trigger option.
Definition: blast_args.hpp:491
Argument class for general search BLAST algorithm options: evalue, gap penalties, query filter string...
Definition: blast_args.hpp:292
Argument class to retrieve options for filtering HSPs (e.g.
Argument class to collect multi-threaded arguments.
Argument class to retrieve and set the scoring matrix name BLAST algorithm option.
Definition: blast_args.hpp:278
Handle to the protein PHI BLAST options.
Handle to the protein-protein options to the BLAST algorithm.
Argument class to collect options specific to PHI-BLAST.
Definition: blast_args.hpp:659
Argument class to populate an application's name and description.
Definition: blast_args.hpp:178
Handle command line arguments for psiblast binary Programs supported: psiblast, phi-blastn,...
CNcbiOstream * GetCheckpointStream()
Retrieve the stream to write the checkpoint file.
CRef< CPsiBlastArgs > m_PsiBlastArgs
PSI-BLAST specific argument class.
virtual CRef< CBlastOptionsHandle > x_CreateOptionsHandle(CBlastOptions::EAPILocality locality, const CArgs &args)
Create the options handle based on the command line arguments.
bool GetSaveLastPssm() const
Should the PSSM after the last database search be saved.
size_t GetNumberOfIterations() const
Get the number of iterations to perform.
CRef< objects::CPssmWithParameters > GetInputPssm() const
Get the PSSM specified as input from the command line.
virtual int GetQueryBatchSize() const
Get the query batch size.
bool SaveAsciiPssm() const
Should a PSSM be saved as ASCII in a file?
CNcbiOstream * GetAsciiPssmStream()
Retrieve the stream to write the ASCII PSSM.
void SetNumberOfIterations(unsigned int num_iters)
Set number of iterations from the saved search strategy.
bool SaveCheckpoint() const
Should a PSSM be saved in a checkpoint file?
void SetInputPssm(CRef< objects::CPssmWithParameters > pssm)
Set the PSSM from the saved search strategy.
Argument class to collect options specific to PSI-BLAST.
Definition: blast_args.hpp:547
size_t GetNumberOfIterations() const
Retrieve the number of iterations to perform.
Definition: blast_args.hpp:579
bool RequiresAsciiPssmOutput() const
Returns true if ASCII PSSM is required to be printed.
Definition: blast_args.hpp:597
CNcbiOstream * GetCheckPointOutputStream()
Get the checkpoint file output stream.
Definition: blast_args.hpp:593
@ eProteinDb
Traditional, iterated PSI-BLAST.
Definition: blast_args.hpp:551
void SetNumberOfIterations(unsigned int num_iters)
Retrieve the number of iterations to perform.
Definition: blast_args.hpp:584
CNcbiOstream * GetAsciiMatrixOutputStream()
Get the ASCII matrix output stream.
Definition: blast_args.hpp:602
bool RequiresCheckPointOutput() const
Returns true if checkpoint PSSM is required to be printed.
Definition: blast_args.hpp:588
bool GetSaveLastPssm(void) const
Should the PSSM after the last database search be saved.
Definition: blast_args.hpp:617
CRef< objects::CPssmWithParameters > GetInputPssm() const
Get the PSSM read from checkpoint file.
Definition: blast_args.hpp:607
void SetInputPssm(CRef< objects::CPssmWithParameters > pssm)
Set the PSSM read from saved search strategy.
Definition: blast_args.hpp:612
Argument class to collect PSSM engine options.
Definition: blast_args.hpp:511
Argument class to collect query options.
Definition: blast_args.hpp:775
CRef –.
Definition: ncbiobj.hpp:618
Argument class to collect remote vs. local execution.
bool ExecuteRemotely() const
Return whether the search should be executed remotely or not.
Argument class to retrieve input and output streams for a command line program.
Definition: blast_args.hpp:110
Argument class to retrieve and set the window size BLAST algorithm option.
Definition: blast_args.hpp:223
Argument class to retrieve and set the word threshold BLAST algorithm option.
Definition: blast_args.hpp:251
const string kArgPHIPatternFile
Argument to specify a PHI-BLAST pattern file.
virtual string Print(void) const
Print version information.
Definition: version.hpp:59
bool Exist(const string &name) const
Check existence of argument description.
Definition: ncbiargs.cpp:1813
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
Declares the CPHIBlastProtOptionsHandle class.
USING_SCOPE(objects)
Main argument class for PSI-BLAST application.
Declares the CPSIBlastOptionsHandle class.
Modified on Wed Feb 21 09:57:02 2024 by modify_doxy.py rev. 669887