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

Go to the SVN repository for this file.

1 /* $Id: tblastx_args.cpp 72378 2016-05-04 14:59:01Z camacho $
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 tblastx_args.cpp
31  * Implementation of the TBLASTX command line arguments
32  */
33 
34 #include <ncbi_pch.hpp>
39 
41 BEGIN_SCOPE(blast)
43 
45 {
47  static const string kProgram("tblastx");
48  arg.Reset(new CProgramDescriptionArgs(kProgram,
49  "Translated Query-Translated Subject BLAST"));
50  const bool kQueryIsProtein = false;
51  m_Args.push_back(arg);
52  m_ClientId = kProgram + " " + CBlastVersion().Print();
53 
54  static const char kDefaultTask[] = "tblastx";
55  SetTask(kDefaultTask);
56 
57  m_BlastDbArgs.Reset(new CBlastDatabaseArgs);
58  m_BlastDbArgs->SetDatabaseMaskingSupport(true);
59  arg.Reset(m_BlastDbArgs);
60  m_Args.push_back(arg);
61 
62  m_StdCmdLineArgs.Reset(new CStdCmdLineArgs);
63  arg.Reset(m_StdCmdLineArgs);
64  m_Args.push_back(arg);
65 
66  // N.B.: query is not protein because the options are applied on the
67  // translated query
68  arg.Reset(new CGenericSearchArgs( !kQueryIsProtein, false, false, true));
69  m_Args.push_back(arg);
70 
71  /*arg.Reset(new CFrameShiftArgs);
72  m_Args.push_back(arg);*/
73 
75  m_Args.push_back(arg);
76 
77  // N.B.: this is because the filtering is applied on the translated query
78  arg.Reset(new CFilteringArgs( !kQueryIsProtein ));
79  m_Args.push_back(arg);
80 
81  arg.Reset(new CMatrixNameArg);
82  m_Args.push_back(arg);
83 
84  arg.Reset(new CWordThresholdArg);
85  m_Args.push_back(arg);
86 
87  m_HspFilteringArgs.Reset(new CHspFilteringArgs);
88  arg.Reset(m_HspFilteringArgs);
89  m_Args.push_back(arg);
90 
91  arg.Reset(new CWindowSizeArg);
92  m_Args.push_back(arg);
93 
94  m_QueryOptsArgs.Reset(new CQueryOptionsArgs(kQueryIsProtein));
95  arg.Reset(m_QueryOptsArgs);
96  m_Args.push_back(arg);
97 
99  m_Args.push_back(arg);
100 
102  m_Args.push_back(arg);
103 
104  m_FormattingArgs.Reset(new CFormattingArgs);
105  arg.Reset(m_FormattingArgs);
106  m_Args.push_back(arg);
107 
108  m_MTArgs.Reset(new CMTArgs);
109  arg.Reset(m_MTArgs);
110  m_Args.push_back(arg);
111 
112  m_RemoteArgs.Reset(new CRemoteArgs);
113  arg.Reset(m_RemoteArgs);
114  m_Args.push_back(arg);
115 
116  m_DebugArgs.Reset(new CDebugArgs);
117  arg.Reset(m_DebugArgs);
118  m_Args.push_back(arg);
119 }
120 
123  const CArgs& /*args*/)
124 {
125  return CRef<CBlastOptionsHandle>(new CTBlastxOptionsHandle(locality));
126 }
127 
128 int
130 {
131  bool is_remote = (m_RemoteArgs.NotEmpty() && m_RemoteArgs->ExecuteRemotely());
132  return blast::GetQueryBatchSize(eTblastx, m_IsUngapped, is_remote);
133 }
134 
135 END_SCOPE(blast)
137 
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.
@ eTblastx
Translated nucl-Translated nucl.
Definition: blast_types.hpp:62
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 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 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
@ eDatabase
Database genetic code.
Definition: blast_args.hpp:468
Argument class to retrieve options for filtering HSPs (e.g.
Argument class for collecting the largest intron size.
Definition: blast_args.hpp:441
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
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
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
Handle to the translated nucleotide-translated nucleotide options to the BLAST algorithm.
Handles command line arguments for blastx binary.
virtual CRef< CBlastOptionsHandle > x_CreateOptionsHandle(CBlastOptions::EAPILocality locality, const CArgs &args)
@inheritDoc
virtual int GetQueryBatchSize() const
@inheritDoc
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
virtual string Print(void) const
Print version information.
Definition: version.hpp:59
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
USING_SCOPE(objects)
Main argument class for TBLASTX application.
Declares the CTBlastxOptionsHandle class.
Modified on Tue May 28 05:51:43 2024 by modify_doxy.py rev. 669887