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

Search Toolkit Book for CMaskWriter

A base class for winmasker output writers. More...

#include <objtools/seqmasks_io/mask_writer.hpp>

+ Inheritance diagram for CMaskWriter:

Public Types

typedef pair< TSeqPos, TSeqPosTMaskedInterval
 Type representing a masked interval within a sequence. More...
 
typedef vector< TMaskedIntervalTMaskList
 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

CNcbiOstreamos
 the standard C++ ostream object More...
 

Detailed Description

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.

Member Typedef Documentation

◆ 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.

◆ TMaskList

A type representing the total of masking information about a sequence.

Definition at line 85 of file mask_writer.hpp.

Constructor & Destructor Documentation

◆ CMaskWriter()

CMaskWriter::CMaskWriter ( CNcbiOstream arg_os)
inline

Object constructor.

Parameters
arg_osthe ostream object used to output masked sequences

Definition at line 62 of file mask_writer.hpp.

◆ ~CMaskWriter()

virtual CMaskWriter::~CMaskWriter ( )
inlinevirtual

Object destructor.

Definition at line 68 of file mask_writer.hpp.

Member Function Documentation

◆ IdToString()

string CMaskWriter::IdToString ( objects::CBioseq_Handle &  bsh,
bool  parsed_id 
)
protectedvirtual

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.

Parameters
bshthe bioseq handle
parsed_idbioseq 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().

◆ Print()

virtual void CMaskWriter::Print ( objects::CBioseq_Handle &  bsh,
const TMaskList mask,
bool  parsed_id = false 
)
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.

Parameters
bshthe bioseq handle
maskthe resulting list of masked intervals
parsed_idbioseq id was parsed by CMaskReader.

Implemented in CMaskWriterTabular, CMaskWriterSeqLoc, CMaskWriterInt, CMaskWriterFasta, and CMaskWriterBlastDbMaskInfo.

Referenced by CWinMaskApplication::Run().

◆ PrintId()

void CMaskWriter::PrintId ( objects::CBioseq_Handle &  bsh,
bool  parsed_id 
)
protectedvirtual

Output of the sequence id.

Parameters
bshthe bioseq handle
parsed_idbioseq 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().

Member Data Documentation

◆ os

CNcbiOstream& CMaskWriter::os
protected

The documentation for this class was generated from the following files:
Modified on Thu Apr 25 08:17:11 2024 by modify_doxy.py rev. 669887