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

Go to the SVN repository for this file.

1 /* $Id: win_mask_config.cpp 98008 2022-09-19 12:38:44Z morgulis $
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: Aleksandr Morgulis
27  *
28  * File Description:
29  * CWinMaskConfig class member and method definitions.
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbidbg.hpp>
35 
45 #include <objmgr/util/sequence.hpp>
46 
49 
51  EAppType type,
52  bool determine_input)
53 {
54  arg_desc.SetCurrentGroup("WindowMasker options");
55 
56  // Adding command line arguments descriptions
57  if(type == eAny)
58  arg_desc.AddOptionalKey( "ustat", "unit_counts",
59  "file with unit counts",
61  else if(type >= eGenerateMasks)
62  arg_desc.AddKey( "ustat", "unit_counts",
63  "file with unit counts",
65  if(determine_input)
66  arg_desc.AddDefaultKey( kInput, "input_file_name",
67  "input file name "
68  "(not optional if used with -mk_counts or -convert options)",
70  arg_desc.AddDefaultKey( kOutput, "output_file_name",
71  "output file name",
73  if(type == eAny || type == eComputeCounts){
74  arg_desc.AddDefaultKey( "checkdup", "check_duplicates",
75  "check for duplicate sequences",
76  CArgDescriptions::eBoolean, "false" );
77  if(determine_input)
78  arg_desc.AddDefaultKey( "fa_list", "input_is_a_list",
79  "indicates that -input represents a file containing "
80  "a list of names of fasta files to process, one name "
81  " per line",
82  CArgDescriptions::eBoolean, "false" );
83  arg_desc.AddDefaultKey( "mem", "available_memory",
84  "memory available for mk_counts option in megabytes",
86  arg_desc.AddDefaultKey( "meta", "info_string",
87  "add metadata to the counts file",
89  arg_desc.AddOptionalKey( "unit", "unit_length",
90  "number of bases in a unit",
92  arg_desc.AddOptionalKey( "genome_size", "genome_size",
93  "total size of the genome",
95  arg_desc.SetConstraint( "mem", new CArgAllow_Integers( 1, kMax_Int ) );
96  arg_desc.SetConstraint( "unit", new CArgAllow_Integers( 1, 16 ) );
97  }
98  if(type == eAny || type >= eGenerateMasks){
99  arg_desc.AddOptionalKey( "window", "window_size", "window size",
101  arg_desc.AddOptionalKey( "t_extend", "T_extend",
102  "window score above which it is allowed to extend masking",
104  arg_desc.AddOptionalKey( "t_thres", "T_threshold",
105  "window score threshold used to trigger masking",
107  arg_desc.AddOptionalKey( "set_t_high", "score_value",
108  "alternative high score for a unit if the"
109  "original unit score is more than highscore",
111  arg_desc.AddOptionalKey( "set_t_low", "score_value",
112  "alternative low score for a unit if the"
113  "original unit score is lower than lowscore",
115  arg_desc.SetConstraint( "window",
116  new CArgAllow_Integers( 1, kMax_Int ) );
117  arg_desc.SetConstraint( "t_extend",
118  new CArgAllow_Integers( 0, kMax_Int ) );
119  arg_desc.SetConstraint( "t_thres",
120  new CArgAllow_Integers( 1, kMax_Int ) );
121  arg_desc.SetConstraint( "set_t_high",
122  new CArgAllow_Integers( 1, kMax_Int ) );
123  arg_desc.SetConstraint( "set_t_low",
124  new CArgAllow_Integers( 1, kMax_Int ) );
125  arg_desc.AddFlag ( "parse_seqids",
126  "Parse Seq-ids in FASTA input", true );
127  arg_desc.AddDefaultKey( kOutputFormat, "output_format",
128  "controls the format of the masker output (for masking stage only)",
130  CArgAllow_Strings* strings_allowed = new CArgAllow_Strings();
131  for (size_t i = 0; i < kNumOutputFormats; i++) {
132  strings_allowed->Allow(kOutputFormats[i]);
133  }
134  arg_desc.SetConstraint( kOutputFormat, strings_allowed );
135  }
136  if(type != eConvertCounts){
137  arg_desc.AddOptionalKey( "t_high", "T_high",
138  "maximum useful unit score",
140  arg_desc.AddOptionalKey( "t_high_pct", "T_high_pct",
141  "maximum useful unit score as percentage",
143  arg_desc.AddOptionalKey( "t_thres_pct", "T_threshold_pct",
144  "window score threshold used to trigger masking as percentage",
146  arg_desc.AddOptionalKey( "t_extend_pct", "T_extend_pct",
147  "window score above which it is allowed to extend masking as percentage",
149  arg_desc.AddOptionalKey( "t_low", "T_low",
150  "minimum useful unit score",
152  arg_desc.AddOptionalKey( "t_low_pct", "T_low_pct",
153  "minimum useful unit score as percentage",
155  arg_desc.SetConstraint( "t_high",
156  new CArgAllow_Integers( 1, kMax_Int ) );
157  arg_desc.SetConstraint( "t_high_pct",
158  new CArgAllow_Doubles( 0.0, 100.0 ) );
159  arg_desc.SetConstraint( "t_thres_pct",
160  new CArgAllow_Doubles( 0.0, 100.0 ) );
161  arg_desc.SetConstraint( "t_extend_pct",
162  new CArgAllow_Doubles( 0.0, 100.0 ) );
163  arg_desc.SetConstraint( "t_low",
164  new CArgAllow_Integers( 1, kMax_Int ) );
165  arg_desc.SetConstraint( "t_low_pct",
166  new CArgAllow_Doubles( 0.0, 100.0 ) );
167  arg_desc.AddDefaultKey( kInputFormat, "input_format",
168  "controls the format of the masker input",
170  arg_desc.AddDefaultKey( "exclude_ids", "exclude_id_list",
171  "file containing the list of ids to exclude from processing",
173  arg_desc.AddDefaultKey( "ids", "id_list",
174  "file containing the list of ids to process",
176  arg_desc.AddDefaultKey( "text_match", "text_match_ids",
177  "match ids as strings",
179  CArgAllow_Strings* strings_allowed = new CArgAllow_Strings();
180  for (size_t i = 0; i < kNumInputFormats; i++) {
181  strings_allowed->Allow(kInputFormats[i]);
182  }
183  strings_allowed->Allow("seqids");
184  arg_desc.SetConstraint( kInputFormat, strings_allowed );
185  }
186  if(type < eGenerateMasks){
187  arg_desc.AddDefaultKey( "sformat", "unit_counts_format",
188  "controls the format of the output file containing the unit counts "
189  "(for counts generation and conversion only)",
190  CArgDescriptions::eString, "ascii" );
191  arg_desc.SetConstraint( "sformat",
192  (new CArgAllow_Strings())
193  ->Allow( "ascii" )
194  ->Allow( "binary" )
195  ->Allow( "oascii" )
196  ->Allow( "obinary" ) );
197  arg_desc.AddDefaultKey( "smem", "available_memory",
198  "target size of the output file containing the unit counts",
200  }
201  if(type == eAny || type >= eGenerateMasksWithDuster) {
202  arg_desc.AddDefaultKey( "dust", "use_dust",
203  "combine window masking with dusting",
205  arg_desc.AddDefaultKey( "dust_level", "dust_level",
206  "dust minimum level",
208  }
209 
210  if(type == eAny){
211  arg_desc.AddFlag( "mk_counts", "generate frequency counts for a database" );
212  arg_desc.AddFlag( "convert", "convert counts between different formats" );
213  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "outfmt" );
214  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "ustat" );
215  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "window" );
216  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "t_thres" );
217  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "t_extend" );
218  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "set_t_low" );
219  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "set_t_high" );
220  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "dust" );
221  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "dust_level" );
222  arg_desc.CArgDescriptions::SetDependency( "mk_counts", CArgDescriptions::eExcludes, "convert" );
223 
224  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "checkdup" );
225  if(determine_input)
226  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "fa_list" );
227  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "mem" );
228  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "unit" );
229  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "genome_size" );
230  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "sformat" );
231  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "smem" );
232  arg_desc.CArgDescriptions::SetDependency( "ustat", CArgDescriptions::eExcludes, "convert" );
233 
234  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "checkdup" );
235  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "window" );
236  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "t_extend" );
237  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "t_thres" );
238  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "t_high" );
239  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "t_low" );
240  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "set_t_low" );
241  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "set_t_high" );
242  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "infmt" );
243  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "outfmt" );
244  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "parse_seqids" );
245  if(determine_input)
246  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "fa_list" );
247  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "mem" );
248  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "unit" );
249  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "genome_size" );
250  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "dust" );
251  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "dust_level" );
252  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "exclude_ids" );
253  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "ids" );
254  arg_desc.CArgDescriptions::SetDependency( "convert", CArgDescriptions::eExcludes, "text_match" );
255  }
256 }
257 
259  const CArgs & args, EAppType user_specified_type)
260 {
261  EAppType type = user_specified_type;
262 
263  if(type == eAny){
264  if(args["mk_counts"])
266  else if(args["convert"])
268  else if(args["ustat"])
270  else
271  NCBI_THROW( CWinMaskConfigException, eInconsistentOptions,
272  "one of '-mk_counts', '-convert' or '-ustat <stat_file>' "
273  "must be specified" );
274  }
275 
276  if(type == eGenerateMasksWithDuster && !args["dust"].AsBoolean())
278 
279  return type;
280 }
281 
284 {
285  const string & format( args[kOutputFormat].AsString() );
286  CMaskWriter* retval = NULL;
287 
288  if (format == "interval") {
289  CNcbiOstream& output = args[kOutput].AsOutputFile();
290  retval = new CMaskWriterInt(output);
291  } else if (format == "fasta") {
292  CNcbiOstream& output = args[kOutput].AsOutputFile();
293  retval = new CMaskWriterFasta(output);
294  } else if (NStr::StartsWith(format, "seqloc_asn1_binary")) {
295  CNcbiOstream& output = args[kOutput].AsOutputFile(CArgValue::fBinary);
296  retval = new CMaskWriterSeqLoc(output, format);
297  } else if (NStr::StartsWith(format, "seqloc_")) {
298  CNcbiOstream& output = args[kOutput].AsOutputFile();
299  retval = new CMaskWriterSeqLoc(output, format);
300  } else if (NStr::StartsWith(format, "maskinfo_asn1_binary")) {
301  CNcbiOstream& output = args[kOutput].AsOutputFile(CArgValue::fBinary);
302  retval =
306  } else if (NStr::StartsWith(format, "maskinfo_")) {
307  CNcbiOstream& output = args[kOutput].AsOutputFile();
308  retval =
312  } else {
313  throw runtime_error("Unknown output format");
314  }
315  return retval;
316 }
317 
318 //----------------------------------------------------------------------------
319 CWinMaskConfig::CWinMaskConfig( const CArgs & args, EAppType type, bool determine_input )
320  : app_type(s_DetermineAppType(args, type)),
321  is( app_type >= eGenerateMasks && args[kInputFormat].AsString() != "blastdb"
322  && determine_input ?
323  ( !(args[kInput].AsString() == "-")
324  ? new CNcbiIfstream( args[kInput].AsString().c_str() )
325  : static_cast<CNcbiIstream*>(&NcbiCin) ) : NULL ), reader( NULL ), writer( NULL ),
326  lstat_name( app_type >= eGenerateMasks ? args["ustat"].AsString() : "" ),
327  t_low_pct( app_type != eConvertCounts && args["t_low_pct"] ? args["t_low_pct"].AsDouble() : -1.0 ),
328  t_extend_pct( app_type != eConvertCounts && args["t_extend_pct"] ? args["t_extend_pct"].AsDouble() : -1.0 ),
329  t_thres_pct( app_type != eConvertCounts && args["t_thres_pct"] ? args["t_thres_pct"].AsDouble() : -1.0 ),
330  t_high_pct( app_type != eConvertCounts && args["t_high_pct"] ? args["t_high_pct"].AsDouble() : -1.0 ),
331  textend( app_type >= eGenerateMasks && args["t_extend"] ? args["t_extend"].AsInteger() : 0 ),
332  cutoff_score( app_type >= eGenerateMasks && args["t_thres"] ? args["t_thres"].AsInteger() : 0 ),
333  max_score( app_type != eConvertCounts && args["t_high"] ? args["t_high"].AsInteger() : 0 ),
334  min_score( app_type != eConvertCounts && args["t_low"] ? args["t_low"].AsInteger() : 0 ),
335  window_size( app_type >= eGenerateMasks && args["window"] ? args["window"].AsInteger() : 0 ),
336  merge_pass( false ),
337  merge_cutoff_score( 50 ),
338  abs_merge_cutoff_dist( 8 ),
339  mean_merge_cutoff_dist( 50 ),
340  trigger( "mean" ),
341  tmin_count( 0 ),
342  discontig( false ),
343  pattern( 0 ),
344  window_step( 1 ),
345  unit_step( 1 ),
346  merge_unit_step( 1 ),
347  fa_list( app_type == eComputeCounts && determine_input ? args["fa_list"].AsBoolean() : false ),
348  mem( app_type == eComputeCounts ? args["mem"].AsInteger() : 0 ),
349  unit_size( app_type == eComputeCounts && args["unit"] ? args["unit"].AsInteger() : 0 ),
350  genome_size( app_type == eComputeCounts && args["genome_size"] ? args["genome_size"].AsInt8() : 0 ),
351  input( determine_input ? args[kInput].AsString() : ""),
352  output( args[kOutput].AsString() ),
353  th( "90,99,99.5,99.8" ),
354  dust_window( 64 ),
355  dust_level( app_type == eGenerateMasksWithDuster ? args["dust_level"].AsInteger() : 0 ),
356  dust_linker( 1 ),
357  checkdup( app_type == eComputeCounts ? args["checkdup"].AsBoolean() : false ),
358  sformat( app_type < eGenerateMasks ? args["sformat"].AsString() : "" ),
359  smem( app_type < eGenerateMasks ? args["smem"].AsInteger() : 0 ),
360  ids( 0 ), exclude_ids( 0 ),
361  use_ba( app_type != eConvertCounts ),
362  text_match( app_type != eConvertCounts && args["text_match"].AsBoolean() )
363 {
364  if (args.Exist("meta") && args["meta"]) {
365  metadata = args["meta"].AsString();
366  }
367  _TRACE( "Entering CWinMaskConfig::CWinMaskConfig()" );
368 
369  if(app_type == eConvertCounts)
370  return;
371 
372  iformatstr = args[kInputFormat].AsString();
373 
374  if( app_type == eComputeCounts) {
375  text_match = true;
376  } else {
377  if( is && !*is )
378  {
380  eInputOpenFail,
381  args[kInput].AsString() );
382  }
383 
384  if(determine_input && iformatstr != "seqids"){
385  if( iformatstr == "fasta" )
386  reader = new CMaskFastaReader( *is, true, args["parse_seqids"] );
387  else if( iformatstr == "blastdb" )
388  reader = new CMaskBDBReader( args[kInput].AsString() );
389 
390  if( !reader )
391  {
393  eReaderAllocFail, "" );
394  }
395  }
396 
397  writer = x_GetWriter(args);
398 
399  set_max_score = args["set_t_high"] ? args["set_t_high"].AsInteger()
400  : 0;
401  set_min_score = args["set_t_low"] ? args["set_t_low"].AsInteger()
402  : 0;
403  }
404 
405  string ids_file_name( args["ids"].AsString() );
406  string exclude_ids_file_name( args["exclude_ids"].AsString() );
407 
408  if( !ids_file_name.empty()
409  && !exclude_ids_file_name.empty() )
410  {
411  NCBI_THROW( CWinMaskConfigException, eInconsistentOptions,
412  "only one of -ids or -exclude_ids can be specified" );
413  }
414 
415  if( !ids_file_name.empty() ) {
416  if( text_match ) {
417  ids = new CIdSet_TextMatch;
418  }else {
419  if( iformatstr == "blastdb" )
420  ids = new CIdSet_SeqId;
421  else
422  NCBI_THROW( CWinMaskConfigException, eInconsistentOptions,
423  "-text_match false can be used only with "
424  + string(kInputFormat) + " blastdb" );
425  }
426 
427  FillIdList( ids_file_name, *ids );
428  }
429 
430  if( !exclude_ids_file_name.empty() ) {
431  if( text_match ) {
433  }else {
434  if( iformatstr == "blastdb" )
436  else
437  NCBI_THROW( CWinMaskConfigException, eInconsistentOptions,
438  "-text_match false can be used only with "
439  + string(kInputFormat) + " blastdb" );
440  }
441 
442  FillIdList( exclude_ids_file_name, *exclude_ids );
443  }
444 
445  _TRACE( "Leaving CWinMaskConfig::CWinMaskConfig" );
446 }
447 
449 {
450  if ( reader ) {
451  delete reader;
452  }
453  if ( writer ) {
454  delete writer;
455  }
456 }
457 
459  if ( !reader ) {
460  NCBI_THROW( CWinMaskConfigException, eInconsistentOptions,
461  "User options caused reader not to be created; can't get reader" );
462  }
463  return *reader;
464  }
465 
466 //----------------------------------------------------------------------------
467 void CWinMaskConfig::FillIdList( const string & file_name,
468  CIdSet & id_list )
469 {
470  CNcbiIfstream file( file_name.c_str() );
471  string line;
472 
473  while( NcbiGetlineEOL( file, line ) ) {
474  if( !line.empty() )
475  {
476  string::size_type stop( line.find_first_of( " \t" ) );
477  string::size_type start( line[0] == '>' ? 1 : 0 );
478  string id_str = line.substr( start, stop - start );
479  id_list.insert( id_str );
480  }
481  }
482 }
483 
484 //----------------------------------------------------------------------------
486 {
487  switch( GetErrCode() )
488  {
489  case eInputOpenFail:
490 
491  return "can not open input stream";
492 
493  case eReaderAllocFail:
494 
495  return "can not allocate fasta sequence reader";
496 
498 
499  return "inconsistent program options";
500 
501  default:
502 
504  }
505 }
506 
CArgAllow_Doubles –.
Definition: ncbiargs.hpp:1781
CArgAllow_Integers –.
Definition: ncbiargs.hpp:1751
CArgAllow_Strings –.
Definition: ncbiargs.hpp:1641
CArgDescriptions –.
Definition: ncbiargs.hpp:541
CArgs –.
Definition: ncbiargs.hpp:379
Class for reading sequences from BLAST databases.
Class for reading sequences from fasta files.
Virtual base class for all input readers.
Definition: mask_reader.hpp:50
Output filter to print masked sequence locations as Blast-db-mask-info objects.
Output filter to write masked data in fasta format.
Output filter to print masked sequences as sets of intervals.
Output filter to print masked sequence locations as NCBI Seq-loc objects.
A base class for winmasker output writers.
Definition: mask_writer.hpp:52
Winmasker configuration errors.
virtual const char * GetErrCodeString() const override
Get the description of an error.
@ eInconsistentOptions
Option validation failure.
@ eInputOpenFail
Can not open input file.
@ eReaderAllocFail
Memory allocation for input reader object failed.
string iformatstr
input format
static void FillIdList(const string &file_name, CIdSet &id_list)
Read the list of sequence ids from a given file.
CMaskWriter * writer
output writer object
CMaskReader * reader
input reader object
CWinMaskConfig(const CArgs &args, EAppType type=eAny, bool determine_input=true)
Object constructor.
CIstreamProxy is
input file resource manager
CMaskWriter * x_GetWriter(const CArgs &args)
Create the CMaskWriter instance for this class.
string output
output file name (may be empty to indicate stdout)
CIdSet * exclude_ids
set of ids to exclude from processing
CWinMaskUtil::CIdSet_TextMatch CIdSet_TextMatch
EAppType app_type
type of application to run
CMaskReader & Reader()
Get the input reader object.
Uint4 set_max_score
score to use for high scoring units
string metadata
metadata associated with counts file
~CWinMaskConfig()
Destructor.
CIdSet * ids
set of ids to process
bool text_match
identify seq ids by string matching
Uint4 set_min_score
score to use for low scoring units
static void AddWinMaskArgs(CArgDescriptions &arg_desc, EAppType type=eAny, bool determine_input=true)
CWinMaskUtil::CIdSet_SeqId CIdSet_SeqId
static EAppType s_DetermineAppType(const CArgs &args, EAppType user_specified_type)
Base class for sets of seq_id representations used with -ids and -exclude-ids options.
virtual void insert(const string &id_str)=0
Add a string to the id set.
static ulg window_size
const char * file_name[]
#define false
Definition: bool.h:36
static int type
Definition: getdata.c:31
static SQLCHAR output[256]
Definition: print.c:5
void AddFlag(const string &name, const string &comment, CBoolEnum< EFlagValue > set_value=eFlagHasValueIfSet, TFlags flags=0)
Add description for flag argument.
Definition: ncbiargs.cpp:2459
void SetConstraint(const string &name, const CArgAllow *constraint, EConstraintNegate negate=eConstraint)
Set additional user defined constraint on argument value.
Definition: ncbiargs.cpp:2591
bool Exist(const string &name) const
Check existence of argument description.
Definition: ncbiargs.cpp:1813
void AddKey(const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
Add description for mandatory key.
Definition: ncbiargs.cpp:2412
void AddOptionalKey(const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
Add description for optional key without default value.
Definition: ncbiargs.cpp:2427
CArgAllow_Strings * Allow(const string &value)
Add allowed string values.
Definition: ncbiargs.cpp:4598
void SetCurrentGroup(const string &group)
Set current arguments group name.
Definition: ncbiargs.cpp:2632
void AddDefaultKey(const string &name, const string &synopsis, const string &comment, EType type, const string &default_value, TFlags flags=0, const string &env_var=kEmptyStr, const char *display_value=nullptr)
Add description for optional key with default value.
Definition: ncbiargs.cpp:2442
@ eExcludes
One argument excludes another.
Definition: ncbiargs.hpp:957
@ eInputFile
Name of file (must exist and be readable)
Definition: ncbiargs.hpp:595
@ eBoolean
{'true', 't', 'false', 'f'}, case-insensitive
Definition: ncbiargs.hpp:590
@ eDouble
Convertible into a floating point number (double)
Definition: ncbiargs.hpp:594
@ eString
An arbitrary string.
Definition: ncbiargs.hpp:589
@ eOutputFile
Name of file (must be writable)
Definition: ncbiargs.hpp:596
@ eInteger
Convertible into an integer number (int or Int8)
Definition: ncbiargs.hpp:592
@ fBinary
Open file in binary mode.
Definition: ncbiargs.hpp:263
#define NULL
Definition: ncbistd.hpp:225
#define _TRACE(message)
Definition: ncbidbg.hpp:122
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
#define kMax_Int
Definition: ncbi_limits.h:184
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
CNcbiIstream & NcbiGetlineEOL(CNcbiIstream &is, string &str, string::size_type *count=NULL)
Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define NcbiCin
Definition: ncbistre.hpp:542
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5406
@ eBlast_filter_program_windowmasker
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n th
FILE * file
static int input()
int i
Contains the command line options common to filtering algorithms.
const size_t kNumInputFormats
Number of elements in kInputFormats.
const char * kOutputFormats[]
Output formats allowed, the first one is the default.
const size_t kNumOutputFormats
Number of elements in kOutputFormats.
const std::string kOutput
Command line flag to specify the output.
const std::string kOutputFormat
Command line flag to specify the output format.
const char * kInputFormats[]
Input formats allowed, the first one is the default.
const std::string kInput
Command line flag to specify the input.
const std::string kInputFormat
Command line flag to specify the input format.
string BuildAlgorithmParametersString(const CArgs &args)
Builds an algorithm options string for the filtering applications (segmasker, dustmasker) by examinin...
NCBI C++ auxiliary debug macros.
static Format format
Definition: njn_ioutil.cpp:53
Definition: type.c:6
USING_SCOPE(objects)
Modified on Fri Sep 20 14:58:29 2024 by modify_doxy.py rev. 669887