NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Attributes | List of all members
CFormattingArgs Class Reference

Search Toolkit Book for CFormattingArgs

Argument class to collect formatting options, use this to create a CBlastFormat object. More...

#include <algo/blast/blastinput/blast_args.hpp>

+ Inheritance diagram for CFormattingArgs:
+ Collaboration diagram for CFormattingArgs:

Public Types

enum  EOutputFormat {
  ePairwise = 0 , eQueryAnchoredIdentities , eQueryAnchoredNoIdentities , eFlatQueryAnchoredIdentities ,
  eFlatQueryAnchoredNoIdentities , eXml , eTabular , eTabularWithComments ,
  eAsnText , eAsnBinary , eCommaSeparatedValues , eArchiveFormat ,
  eJsonSeqalign , eJson , eXml2 , eJson_S ,
  eXml2_S , eSAM , eTaxFormat , eAirrRearrangement ,
  eFasta , eEndValue
}
 Defines the output formats supported by our command line formatter. More...
 
enum  EFormatFlags {
  eDefaultFlag = 0 , eIsVDB = 0x01 , eIsSAM = 0x02 , eIsVDB_SAM = eIsVDB | eIsSAM ,
  eIsAirrRearrangement = 0x04
}
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CFormattingArgs (bool isIgblast=false, EFormatFlags flag=eDefaultFlag)
 Default constructor. More...
 
virtual void SetArgumentDescriptions (CArgDescriptions &arg_desc)
 Interface method,. More...
 
virtual void ExtractAlgorithmOptions (const CArgs &args, CBlastOptions &opts)
 Interface method,. More...
 
virtual void ParseFormattingString (const CArgs &args, EOutputFormat &fmt_type, string &custom_fmt_spec, string &custom_delim) const
 Parses the output format command line option value, returns the requested output format type and any custom output formats (if any and applicable) More...
 
EOutputFormat GetFormattedOutputChoice () const
 Get the choice of formatted output. More...
 
bool HasStructuredOutputFormat () const
 Returns true if the desired output format is structured (needed to determine whether to print or not that a PSI-BLAST search has converged - this is not supported in structured formats) More...
 
bool ShowGis () const
 Display the NCBI GIs in formatted output? More...
 
TSeqPos GetNumDescriptions () const
 Number of one-line descriptions to show in traditional BLAST output. More...
 
TSeqPos GetNumAlignments () const
 Number of alignments to show in traditional BLAST output. More...
 
bool DisplayHtmlOutput () const
 Display HTML output? More...
 
string GetCustomOutputFormatSpec () const
 Retrieve for string that specifies the custom output format for tabular and comma-separated value. More...
 
virtual bool ArchiveFormatRequested (const CArgs &args) const
 
size_t GetLineLength () const
 
int GetHitsSortOption () const
 
int GetHspsSortOption () const
 
string GetCustomDelimiter ()
 
- Public Member Functions inherited from IBlastCmdLineArgs
virtual ~IBlastCmdLineArgs ()
 Our virtual destructor. More...
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Protected Attributes

EOutputFormat m_OutputFormat
 Choice of formatting output. More...
 
bool m_ShowGis
 Display NCBI GIs? More...
 
TSeqPos m_NumDescriptions
 Number of 1-line descr. to show. More...
 
TSeqPos m_NumAlignments
 Number of alignments to show. More...
 
TSeqPos m_DfltNumDescriptions
 Default value for num descriptions. More...
 
TSeqPos m_DfltNumAlignments
 Default value for num alignments. More...
 
bool m_Html
 Display HTML output? More...
 
bool m_IsIgBlast
 IgBlast has a different default num_alignments. More...
 
string m_CustomOutputFormatSpec
 The format specification for custom output, e.g. More...
 
size_t m_LineLength
 
EFormatFlags m_FormatFlags
 
int m_HitsSortOption
 
int m_HspsSortOption
 
string m_CustomDelim
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Argument class to collect formatting options, use this to create a CBlastFormat object.

Note
This object is also needed to set the maximum number of target sequences to save (hitlist size)

Definition at line 1027 of file blast_args.hpp.

