1 /*  $Id: tblastx_args.cpp 500404 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>
35 #include <algo/blast/blastinput/tblastx_args.hpp>
36 #include <algo/blast/api/tblastx_options.hpp>
37 #include <algo/blast/blastinput/blast_input_aux.hpp>
38 #include <algo/blast/api/version.hpp>
39 
40 BEGIN_NCBI_SCOPE
41 BEGIN_SCOPE(blast)
42 USING_SCOPE(objects);
43 
CTblastxAppArgs()44 CTblastxAppArgs::CTblastxAppArgs()
45 {
46     CRef<IBlastCmdLineArgs> arg;
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 
74     arg.Reset(new CLargestIntronSizeArgs);
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 
98     arg.Reset(new CGeneticCodeArgs(CGeneticCodeArgs::eQuery));
99     m_Args.push_back(arg);
100 
101     arg.Reset(new CGeneticCodeArgs(CGeneticCodeArgs::eDatabase));
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 
121 CRef<CBlastOptionsHandle>
x_CreateOptionsHandle(CBlastOptions::EAPILocality locality,const CArgs &)122 CTblastxAppArgs::x_CreateOptionsHandle(CBlastOptions::EAPILocality locality,
123                                        const CArgs& /*args*/)
124 {
125     return CRef<CBlastOptionsHandle>(new CTBlastxOptionsHandle(locality));
126 }
127 
128 int
GetQueryBatchSize() const129 CTblastxAppArgs::GetQueryBatchSize() const
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)
136 END_NCBI_SCOPE
137 
138