1 /* ===========================================================================
2  *
3  *                            PUBLIC DOMAIN NOTICE
4  *               National Center for Biotechnology Information
5  *
6  *  This software/database is a "United States Government Work" under the
7  *  terms of the United States Copyright Act.  It was written as part of
8  *  the author's official duties as a United States Government employee and
9  *  thus cannot be copyrighted.  This software/database is freely available
10  *  to the public for use. The National Library of Medicine and the U.S.
11  *  Government have not placed any restriction on its use or reproduction.
12  *
13  *  Although all reasonable efforts have been taken to ensure the accuracy
14  *  and reliability of the software and data, the NLM and the U.S.
15  *  Government do not and cannot warrant the performance or results that
16  *  may be obtained by using this software or data. The NLM and the U.S.
17  *  Government disclaim all warranties, express or implied, including
18  *  warranties of performance, merchantability or fitness for any particular
19  *  purpose.
20  *
21  *  Please cite the author in any work or product based on this material.
22  *
23  * ===========================================================================
24  *
25  * Project:
26  *  sratools command line tool
27  *
28  * Purpose:
29  *  provide tool command info
30  *
31  */
32 
33 #include <string>
34 #include <map>
35 #include <set>
36 #include <vector>
37 #include <iostream>
38 
39 #include <cstdlib>
40 
41 #include <unistd.h>
42 #include <sys/stat.h>
43 #include <sysexits.h>
44 
45 #include "globals.hpp"
46 #include "which.hpp"
47 #include "debug.hpp"
48 #include "tool-args.hpp"
49 #include "constants.hpp"
50 
51 namespace sratools {
52 
53 using namespace constants;
54 
infoFor(int toolID)55 ArgsInfo infoFor(int toolID)
56 {
57     switch (toolID) {
58         case tool_name::SRAPATH:
59             return {
60                 {
61                     { "-f", "--function" },
62                     { "-t", "--timeout" },
63                     { "-a", "--protocol" },
64                     { "-e", "--vers" },
65                     { "-u", "--url" },
66                     { "-p", "--param" },
67                     { "-r", "--raw" },
68                     { "-j", "--json" },
69                     { "-d", "--project" },
70                     { "-c", "--cache" },
71                     { "-P", "--path" },
72                     { "-V", "--version" },
73                     { "-L", "--log-level" },
74                     { "-v", "--verbose" },
75                     { "-+", "--debug" },
76                     { "-h", "--help" },
77                     { "-?", "--help" },
78                 },
79                 {
80                     { "--function", "TRUE" },
81                     { "--location", "TRUE" },
82                     { "--timeout", "TRUE" },
83                     { "--protocol", "TRUE" },
84                     { "--vers", "TRUE" },
85                     { "--url", "TRUE" },
86                     { "--param", "TRUE" },
87                     { "--log-level", "TRUE" },
88                     { "--debug", "TRUE" },
89                 }
90             };
91         case tool_name::FASTERQ_DUMP:
92             return {
93                 {
94                     { "-+", "--debug" },
95                     { "-3", "--split-3" },
96                     { "-?", "--help" },
97                     { "-B", "--bases" },
98                     { "-L", "--log-level" },
99                     { "-M", "--min-read-len" },
100                     { "-N", "--rowid-as-name" },
101                     { "-O", "--outdir" },
102                     { "-P", "--print-read-nr" },
103                     { "-S", "--split-files" },
104                     { "-V", "--version" },
105                     { "-Z", "--stdout" },
106                     { "-b", "--bufsize" },
107                     { "-c", "--curcache" },
108                     { "-e", "--threads" },
109                     { "-f", "--force" },
110                     { "-h", "--help" },
111                     { "-m", "--mem" },
112                     { "-o", "--outfile" },
113                     { "-p", "--progress" },
114                     { "-s", "--split-spot" },
115                     { "-t", "--temp" },
116                     { "-v", "--verbose" },
117                     { "-x", "--details" },
118                 },
119                 {
120                     { "--bufsize", "TRUE" },
121                     { "--curcache", "TRUE" },
122                     { "--debug", "TRUE" },
123                     { "--log-level", "TRUE" },
124                     { "--mem", "TRUE" },
125                     { "--min-read-len", "TRUE" },
126                     { "--outdir", "TRUE" },
127                     { "--outfile", "TRUE" },
128                     { "--temp", "TRUE" },
129                     { "--threads", "TRUE" },
130                 }
131             };
132         case tool_name::SAM_DUMP:
133             return {
134                 {
135                     { "-+", "--debug" },
136                     { "-1", "--primary" },
137                     { "-=", "--hide-identical" },
138                     { "-?", "--help" },
139                     { "-L", "--log-level" },
140                     { "-Q", "--qual-quant" },
141                     { "-V", "--version" },
142                     { "-c", "--cigar-long" },
143                     { "-g", "--spot-group" },
144                     { "-h", "--help" },
145                     { "-n", "--no-header" },
146                     { "-p", "--prefix" },
147                     { "-r", "--header" },
148                     { "-s", "--seqid" },
149                     { "-u", "--unaligned" },
150                     { "-v", "--verbose" },
151                 },
152                 {
153                     { "--aligned-region", "TRUE" },
154                     { "--cursor-cache", "TRUE" },
155                     { "--debug", "TRUE" },
156                     { "--header-comment", "TRUE" },
157                     { "--header-file", "TRUE" },
158                     { "--log-level", "TRUE" },
159                     { "--matepair-distance", "TRUE" },
160                     { "--min-mapq", "TRUE" },
161                     { "--output-buffer-size", "TRUE" },
162                     { "--output-file", "TRUE" },
163                     { "--prefix", "TRUE" },
164                     { "--qual-quant", "TRUE" },
165                     { "--rna-splice-level", "TRUE" },
166                     { "--rna-splice-log", "TRUE" },
167                 }
168             };
169         case tool_name::PREFETCH:
170             return {
171                 {
172                     { "-+", "--debug" },
173                     { "-?", "--help" },
174                     { "-L", "--log-level" },
175                     { "-N", "--min-size" },
176                     { "-O", "--output-directory" },
177                     { "-R", "--rows" },
178                     { "-T", "--type" },
179                     { "-V", "--version" },
180                     { "-X", "--max-size" },
181                     { "-a", "--ascp-path" },
182                     { "-c", "--check-all" },
183                     { "-f", "--force" },
184                     { "-h", "--help" },
185                     { "-l", "--list" },
186                     { "-n", "--numbered-list" },
187                     { "-o", "--output-file" },
188                     { "-p", "--progress" },
189                     { "-s", "--list-sizes" },
190                     { "-t", "--transport" },
191                     { "-v", "--verbose" },
192                 },
193                 {
194                     { "--ascp-options", "TRUE" },
195                     { "--ascp-path", "TRUE" },
196                     { "--debug", "TRUE" },
197                     { "--force", "TRUE" },
198                     { "--location", "TRUE" },
199                     { "--log-level", "TRUE" },
200                     { "--max-size", "TRUE" },
201                     { "--min-size", "TRUE" },
202                     { "--order", "TRUE" },
203                     { "--output-directory", "TRUE" },
204                     { "--output-file", "TRUE" },
205                     { "--progress", "TRUE" },
206                     { "--rows", "TRUE" },
207                     { "--transport", "TRUE" },
208                     { "--type", "TRUE" },
209                 }
210             };
211         case tool_name::SRA_PILEUP:
212             return {
213                 {
214                     { "-+", "--debug" },
215                     { "-?", "--help" },
216                     { "-L", "--log-level" },
217                     { "-V", "--version" },
218                     { "-d", "--duplicates" },
219                     { "-e", "--seqname" },
220                     { "-h", "--help" },
221                     { "-n", "--noqual" },
222                     { "-o", "--outfile" },
223                     { "-p", "--spotgroups" },
224                     { "-q", "--minmapq" },
225                     { "-r", "--aligned-region" },
226                     { "-t", "--table" },
227                     { "-v", "--verbose" },
228                 },
229                 {
230                     { "--aligned-region", "TRUE" },
231                     { "--debug", "TRUE" },
232                     { "--duplicates", "TRUE" },
233                     { "--function", "TRUE" },
234                     { "--log-level", "TRUE" },
235                     { "--merge-dist", "TRUE" },
236                     { "--minmapq", "TRUE" },
237                     { "--minmismatch", "TRUE" },
238                     { "--outfile", "TRUE" },
239                     { "--table", "TRUE" },
240                 }
241             };
242         default:
243             break;
244     }
245     assert(!"reachable");
246 }
247 
248 } // namespace sratools
249