Member Enumeration Documentation

◆ EFormatFlags

Enumerator
eDefaultFlag 
eIsVDB 
eIsSAM 
eIsVDB_SAM 
eIsAirrRearrangement 

Definition at line 1081 of file blast_args.hpp.

◆ EOutputFormat

Defines the output formats supported by our command line formatter.

Enumerator
ePairwise 

Standard pairwise alignments.

Query anchored showing identities

eQueryAnchoredIdentities 

Query anchored no identities.

eQueryAnchoredNoIdentities 

Flat query anchored showing identities.

eFlatQueryAnchoredIdentities 

Flat query anchored no identities.

eFlatQueryAnchoredNoIdentities 
eXml 

XML output.

eTabular 

Tabular output.

eTabularWithComments 

Tabular output with comments.

eAsnText 

ASN.1 text output.

eAsnBinary 

ASN.1 binary output.

eCommaSeparatedValues 

Comma-separated values.

eArchiveFormat 

BLAST archive format.

eJsonSeqalign 

JSON seq-align.

eJson 

JSON XInclude.

eXml2 

XML2 XInclude.

eJson_S 

JSON2 single file.

eXml2_S 

XML2 single file.

eSAM 

SAM format.

eTaxFormat 
eAirrRearrangement 

igblast AIRR rearrangement, 19

eFasta 

unaligned reads in magicblast

eEndValue 

Sentinel value for error checking.

Definition at line 1031 of file blast_args.hpp.

Constructor & Destructor Documentation

◆ CFormattingArgs()

CFormattingArgs::CFormattingArgs ( bool  isIgblast = false,
EFormatFlags  flag = eDefaultFlag 
)
inline

Default constructor.

Definition at line 1093 of file blast_args.hpp.

References kDfltArgNumAlignments, kDfltArgNumDescriptions, m_DfltNumAlignments, m_DfltNumDescriptions, and m_IsIgBlast.

Member Function Documentation

◆ ArchiveFormatRequested()

bool CFormattingArgs::ArchiveFormatRequested ( const CArgs args) const
virtual

◆ DisplayHtmlOutput()

bool CFormattingArgs::DisplayHtmlOutput ( ) const
inline

◆ ExtractAlgorithmOptions()

void CFormattingArgs::ExtractAlgorithmOptions ( const CArgs args,
CBlastOptions opts 
)
virtual

◆ GetCustomDelimiter()

string CFormattingArgs::GetCustomDelimiter ( )
inline

◆ GetCustomOutputFormatSpec()

string CFormattingArgs::GetCustomOutputFormatSpec ( ) const
inline

◆ GetFormattedOutputChoice()

EOutputFormat CFormattingArgs::GetFormattedOutputChoice ( ) const
inline

◆ GetHitsSortOption()

int CFormattingArgs::GetHitsSortOption ( ) const
inline

◆ GetHspsSortOption()

int CFormattingArgs::GetHspsSortOption ( ) const
inline

◆ GetLineLength()

size_t CFormattingArgs::GetLineLength ( ) const
inline

◆ GetNumAlignments()

TSeqPos CFormattingArgs::GetNumAlignments ( ) const
inline

◆ GetNumDescriptions()

TSeqPos CFormattingArgs::GetNumDescriptions ( ) const
inline

◆ HasStructuredOutputFormat()

bool CFormattingArgs::HasStructuredOutputFormat ( ) const
inline

Returns true if the desired output format is structured (needed to determine whether to print or not that a PSI-BLAST search has converged - this is not supported in structured formats)

Definition at line 1140 of file blast_args.hpp.

References eAsnBinary, eAsnText, eJson, eJson_S, eJsonSeqalign, eSAM, eXml, eXml2, eXml2_S, and m_OutputFormat.

Referenced by CDeltaBlastApp::Run(), and CPsiBlastApp::Run().

◆ ParseFormattingString()

void CFormattingArgs::ParseFormattingString ( const CArgs args,
EOutputFormat fmt_type,
string custom_fmt_spec,
string custom_delim 
) const
virtual

Parses the output format command line option value, returns the requested output format type and any custom output formats (if any and applicable)

