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

Go to the SVN repository for this file.

1 /* $Id: rpstblastn_args.cpp 91856 2020-12-15 13:04:04Z gouriano $
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: Jason Papadopoulos
27  *
28  */
29 
30 /** @file rpstblastn_args.cpp
31  * Implementation of the RPSTBLASTN command line arguments
32  */
33 
34 #include <ncbi_pch.hpp>
40 
42 BEGIN_SCOPE(blast)
44 
46 {
48  bool const kFilterByDefault = false;
49  static const string kProgram("rpstblastn");
50  arg.Reset(new CProgramDescriptionArgs(kProgram,
51  "Translated Reverse Position Specific BLAST"));
52  const bool kQueryIsProtein = false;
53  const bool kIsRpsBlast = true;
54  const bool kIsCBS2and3Supported = false;
55  m_Args.push_back(arg);
56  m_ClientId = kProgram + " " + CBlastVersion().Print();
57 
58  static const char kDefaultTask[] = "rpstblastn";
59  SetTask(kDefaultTask);
60 
61  m_BlastDbArgs.Reset(new CBlastDatabaseArgs(false, kIsRpsBlast));
62  arg.Reset(m_BlastDbArgs);
63  m_Args.push_back(arg);
64 
65  m_StdCmdLineArgs.Reset(new CStdCmdLineArgs);
66  arg.Reset(m_StdCmdLineArgs);
67  m_Args.push_back(arg);
68 
69  // N.B.: query is not protein because the options are applied on the
70  // translated query
71  arg.Reset(new CGenericSearchArgs( !kQueryIsProtein, kIsRpsBlast ));
72  m_Args.push_back(arg);
73 
75  m_Args.push_back(arg);
76 
77  // N.B.: query is not protein because the filtering is applied on the
78  // translated query
79  arg.Reset(new CFilteringArgs( !kQueryIsProtein, kFilterByDefault));
80  m_Args.push_back(arg);
81 
82  arg.Reset(new CWindowSizeArg);
83  m_Args.push_back(arg);
84 
85  arg.Reset(new CGappedArgs);
86  m_Args.push_back(arg);
87 
88  m_QueryOptsArgs.Reset(new CQueryOptionsArgs(kQueryIsProtein));
89  arg.Reset(m_QueryOptsArgs);
90  m_Args.push_back(arg);
91 
92  m_FormattingArgs.Reset(new CFormattingArgs);
93  arg.Reset(m_FormattingArgs);
94  m_Args.push_back(arg);
95 
96  m_MTArgs.Reset(new CRPSBlastMTArgs());
97  arg.Reset(m_MTArgs);
98  m_Args.push_back(arg);
99 
100  m_RemoteArgs.Reset(new CRemoteArgs);
101  arg.Reset(m_RemoteArgs);
102  m_Args.push_back(arg);
103 
104  m_DebugArgs.Reset(new CDebugArgs);
105  arg.Reset(m_DebugArgs);
106  m_Args.push_back(arg);
107 
108  arg.Reset(new CCompositionBasedStatsArgs(kIsCBS2and3Supported, kDfltArgCompBasedStatsRPS ));
109  m_Args.push_back(arg);
110 
111 }
112 
115  const CArgs& /*args*/)
116 {
118 }
119 
120 int
122 {
123  bool is_remote = (m_RemoteArgs.NotEmpty() && m_RemoteArgs->ExecuteRemotely());
125 }
126 
127 /// Get the input stream
130 {
132 }
133 /// Get the output stream
136 {
138 }
139 
140 /// Get the input stream
143 {
144  if ( !m_InputStream ) {
145  abort();
146  }
147  return *m_InputStream;
148 }
149 /// Get the output stream
152 {
153  return m_OutputStream;
154 }
155 
157 {
159 }
160 
162 {
163  if (m_InputStream) {
164  delete m_InputStream;
166  }
167 }
168 
169 int
171 {
172  bool is_remote = (m_RemoteArgs.NotEmpty() && m_RemoteArgs->ExecuteRemotely());
174 }
175 
178  const CArgs& /*args*/)
179 {
181  (new CRPSTBlastnOptionsHandle(locality));
182  return retval;
183 }
184 
185 END_SCOPE(blast)
187 
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.
@ eRPSTblastn
nucleotide-pssm (RPS blast with translated query)
Definition: blast_types.hpp:64
CArgs –.
Definition: ncbiargs.hpp:379
CRef< CRemoteArgs > m_RemoteArgs
remote vs. local execution options
virtual CNcbiIstream & GetInputStream()
Get the input stream.
bool m_IsUngapped
Is this application being run ungapped.
virtual CNcbiOstream & GetOutputStream()
Get the output stream.
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 for collecting gapped options.
Definition: blast_args.hpp:430
Argument class for general search BLAST algorithm options: evalue, gap penalties, query filter string...
Definition: blast_args.hpp:292
Argument class to collect the genetic code for all queries/subjects.
Definition: blast_args.hpp:463
@ eQuery
Query genetic code.
Definition: blast_args.hpp:467
Argument class to populate an application's name and description.
Definition: blast_args.hpp:178
Argument class to collect query options.
Definition: blast_args.hpp:775
Handles command line arguments for blastx binary.
virtual CRef< CBlastOptionsHandle > x_CreateOptionsHandle(CBlastOptions::EAPILocality locality, const CArgs &args)
@inheritDoc
virtual CNcbiIstream & GetInputStream()
Get the input stream.
virtual CNcbiOstream & GetOutputStream()
Get the output stream.
virtual int GetQueryBatchSize() const
@inheritDoc
virtual CNcbiOstream & GetOutputStream()
Get the output stream.
CNcbiStrstream m_OutputStream
CNcbiIstrstream * m_InputStream
virtual CNcbiIstream & GetInputStream()
Get the input stream.
virtual CRef< CBlastOptionsHandle > x_CreateOptionsHandle(CBlastOptions::EAPILocality locality, const CArgs &args)
@inheritDoc
CRPSTBlastnNodeArgs(const string &input)
Constructor.
virtual int GetQueryBatchSize() const
@inheritDoc
Handle to the options for translated nucleotide-RPS blast.
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
const string kDfltArgCompBasedStatsRPS
virtual string Print(void) const
Print version information.
Definition: version.hpp:59
#define NULL
Definition: ncbistd.hpp:225
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
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
static int input()
void abort()
Main argument class for RPSBLAST application.
USING_SCOPE(objects)
Main argument class for RPS TBLASTN application.
Declares the CRPSTBlastnOptionsHandle class.
Modified on Wed Apr 17 13:09:42 2024 by modify_doxy.py rev. 669887