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

Search Toolkit Book for CBlastDB_SeqFormatter

Customizable sequence formatter interface. More...

#include <objtools/blast/blastdb_format/seq_formatter.hpp>

+ Inheritance diagram for CBlastDB_SeqFormatter:
+ Collaboration diagram for CBlastDB_SeqFormatter:

Public Member Functions

 CBlastDB_SeqFormatter (const string &fmt_spec, CSeqDB &blastdb, CNcbiOstream &out)
 Constructor. More...
 
int Write (CSeqDB::TOID oid, const CBlastDB_FormatterConfig &config, string target_id=kEmptyStr)
 
void DumpAll (const CBlastDB_FormatterConfig &config)
 
- Public Member Functions inherited from CBlastDB_Formatter
 CBlastDB_Formatter ()
 
virtual ~CBlastDB_Formatter ()
 

Private Types

enum  EOtherFields { e_seq = 0 , e_mask , e_hash , e_max_other_fields }
 Fields not in defline. More...
 

Private Member Functions

void x_Print (CSeqDB::TOID oid, vector< string > &defline_data, vector< string > &other_fields)
 Build data for write. More...
 
void x_DataRequired ()
 
void x_GetSeq (CSeqDB::TOID oid, const CBlastDB_FormatterConfig &config, string &seq)
 
string x_GetSeqHash (CSeqDB::TOID oid)
 
string x_GetSeqMask (CSeqDB::TOID oid, int algo_id)
 
 CBlastDB_SeqFormatter (const CBlastDB_SeqFormatter &rhs)
 Prohibit copy constructor. More...
 
CBlastDB_SeqFormatteroperator= (const CBlastDB_SeqFormatter &rhs)
 Prohibit assignment operator. More...
 

Private Attributes

CNcbiOstreamm_Out
 Stream to write output. More...
 
string m_FmtSpec
 The output format specification. More...
 
CSeqDBm_BlastDb
 The BLAST database from which to extract data. More...
 
vector< stringm_Seperators
 Vector of offsets where the replacements will take place. More...
 
vector< char > m_ReplTypes
 Vector of convertor objects. More...
 
bool m_GetDefline
 
CBlastDeflineUtil::BlastDeflineFields m_DeflineFields
 
unsigned int m_OtherFields
 Bit Mask for other fields. More...
 

Detailed Description

Customizable sequence formatter interface.

Definition at line 88 of file seq_formatter.hpp.

Member Enumeration Documentation

◆ EOtherFields

Fields not in defline.

Enumerator
e_seq 
e_mask 
e_hash 
e_max_other_fields 

Definition at line 102 of file seq_formatter.hpp.

Constructor & Destructor Documentation

◆ CBlastDB_SeqFormatter() [1/2]

CBlastDB_SeqFormatter::CBlastDB_SeqFormatter ( const string fmt_spec,
CSeqDB blastdb,
CNcbiOstream out 
)

Constructor.

Parameters
fmt_specformat specification [in]
blastdbBLAST database from which to retrieve the data [in]
outoutput stream to write the data [in]

Definition at line 59 of file seq_formatter.cpp.

References i, kEmptyStr, m_DeflineFields, m_FmtSpec, m_ReplTypes, m_Seperators, NCBI_THROW, and x_DataRequired().

◆ CBlastDB_SeqFormatter() [2/2]

CBlastDB_SeqFormatter::CBlastDB_SeqFormatter ( const CBlastDB_SeqFormatter rhs)
private

Prohibit copy constructor.

Member Function Documentation

◆ DumpAll()

void CBlastDB_SeqFormatter::DumpAll ( const CBlastDB_FormatterConfig config)
virtual

Implements CBlastDB_Formatter.

Definition at line 372 of file seq_formatter.cpp.

References CSeqDB::CheckOrFindOID(), i, m_BlastDb, and Write().

◆ operator=()

CBlastDB_SeqFormatter& CBlastDB_SeqFormatter::operator= ( const CBlastDB_SeqFormatter rhs)
private

Prohibit assignment operator.

◆ Write()

int CBlastDB_SeqFormatter::Write ( CSeqDB::TOID  oid,
const CBlastDB_FormatterConfig config,
string  target_id = kEmptyStr 
)
virtual

◆ x_DataRequired()

void CBlastDB_SeqFormatter::x_DataRequired ( )
private

◆ x_GetSeq()

void CBlastDB_SeqFormatter::x_GetSeq ( CSeqDB::TOID  oid,
const CBlastDB_FormatterConfig config,
string seq 
)
private

◆ x_GetSeqHash()

string CBlastDB_SeqFormatter::x_GetSeqHash ( CSeqDB::TOID  oid)
private

Definition at line 265 of file seq_formatter.cpp.

References CBlastSeqUtil::GetSeqHash(), CSeqDB::GetSequenceAsString(), hex(), and m_BlastDb.

Referenced by Write().

◆ x_GetSeqMask()

string CBlastDB_SeqFormatter::x_GetSeqMask ( CSeqDB::TOID  oid,
int  algo_id 
)
private

Definition at line 275 of file seq_formatter.cpp.

References CBlastSeqUtil::GetMasksString(), m_BlastDb, and s_GetSeqMask().

Referenced by Write().

◆ x_Print()

void CBlastDB_SeqFormatter::x_Print ( CSeqDB::TOID  oid,
vector< string > &  defline_data,
vector< string > &  other_fields 
)
private

Member Data Documentation

◆ m_BlastDb

CSeqDB& CBlastDB_SeqFormatter::m_BlastDb
private

The BLAST database from which to extract data.

Definition at line 114 of file seq_formatter.hpp.

Referenced by DumpAll(), Write(), x_GetSeq(), x_GetSeqHash(), x_GetSeqMask(), and x_Print().

◆ m_DeflineFields

CBlastDeflineUtil::BlastDeflineFields CBlastDB_SeqFormatter::m_DeflineFields
private

Definition at line 120 of file seq_formatter.hpp.

Referenced by CBlastDB_SeqFormatter(), Write(), and x_DataRequired().

◆ m_FmtSpec

string CBlastDB_SeqFormatter::m_FmtSpec
private

The output format specification.

Definition at line 112 of file seq_formatter.hpp.

Referenced by CBlastDB_SeqFormatter().

◆ m_GetDefline

bool CBlastDB_SeqFormatter::m_GetDefline
private

Definition at line 119 of file seq_formatter.hpp.

Referenced by Write(), and x_DataRequired().

◆ m_OtherFields

unsigned int CBlastDB_SeqFormatter::m_OtherFields
private

Bit Mask for other fields.

Definition at line 122 of file seq_formatter.hpp.

Referenced by Write(), and x_DataRequired().

◆ m_Out

CNcbiOstream& CBlastDB_SeqFormatter::m_Out
private

Stream to write output.

Definition at line 110 of file seq_formatter.hpp.

Referenced by Write(), and x_Print().

◆ m_ReplTypes

vector<char> CBlastDB_SeqFormatter::m_ReplTypes
private

Vector of convertor objects.

Definition at line 118 of file seq_formatter.hpp.

Referenced by CBlastDB_SeqFormatter(), x_DataRequired(), and x_Print().

◆ m_Seperators

vector<string> CBlastDB_SeqFormatter::m_Seperators
private

Vector of offsets where the replacements will take place.

Definition at line 116 of file seq_formatter.hpp.

Referenced by CBlastDB_SeqFormatter(), and x_Print().


The documentation for this class was generated from the following files:
Modified on Wed Sep 04 15:05:57 2024 by modify_doxy.py rev. 669887