Parameters
argsCommand line arguments object [in]
fmt_typeOutput format type requested in command line options [out]
custom_fmt_specCustom output format specification in command line options [out]

Definition at line 2790 of file blast_args.cpp.

References eAirrRearrangement, eCommaSeparatedValues, eEndValue, eSAM, eTabular, eTabularWithComments, kArgOutputFormat, m_IsIgBlast, NCBI_THROW, NStr::Replace(), NStr::Split(), NStr::SplitInTwo(), NStr::StartsWith(), NStr::StringToInt(), tag, NStr::TruncateSpaces(), and val.

Referenced by ArchiveFormatRequested(), and ExtractAlgorithmOptions().

◆ SetArgumentDescriptions()

void CFormattingArgs::SetArgumentDescriptions ( CArgDescriptions arg_desc)
virtual

◆ ShowGis()

bool CFormattingArgs::ShowGis ( ) const
inline

Member Data Documentation

◆ m_CustomDelim

string CFormattingArgs::m_CustomDelim
protected

Definition at line 1204 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetCustomDelimiter().

◆ m_CustomOutputFormatSpec

string CFormattingArgs::m_CustomOutputFormatSpec
protected

The format specification for custom output, e.g.

: tabular or comma-separated value (populated if applicable)

Definition at line 1199 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetCustomOutputFormatSpec().

◆ m_DfltNumAlignments

TSeqPos CFormattingArgs::m_DfltNumAlignments
protected

Default value for num alignments.

Definition at line 1194 of file blast_args.hpp.

Referenced by CFormattingArgs(), ExtractAlgorithmOptions(), and SetArgumentDescriptions().

◆ m_DfltNumDescriptions

TSeqPos CFormattingArgs::m_DfltNumDescriptions
protected

Default value for num descriptions.

Definition at line 1193 of file blast_args.hpp.

Referenced by CFormattingArgs(), ExtractAlgorithmOptions(), and SetArgumentDescriptions().

◆ m_FormatFlags

EFormatFlags CFormattingArgs::m_FormatFlags
protected

Definition at line 1201 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and SetArgumentDescriptions().

◆ m_HitsSortOption

int CFormattingArgs::m_HitsSortOption
protected

Definition at line 1202 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetHitsSortOption().

◆ m_HspsSortOption

int CFormattingArgs::m_HspsSortOption
protected

Definition at line 1203 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetHspsSortOption().

◆ m_Html

bool CFormattingArgs::m_Html
protected

Display HTML output?

Definition at line 1195 of file blast_args.hpp.

Referenced by DisplayHtmlOutput(), CMapperFormattingArgs::ExtractAlgorithmOptions(), and ExtractAlgorithmOptions().

◆ m_IsIgBlast

bool CFormattingArgs::m_IsIgBlast
protected

IgBlast has a different default num_alignments.

Definition at line 1196 of file blast_args.hpp.

Referenced by CFormattingArgs(), ExtractAlgorithmOptions(), ParseFormattingString(), and SetArgumentDescriptions().

◆ m_LineLength

size_t CFormattingArgs::m_LineLength
protected

Definition at line 1200 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetLineLength().

◆ m_NumAlignments

TSeqPos CFormattingArgs::m_NumAlignments
protected

Number of alignments to show.

Definition at line 1192 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetNumAlignments().

◆ m_NumDescriptions

TSeqPos CFormattingArgs::m_NumDescriptions
protected

Number of 1-line descr. to show.

Definition at line 1191 of file blast_args.hpp.

Referenced by ExtractAlgorithmOptions(), and GetNumDescriptions().

◆ m_OutputFormat

EOutputFormat CFormattingArgs::m_OutputFormat
protected

◆ m_ShowGis

bool CFormattingArgs::m_ShowGis
protected

Display NCBI GIs?

Definition at line 1190 of file blast_args.hpp.

Referenced by CMapperFormattingArgs::ExtractAlgorithmOptions(), ExtractAlgorithmOptions(), and ShowGis().


The documentation for this class was generated from the following files:
Modified on Wed May 15 15:09:46 2024 by modify_doxy.py rev. 669887