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

Go to the SVN repository for this file.

1 /* $Id: tblastn_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 tblastn_args.cpp
31  * Implementation of the TBLASTN command line arguments
32  */
33 
34 #include <ncbi_pch.hpp>
40 
44 
46 {
48  static const string kProgram("tblastn");
49  arg.Reset(new CProgramDescriptionArgs(kProgram,
50  "Protein Query-Translated Subject BLAST"));
51  const bool kQueryIsProtein = true;
52  m_Args.push_back(arg);
53  m_ClientId = kProgram + " " + CBlastVersion().Print();
54 
55  static const char kDefaultTask[] = "tblastn";
56  SetTask(kDefaultTask);
57  set<string> tasks;
58  tasks.insert(kDefaultTask);
59  tasks.insert("tblastn-fast");
60  arg.Reset(new CTaskCmdLineArgs(tasks, kDefaultTask));
61  m_Args.push_back(arg);
62 
63  m_BlastDbArgs.Reset(new CBlastDatabaseArgs);
64  m_BlastDbArgs->SetDatabaseMaskingSupport(true);
65  arg.Reset(m_BlastDbArgs);
66  m_Args.push_back(arg);
67 
68  m_StdCmdLineArgs.Reset(new CStdCmdLineArgs);
69  arg.Reset(m_StdCmdLineArgs);
70  m_Args.push_back(arg);
71 
72  arg.Reset(new CGenericSearchArgs(kQueryIsProtein));
73  m_Args.push_back(arg);
74 
76  m_Args.push_back(arg);
77 
78  //Disable until OOF is supported in align manager
79  //SB-1043
80  //arg.Reset(new CFrameShiftArgs);
81  //m_Args.push_back(arg);
82 
83  arg.Reset(new CGappedArgs);
84  m_Args.push_back(arg);
85 
87  m_Args.push_back(arg);
88 
89  // N.B.: this is because the filtering is applied on the translated query
90  arg.Reset(new CFilteringArgs(kQueryIsProtein));
91  m_Args.push_back(arg);
92 
93  arg.Reset(new CMatrixNameArg);
94  m_Args.push_back(arg);
95 
96  arg.Reset(new CWordThresholdArg);
97  m_Args.push_back(arg);
98 
99  m_HspFilteringArgs.Reset(new CHspFilteringArgs);
100  arg.Reset(m_HspFilteringArgs);
101  m_Args.push_back(arg);
102 
103  arg.Reset(new CWindowSizeArg);
104  m_Args.push_back(arg);
105 
106  m_QueryOptsArgs.Reset(new CQueryOptionsArgs(kQueryIsProtein));
107  arg.Reset(m_QueryOptsArgs);
108  m_Args.push_back(arg);
109 
110  m_FormattingArgs.Reset(new CFormattingArgs);
111  arg.Reset(m_FormattingArgs);
112  m_Args.push_back(arg);
113 
114  m_MTArgs.Reset(new CMTArgs);
115  arg.Reset(m_MTArgs);
116  m_Args.push_back(arg);
117 
118  m_RemoteArgs.Reset(new CRemoteArgs);
119  arg.Reset(m_RemoteArgs);
120  m_Args.push_back(arg);
121 
123  m_Args.push_back(arg);
124 
125  m_PsiBlastArgs.Reset(new CPsiBlastArgs(CPsiBlastArgs::eNucleotideDb));
126  arg.Reset(m_PsiBlastArgs);
127  m_Args.push_back(arg);
128 
129  m_DebugArgs.Reset(new CDebugArgs);
130  arg.Reset(m_DebugArgs);
131  m_Args.push_back(arg);
132 }
133 
136  const CArgs& args)
137 {
138  _ASSERT(args.Exist(kTask));
139  _ASSERT(args[kTask].HasValue());
142  rv->SetPSITblastnDefaults();
143  if (args[kTask].AsString() == "blastx-fast") {
144  rv->SetWordSize(6);
146  rv->SetWordThreshold(21.0);
147  }
148  return CRef<CBlastOptionsHandle>(rv);
149  }
150  else {
151  return x_CreateOptionsHandleWithTask(locality, args[kTask].AsString());
152  }
153 }
154 
157 {
158  return m_PsiBlastArgs->GetInputPssm();
159 }
160 
161 void
163 {
165 }
166 
167 int
169 {
170  bool is_remote = (m_RemoteArgs.NotEmpty() && m_RemoteArgs->ExecuteRemotely());
171  return blast::GetQueryBatchSize(eTblastn, m_IsUngapped, is_remote);
172 }
173 
176 
Argument class to collect options specific to PSI-BLAST.
Definition: blast_args.hpp:512
Argument class for collecting gapped options.
Definition: blast_args.hpp:395
Argument class to collect multi-threaded arguments.
PSI-Tblastn, non-iterated.
Definition: blast_args.hpp:518
Argument class to retrieve options for filtering HSPs (e.g.
void SetInputPssm(CRef< objects::CPssmWithParameters > pssm)
Set the PSSM read from saved search strategy.
Definition: blast_args.hpp:578
Main argument class for TBLASTN application.
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:73
CRef< CBlastOptionsHandle > x_CreateOptionsHandleWithTask(CBlastOptions::EAPILocality locality, const string &task)
Creates the BLAST options handle based on the task argument.
EAPILocality
Enumerates the possible contexts in which objects of this type can be used.
void SetInputPssm(CRef< objects::CPssmWithParameters > pssm)
Set the PSSM from the saved search strategy.
void SetPSITblastnDefaults()
Sets default options for psi tblastn search.
Database genetic code.
Definition: blast_args.hpp:434
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
CRef< objects::CPssmWithParameters > GetInputPssm() const
Get the PSSM read from checkpoint file.
Definition: blast_args.hpp:573
Argument class to collect debugging options.
Declares the CTBlastnOptionsHandle class.
Argument class to collect formatting options, use this to create a CBlastFormat object.
Definition: blast_args.hpp:934
Argument class to collect database/subject arguments.
Definition: blast_args.hpp:802
bool ExecuteRemotely() const
Return whether the search should be executed remotely or not.
Keeps track of the version of the BLAST engine in the NCBI C++ toolkit.
Definition: version.hpp:53
CRef< CRemoteArgs > m_RemoteArgs
remote vs. local execution options
virtual int GetQueryBatchSize() const
Get the query batch size.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
Argument class to retrieve and set the window size BLAST algorithm option.
Definition: blast_args.hpp:195
Argument class to populate an application's name and description.
Definition: blast_args.hpp:150
Argument class to retrieve and set the word threshold BLAST algorithm option.
Definition: blast_args.hpp:223
bool m_IsUngapped
Is this application being run ungapped.
Handles command line arguments for blastx binary.
USING_SCOPE(objects)
virtual CRef< CBlastOptionsHandle > x_CreateOptionsHandle(CBlastOptions::EAPILocality locality, const CArgs &args)
Create the options handle based on the command line arguments.
Handle to the protein-protein options to the BLAST algorithm.
Argument class for collecting the largest intron size.
Definition: blast_args.hpp:406
CRef< objects::CPssmWithParameters > GetInputPssm() const
Get the PSSM.
Argument class for collecting composition based statistics options.
Definition: blast_args.hpp:362
Argument class for general search BLAST algorithm options: evalue, gap penalties, query filter string...
Definition: blast_args.hpp:264
Argument class to retrieve and set the scoring matrix name BLAST algorithm option.
Definition: blast_args.hpp:250
Argument class for collecting filtering options.
Definition: blast_args.hpp:298
Declares the CPSIBlastOptionsHandle class.
void SetLookupTableType(ELookupTableType type)
bool Exist(const string &name) const
Check existence of argument description.
Definition: ncbiargs.cpp:1746
CRef –.
Definition: ncbiobj.hpp:616
Argument class to collect remote vs. local execution.
CArgs –.
Definition: ncbiargs.hpp:356
void SetWordSize(int ws)
Sets WordSize.
int GetQueryBatchSize(EProgram program, bool is_ungapped=false, bool remote=false, bool use_default=true)
Retrieve the appropriate batch size for the specified task.
Protein-Translated nucl.
Definition: blast_types.hpp:61
Auxiliary classes/functions for BLAST input library.
compressed alphabet (blastp) lookup table
#define _ASSERT
void SetWordThreshold(double wt)
Sets WordThreshold.
virtual string Print(void) const
Print version information.
Definition: version.hpp:59
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:70
Argument class to collect the genetic code for all queries/subjects.
Definition: blast_args.hpp:428
const string kTask
Task to perform.
Argument class to specify the supported tasks a given program.
Definition: blast_args.hpp:170
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:709
Argument class to collect query options.
Definition: blast_args.hpp:691
CRef< CPsiBlastArgs > m_PsiBlastArgs
PSI-BLAST specific argument class (for psi-tblastn)
const string kArgPSIInputChkPntFile
Argument to specify a 'checkpoint' file to recover the PSSM from.
Argument class to retrieve input and output streams for a command line program.
Definition: blast_args.hpp:109
CBlastOptions & SetOptions()
Returns a reference to the internal options class which this object is a handle for.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:756
Modified on Sun Aug 28 17:59:01 2016 by modify_doxy.py rev. 506947