NCBI C++ ToolKit
|
Search Toolkit Book for CBlastDB_SeqFormatter
Customizable sequence formatter interface. More...
#include <objtools/blast/blastdb_format/seq_formatter.hpp>
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_SeqFormatter & | operator= (const CBlastDB_SeqFormatter &rhs) |
Prohibit assignment operator. More... | |
Private Attributes | |
CNcbiOstream & | m_Out |
Stream to write output. More... | |
string | m_FmtSpec |
The output format specification. More... | |
CSeqDB & | m_BlastDb |
The BLAST database from which to extract data. More... | |
vector< string > | m_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... | |
Customizable sequence formatter interface.
Definition at line 88 of file seq_formatter.hpp.
|
private |
Fields not in defline.
Enumerator | |
---|---|
e_seq | |
e_mask | |
e_hash | |
e_max_other_fields |
Definition at line 102 of file seq_formatter.hpp.
CBlastDB_SeqFormatter::CBlastDB_SeqFormatter | ( | const string & | fmt_spec, |
CSeqDB & | blastdb, | ||
CNcbiOstream & | out | ||
) |
Constructor.
fmt_spec | format specification [in] |
blastdb | BLAST database from which to retrieve the data [in] |
out | output 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().
|
private |
Prohibit copy constructor.
|
virtual |
Implements CBlastDB_Formatter.
Definition at line 372 of file seq_formatter.cpp.
References CSeqDB::CheckOrFindOID(), i, m_BlastDb, and Write().
|
private |
Prohibit assignment operator.
|
virtual |
Implements CBlastDB_Formatter.
Definition at line 315 of file seq_formatter.cpp.
References CBlastDeflineUtil::BlastDeflineFields::asn_defline, e_hash, e_mask, e_max_other_fields, e_seq, CRef< C, Locker >::Empty(), CBlastDeflineUtil::ExtractDataFromBlastDefline(), CBlastDeflineUtil::ExtractDataFromBlastDeflineSet(), CBlast_def_line_set_Base::Get(), CSeqDB::GetHdr(), ITERATE, kEmptyStr, m_BlastDb, m_DeflineFields, m_GetDefline, m_OtherFields, m_Out, mask, CBlastDeflineUtil::max_index, MSerial_AsnText, x_GetSeq(), x_GetSeqHash(), x_GetSeqMask(), and x_Print().
Referenced by DumpAll().
|
private |
Definition at line 93 of file seq_formatter.cpp.
References CBlastDeflineUtil::BlastDeflineFields::accession, CBlastDeflineUtil::BlastDeflineFields::asn_defline, e_hash, e_mask, e_seq, CBlastDeflineUtil::BlastDeflineFields::gi, ITERATE, CBlastDeflineUtil::BlastDeflineFields::leaf_node_tax_ids, CBlastDeflineUtil::BlastDeflineFields::leaf_node_tax_names, CBlastDeflineUtil::BlastDeflineFields::links, m_DeflineFields, m_GetDefline, m_OtherFields, m_ReplTypes, CBlastDeflineUtil::BlastDeflineFields::membership, CBlastDeflineUtil::BlastDeflineFields::pig, CBlastDeflineUtil::BlastDeflineFields::seq_id, CBlastDeflineUtil::BlastDeflineFields::tax_id, CBlastDeflineUtil::BlastDeflineFields::tax_names, and CBlastDeflineUtil::BlastDeflineFields::title.
Referenced by CBlastDB_SeqFormatter().
|
private |
Definition at line 282 of file seq_formatter.cpp.
References CBlastSeqUtil::ApplySeqMask(), CSeqDB::TSequenceRanges::empty(), eNa_strand_minus, CBlastSeqUtil::GetReverseStrandSeq(), CSeqDB::GetSeqLength(), CSeqDB::GetSequenceAsString(), m_BlastDb, r(), and s_GetSeqMask().
Referenced by Write().
|
private |
Definition at line 265 of file seq_formatter.cpp.
References CBlastSeqUtil::GetSeqHash(), CSeqDB::GetSequenceAsString(), hex(), and m_BlastDb.
Referenced by Write().
|
private |
Definition at line 275 of file seq_formatter.cpp.
References CBlastSeqUtil::GetMasksString(), m_BlastDb, and s_GetSeqMask().
Referenced by Write().
|
private |
Build data for write.
Definition at line 165 of file seq_formatter.cpp.
References CBlastDeflineUtil::accession, CBlastDeflineUtil::asn_defline, CBlastDeflineUtil::blast_name, CBlastDeflineUtil::common_name, e_hash, e_mask, e_seq, CSeqDB::GetSeqLength(), CBlastDeflineUtil::gi, i, CBlastDeflineUtil::leaf_node_common_names, CBlastDeflineUtil::leaf_node_scientific_names, CBlastDeflineUtil::leaf_node_tax_ids, CBlastDeflineUtil::links, m_BlastDb, m_Out, m_ReplTypes, m_Seperators, CBlastDeflineUtil::membership, NCBI_THROW, NStr::NumericToString(), CBlastDeflineUtil::pig, CBlastDeflineUtil::scientific_name, CBlastDeflineUtil::seq_id, CBlastDeflineUtil::super_kingdom, CBlastDeflineUtil::tax_id, and CBlastDeflineUtil::title.
Referenced by Write().
|
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().
|
private |
Definition at line 120 of file seq_formatter.hpp.
Referenced by CBlastDB_SeqFormatter(), Write(), and x_DataRequired().
|
private |
The output format specification.
Definition at line 112 of file seq_formatter.hpp.
Referenced by CBlastDB_SeqFormatter().
|
private |
Definition at line 119 of file seq_formatter.hpp.
Referenced by Write(), and x_DataRequired().
|
private |
Bit Mask for other fields.
Definition at line 122 of file seq_formatter.hpp.
Referenced by Write(), and x_DataRequired().
|
private |
Stream to write output.
Definition at line 110 of file seq_formatter.hpp.
|
private |
Vector of convertor objects.
Definition at line 118 of file seq_formatter.hpp.
Referenced by CBlastDB_SeqFormatter(), x_DataRequired(), and x_Print().
|
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().