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

Search Toolkit Book for CMultiAlnPrinter

Printer for popular multiple alignmnet formats. More...

#include <objtools/align_format/aln_printer.hpp>

+ Collaboration diagram for CMultiAlnPrinter:

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...
 
CMultiAlnPrinteroperator= (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< CAlnVecm_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...
 

Detailed Description

Printer for popular multiple alignmnet formats.

Definition at line 50 of file aln_printer.hpp.

Member Enumeration Documentation

◆ EAlignType

Alignment display type for showing nucleotice or protein-related information.

Enumerator
eNotSet 
eNucleotide 
eProtein 

Definition at line 56 of file aln_printer.hpp.

◆ EFormat

Multiple alignmnet text formats.

Enumerator
eFastaPlusGaps 
eClustal 
ePhylipSequential 
ePhylipInterleaved 
eNexus 
ePhylip 

Definition at line 63 of file aln_printer.hpp.

Constructor & Destructor Documentation

◆ CMultiAlnPrinter() [1/2]

CMultiAlnPrinter::CMultiAlnPrinter ( const CSeq_align seqalign,
CScope scope,
CMultiAlnPrinter::EAlignType  type = eNotSet 
)

Constructor.

Parameters
seqalignAlignment
scopeScope

Definition at line 94 of file aln_printer.cpp.

References CSeq_data_Base::e_Ncbieaa, m_AlnVec, CAlnVec::SetAaCoding(), CAlnVec::SetEndChar(), and CAlnVec::SetGapChar().

◆ CMultiAlnPrinter() [2/2]

CMultiAlnPrinter::CMultiAlnPrinter ( const CMultiAlnPrinter p)
protected

Forbid copy constructor.

Member Function Documentation

◆ operator=()

CMultiAlnPrinter& CMultiAlnPrinter::operator= ( const CMultiAlnPrinter p)
protected

Forbid assignment operator.

◆ Print()

void CMultiAlnPrinter::Print ( CNcbiOstream ostr)

◆ SetEndGapChar()

void CMultiAlnPrinter::SetEndGapChar ( unsigned char  gap)
inline

Set end gap character.

Parameters
Endgap character

Definition at line 99 of file aln_printer.hpp.

Referenced by CMultiApplication::Run().

◆ SetFormat()

void CMultiAlnPrinter::SetFormat ( EFormat  format)
inline

Set format for printing alignment.

Parameters
formatFormat

Definition at line 89 of file aln_printer.hpp.

References format.

Referenced by CAlnPrinterFixture::PrintAlignment(), and CMultiApplication::Run().

◆ SetGapChar()

void CMultiAlnPrinter::SetGapChar ( unsigned char  gap)
inline

Set gap character.

Parameters
gapGap character

Definition at line 94 of file aln_printer.hpp.

Referenced by CMultiApplication::Run().

◆ SetWidth()

void CMultiAlnPrinter::SetWidth ( int  width)
inline

Set text width (number of columns) for alignment output.

Parameters
widthWidth

Definition at line 84 of file aln_printer.hpp.

Referenced by CAlnPrinterFixture::PrintAlignment(), and CMultiApplication::Run().

◆ x_PrintClustal()

void CMultiAlnPrinter::x_PrintClustal ( CNcbiOstream ostr)
protected

Print alignment in ClustalW format.

Parameters
ostrOutput stream

Definition at line 188 of file aln_printer.cpp.

References CAlnVecPrinter::ClustalStyle(), m_AlnVec, and m_Width.

Referenced by Print().

◆ x_PrintFastaPlusGaps()

void CMultiAlnPrinter::x_PrintFastaPlusGaps ( CNcbiOstream ostr)
protected

◆ x_PrintNexus()

void CMultiAlnPrinter::x_PrintNexus ( CNcbiOstream ostr)
protected

Print alignment in Nexus format.

Parameters
ostrOutput 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().

◆ x_PrintPhylipInterleaved()

void CMultiAlnPrinter::x_PrintPhylipInterleaved ( CNcbiOstream ostr)
protected

Print alignment in Phylip format with interleaved sequences.

Parameters
ostrOutput 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().

◆ x_PrintPhylipSequential()

void CMultiAlnPrinter::x_PrintPhylipSequential ( CNcbiOstream ostr)
protected

Print alignment in Phylip format with sequetial sequences.

Parameters
ostrOutput 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().

Member Data Documentation

◆ m_AlignType

EAlignType CMultiAlnPrinter::m_AlignType
protected

Alignment type.

Definition at line 140 of file aln_printer.hpp.

Referenced by x_PrintNexus().

◆ m_AlnVec

CRef<CAlnVec> CMultiAlnPrinter::m_AlnVec
protected

◆ m_Format

EFormat CMultiAlnPrinter::m_Format
protected

Selected alignment format.

Definition at line 143 of file aln_printer.hpp.

Referenced by Print().

◆ m_Width

int CMultiAlnPrinter::m_Width
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().


The documentation for this class was generated from the following files:
Modified on Mon Jul 22 05:08:13 2024 by modify_doxy.py rev. 669887