NCBI C++ ToolKit
|
Search Toolkit Book for CMultiAlnPrinter
Printer for popular multiple alignmnet formats. More...
#include <objtools/align_format/aln_printer.hpp>
Public Types | |
enum | EAlignType { eNotSet = 0 , eNucleotide , eProtein } |
Alignment display type for showing nucleotice or protein-related information. More... | |
enum | EFormat { eFastaPlusGaps = 0 , eClustal , ePhylipSequential , ePhylipInterleaved , eNexus , ePhylip = ePhylipInterleaved } |
Multiple alignmnet text formats. More... | |
Public Member Functions | |
CMultiAlnPrinter (const CSeq_align &seqalign, CScope &scope, EAlignType type=eNotSet) | |
Constructor. More... | |
void | SetWidth (int width) |
Set text width (number of columns) for alignment output. More... | |
void | SetFormat (EFormat format) |
Set format for printing alignment. More... | |
void | SetGapChar (unsigned char gap) |
Set gap character. More... | |
void | SetEndGapChar (unsigned char gap) |
Set end gap character. More... | |
void | Print (CNcbiOstream &ostr) |
Print alignment. More... | |
Protected Member Functions | |
CMultiAlnPrinter (const CMultiAlnPrinter &p) | |
Forbid copy constructor. More... | |
CMultiAlnPrinter & | operator= (const CMultiAlnPrinter &p) |
Forbid assignment operator. More... | |
void | x_PrintFastaPlusGaps (CNcbiOstream &ostr) |
Print alignment in fasta + gaps format. More... | |
void | x_PrintClustal (CNcbiOstream &ostr) |
Print alignment in ClustalW format. More... | |
void | x_PrintPhylipSequential (CNcbiOstream &ostr) |
Print alignment in Phylip format with sequetial sequences. More... | |
void | x_PrintPhylipInterleaved (CNcbiOstream &ostr) |
Print alignment in Phylip format with interleaved sequences. More... | |
void | x_PrintNexus (CNcbiOstream &ostr) |
Print alignment in Nexus format. More... | |
Protected Attributes | |
CRef< CAlnVec > | m_AlnVec |
Alignment manager. More... | |
EAlignType | m_AlignType |
Alignment type. More... | |
EFormat | m_Format |
Selected alignment format. More... | |
int | m_Width |
Selected width of the text field. More... | |
Printer for popular multiple alignmnet formats.
Definition at line 50 of file aln_printer.hpp.
Alignment display type for showing nucleotice or protein-related information.
Enumerator | |
---|---|
eNotSet | |
eNucleotide | |
eProtein |
Definition at line 56 of file aln_printer.hpp.
Multiple alignmnet text formats.
Enumerator | |
---|---|
eFastaPlusGaps | |
eClustal | |
ePhylipSequential | |
ePhylipInterleaved | |
eNexus | |
ePhylip |
Definition at line 63 of file aln_printer.hpp.
CMultiAlnPrinter::CMultiAlnPrinter | ( | const CSeq_align & | seqalign, |
CScope & | scope, | ||
CMultiAlnPrinter::EAlignType | type = eNotSet |
||
) |
Constructor.
seqalign | Alignment |
scope | Scope |
Definition at line 94 of file aln_printer.cpp.
References CSeq_data_Base::e_Ncbieaa, m_AlnVec, CAlnVec::SetAaCoding(), CAlnVec::SetEndChar(), and CAlnVec::SetGapChar().
|
protected |
Forbid copy constructor.
|
protected |
Forbid assignment operator.
void CMultiAlnPrinter::Print | ( | CNcbiOstream & | ostr | ) |
Print alignment.
ostr | Output stream |
Definition at line 109 of file aln_printer.cpp.
References eClustal, eFastaPlusGaps, eNexus, ePhylipInterleaved, ePhylipSequential, m_Format, x_PrintClustal(), x_PrintFastaPlusGaps(), x_PrintNexus(), x_PrintPhylipInterleaved(), and x_PrintPhylipSequential().
Referenced by CAlnPrinterFixture::PrintAlignment(), and CMultiApplication::Run().
|
inline |
Set end gap character.
End | gap character |
Definition at line 99 of file aln_printer.hpp.
Referenced by CMultiApplication::Run().
|
inline |
Set format for printing alignment.
format | Format |
Definition at line 89 of file aln_printer.hpp.
References format.
Referenced by CAlnPrinterFixture::PrintAlignment(), and CMultiApplication::Run().
|
inline |
Set gap character.
gap | Gap character |
Definition at line 94 of file aln_printer.hpp.
Referenced by CMultiApplication::Run().
|
inline |
Set text width (number of columns) for alignment output.
width | Width |
Definition at line 84 of file aln_printer.hpp.
Referenced by CAlnPrinterFixture::PrintAlignment(), and CMultiApplication::Run().
|
protected |
Print alignment in ClustalW format.
ostr | Output stream |
Definition at line 188 of file aln_printer.cpp.
References CAlnVecPrinter::ClustalStyle(), m_AlnVec, and m_Width.
Referenced by Print().
|
protected |
Print alignment in fasta + gaps format.
ostr | Output stream |
Definition at line 135 of file aln_printer.cpp.
References CSeq_id::AsFastaString(), CSeq_id::eContent, CScope::eGetBioseq_All, CScope::GetBioseqHandle(), CBioseq_Handle::GetId(), CSeq_id_Base::GetLocal(), CAlnMap::GetNumRows(), CAlnVec::GetScope(), CAlnMap::GetSeqId(), CBioseq_Handle::GetSeqId(), CAlnVec::GetWholeAlnSeqString(), i, int, CObject_id_Base::IsId(), CSeq_id_Base::IsLocal(), ITERATE, label, m_AlnVec, m_Width, NcbiEndl, and s_GetTitle().
Referenced by Print().
|
protected |
Print alignment in Nexus format.
ostr | Output stream |
Definition at line 293 of file aln_printer.cpp.
References eNotSet, eNucleotide, CAlnVec::GetAlnSeqString(), CAlnMap::GetAlnStop(), CAlnVec::GetGapChar(), CAlnMap::GetNumRows(), CAlnMap::GetSeqId(), CSeq_id::GetSeqIdString(), i, m_AlignType, m_AlnVec, m_Width, min(), NCBI_THROW, and NcbiEndl.
Referenced by Print().
|
protected |
Print alignment in Phylip format with interleaved sequences.
ostr | Output stream |
Definition at line 243 of file aln_printer.cpp.
References CScope::eGetBioseq_All, CAlnVec::GetAlnSeqString(), CAlnMap::GetAlnStop(), CScope::GetBioseqHandle(), CAlnMap::GetNumRows(), CAlnVec::GetScope(), CAlnMap::GetSeqId(), i, m_AlnVec, m_Width, min(), NcbiEndl, s_GetLabel(), and s_ReplaceNonAlphaNum().
Referenced by Print().
|
protected |
Print alignment in Phylip format with sequetial sequences.
ostr | Output stream |
Definition at line 195 of file aln_printer.cpp.
References CScope::eGetBioseq_All, CScope::GetBioseqHandle(), CAlnMap::GetNumRows(), CAlnVec::GetScope(), CAlnMap::GetSeqId(), CAlnVec::GetWholeAlnSeqString(), i, m_AlnVec, m_Width, NcbiEndl, s_GetLabel(), and s_ReplaceNonAlphaNum().
Referenced by Print().
|
protected |
Alignment manager.
Definition at line 137 of file aln_printer.hpp.
Referenced by CMultiAlnPrinter(), x_PrintClustal(), x_PrintFastaPlusGaps(), x_PrintNexus(), x_PrintPhylipInterleaved(), and x_PrintPhylipSequential().
|
protected |
|
protected |
Selected width of the text field.
Definition at line 146 of file aln_printer.hpp.
Referenced by x_PrintClustal(), x_PrintFastaPlusGaps(), x_PrintNexus(), x_PrintPhylipInterleaved(), and x_PrintPhylipSequential().