NCBI C++ ToolKit
|
Search Toolkit Book for CMaskWriter
A base class for winmasker output writers. More...
#include <objtools/seqmasks_io/mask_writer.hpp>
Public Types | |
typedef pair< TSeqPos, TSeqPos > | TMaskedInterval |
Type representing a masked interval within a sequence. More... | |
typedef vector< TMaskedInterval > | TMaskList |
A type representing the total of masking information about a sequence. More... | |
Public Member Functions | |
CMaskWriter (CNcbiOstream &arg_os) | |
Object constructor. More... | |
virtual | ~CMaskWriter () |
Object destructor. More... | |
virtual void | Print (objects::CBioseq_Handle &bsh, const TMaskList &mask, bool parsed_id=false)=0 |
Output masked sequence data. More... | |
Protected Member Functions | |
virtual void | PrintId (objects::CBioseq_Handle &bsh, bool parsed_id) |
Output of the sequence id. More... | |
virtual string | IdToString (objects::CBioseq_Handle &bsh, bool parsed_id) |
Convert the sequence id to a string. More... | |
Protected Attributes | |
CNcbiOstream & | os |
the standard C++ ostream object More... | |
A base class for winmasker output writers.
This class provides support for the ability of winmasker to generate output in multiple formats. A derived class should be written for each supported format.
Definition at line 51 of file mask_writer.hpp.
typedef pair< TSeqPos, TSeqPos > CMaskWriter::TMaskedInterval |
Type representing a masked interval within a sequence.
If A is an object of type TMaskedInterval, then A.first is the offset (starting from 0) of the beginning of the interval; A.second is the offset of the end of the interval.
Definition at line 78 of file mask_writer.hpp.
typedef vector< TMaskedInterval > CMaskWriter::TMaskList |
A type representing the total of masking information about a sequence.
Definition at line 85 of file mask_writer.hpp.
|
inline |
Object constructor.
arg_os | the ostream object used to output masked sequences |
Definition at line 62 of file mask_writer.hpp.
|
inlinevirtual |
Object destructor.
Definition at line 68 of file mask_writer.hpp.
Convert the sequence id to a string.
By default prints id in fasta format but implementations can redefine it as necessary and use from within Print() method.
bsh | the bioseq handle |
parsed_id | bioseq id was parsed by CMaskReader. |
Definition at line 54 of file mask_writer.cpp.
References CSeq_id::eFormat_FastA, and CSeq_id::GetStringDescr().
Referenced by CMaskWriterTabular::Print(), and PrintId().
|
pure virtual |
Output masked sequence data.
Each implementation of this abstract method will recieve the original sequence and the list of masked intervals and is responsible to formatting it masked sequence and printing it using the ostream object passed to the writer at construction time.
bsh | the bioseq handle |
mask | the resulting list of masked intervals |
parsed_id | bioseq id was parsed by CMaskReader. |
Implemented in CMaskWriterTabular, CMaskWriterSeqLoc, CMaskWriterInt, CMaskWriterFasta, and CMaskWriterBlastDbMaskInfo.
Referenced by CWinMaskApplication::Run().
|
protectedvirtual |
Output of the sequence id.
bsh | the bioseq handle |
parsed_id | bioseq id was parsed by CMaskReader. |
Definition at line 49 of file mask_writer.cpp.
References IdToString(), and os.
Referenced by CMaskWriterFasta::Print(), and CMaskWriterInt::Print().
|
protected |
the standard C++ ostream object
Determines the destination of the output.
Definition at line 135 of file mask_writer.hpp.
Referenced by CMaskWriterBlastDbMaskInfo::Print(), CMaskWriterFasta::Print(), CMaskWriterInt::Print(), CMaskWriterSeqLoc::Print(), CMaskWriterTabular::Print(), PrintId(), CMaskWriterInt::PrintMasks(), and CMaskWriterBlastDbMaskInfo::~CMaskWriterBlastDbMaskInfo().