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

Search Toolkit Book for CBedGraphWriter

CWriterBase implementation that will render given Genbank objects in the BED file format (http://http://genome.ucsc.edu/FAQ/FAQformat#format1). More...

#include <objtools/writers/bedgraph_writer.hpp>

+ Inheritance diagram for CBedGraphWriter:
+ Collaboration diagram for CBedGraphWriter:

Public Member Functions

 CBedGraphWriter (CScope &scope, CNcbiOstream &ostr, unsigned int colCount=12, unsigned int flags=fNormal)
 Constructor. More...
 
virtual ~CBedGraphWriter ()
 
bool WriteAnnot (const CSeq_annot &, const string &="", const string &="")
 Write a raw Seq-annot to the internal output stream. More...
 
- Public Member Functions inherited from CWriterBase
virtual ~CWriterBase ()
 
virtual bool WriteAlign (const CSeq_align &, const string &="", const string &="")
 Write a raw Seq-align to the internal output stream. More...
 
virtual bool WriteSeqEntryHandle (CSeq_entry_Handle, const string &="", const string &="")
 Write a Seq-entry handle to the internal output stream. More...
 
virtual bool WriteBioseqHandle (CBioseq_Handle, const string &="", const string &="")
 Write a Bioseq handle to the internal output stream. More...
 
virtual bool WriteSeqAnnotHandle (CSeq_annot_Handle, const string &="", const string &="")
 Write a Seq-annot handle to the internal output stream. More...
 
virtual bool WriteHeader ()
 Write a file header. More...
 
virtual bool WriteHeader (const CSeq_annot &)
 Write a file header, using annotation information. More...
 
virtual bool WriteFooter ()
 Write a file trailer. More...
 
void SetMessageListener (CWriterListener *pMessageListener)
 
virtual void PutMessage (const CWriterMessage &message)
 
virtual SAnnotSelectorSetAnnotSelector (void)
 
SAnnotSelectorGetAnnotSelector (void)
 
virtual CRange< TSeqPos > & SetRange (void)
 
virtual const CRange< TSeqPos > & GetRange (void) const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 
- Public Member Functions inherited from CInterruptable
 CInterruptable ()
 
virtual ~CInterruptable ()
 
void SetCanceler (ICanceled *pCanceller)
 
bool IsCanceled () const
 
- Public Member Functions inherited from ICanceled
virtual ~ICanceled ()
 

Protected Member Functions

bool xWriteAnnotGraphs (const CBedTrackRecord &, const CSeq_annot &)
 
bool xWriteSingleGraph (const CBedTrackRecord &, const CSeq_graph &)
 
bool xWriteSingleGraphInt (const CBedTrackRecord &, const CSeq_graph &)
 
bool xWriteSingleGraphReal (const CBedTrackRecord &, const CSeq_graph &)
 
bool xWriteSingleGraphByte (const CBedTrackRecord &, const CSeq_graph &)
 
bool xWriteAnnotFeatureTable (const CBedTrackRecord &, const CSeq_annot &)
 
bool xWriteSingleFeature (const CBedTrackRecord &, const CSeq_feat &)
 
bool xWriteAnnotSeqTable (const CBedTrackRecord &, const CSeq_annot &)
 
- Protected Member Functions inherited from CWriterBase
 CWriterBase (CNcbiOstream &ostr, unsigned int uFlags=0)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

CScopem_Scope
 
unsigned int m_colCount
 
- Protected Attributes inherited from CWriterBase
CNcbiOstreamm_Os
 
unsigned int m_uFlags
 
unique_ptr< SAnnotSelectorm_Selector
 
CRange< TSeqPosm_Range
 
CWriterListenermpMessageListener
 
- Protected Attributes inherited from CInterruptable
ICanceledmpCancelled
 

Additional Inherited Members

- Public Types inherited from CWriterBase
enum  TFlags { fNormal = 0 , fDebugOutput = (1<<0) , fWriterBaseLast = fDebugOutput }
 Customization flags that are relevant to all CWriterBase derived writers. More...
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Detailed Description

CWriterBase implementation that will render given Genbank objects in the BED file format (http://http://genome.ucsc.edu/FAQ/FAQformat#format1).

When assigned from typical Genbank annotations, only locations will be generated. Multi-interval Genbank features will be broken up into multiple single interval BED feature records. Block parameters could be used to encode multi-interval BED records but this is currently not supported. [[I will ad support though upon request]]

Definition at line 51 of file bedgraph_writer.hpp.

Constructor & Destructor Documentation

◆ CBedGraphWriter()

CBedGraphWriter::CBedGraphWriter ( CScope scope,
CNcbiOstream ostr,
unsigned int  colCount = 12,
unsigned int  flags = fNormal 
)

Constructor.

Parameters
scopescope to be used for ID reference resolution (it's OK to create one on the fly).
ostrstream objects should be written to.
colCountnumber of columns per output record. Each record in a BED file must have the same number of columns. Hence the writer will truncate or extend all records to colCount output columns.
flagsany output customization flags.

Definition at line 63 of file bedgraph_writer.cpp.

References m_colCount.

◆ ~CBedGraphWriter()

CBedGraphWriter::~CBedGraphWriter ( )
virtual

Definition at line 80 of file bedgraph_writer.cpp.

Member Function Documentation

◆ WriteAnnot()

bool CBedGraphWriter::WriteAnnot ( const CSeq_annot annot,
const string = "",
const string = "" 
)
virtual

Write a raw Seq-annot to the internal output stream.

The Seq-annot is expected to contain a feature table. If so, each feature will to formatted as a single BED record.

Parameters
annotthe Seq-annot object to be written.
nameparameter describing the object. Handling will be format specific
descrparameter describing the object. Handling will be format specific
Returns
true if the Seq-annot was processed. false if the Seq-annot did not contain a feature table.

Reimplemented from CWriterBase.

Definition at line 86 of file bedgraph_writer.cpp.

References CBedTrackRecord::Assign(), m_colCount, CWriterBase::m_Os, NCBI_THROW, CBedTrackRecord::Write(), xWriteAnnotFeatureTable(), xWriteAnnotGraphs(), and xWriteAnnotSeqTable().

Referenced by sRunTest(), and sUpdateCase().

◆ xWriteAnnotFeatureTable()

bool CBedGraphWriter::xWriteAnnotFeatureTable ( const CBedTrackRecord trackdata,
const CSeq_annot annot 
)
protected

◆ xWriteAnnotGraphs()

bool CBedGraphWriter::xWriteAnnotGraphs ( const CBedTrackRecord trackdata,
const CSeq_annot annot 
)
protected

◆ xWriteAnnotSeqTable()

bool CBedGraphWriter::xWriteAnnotSeqTable ( const CBedTrackRecord trackdata,
const CSeq_annot annot 
)
protected

◆ xWriteSingleFeature()

bool CBedGraphWriter::xWriteSingleFeature ( const CBedTrackRecord trackdata,
const CSeq_feat feature 
)
protected

◆ xWriteSingleGraph()

bool CBedGraphWriter::xWriteSingleGraph ( const CBedTrackRecord trackdata,
const CSeq_graph graph 
)
protected

◆ xWriteSingleGraphByte()

bool CBedGraphWriter::xWriteSingleGraphByte ( const CBedTrackRecord trackdata,
const CSeq_graph graph 
)
protected

◆ xWriteSingleGraphInt()

bool CBedGraphWriter::xWriteSingleGraphInt ( const CBedTrackRecord trackdata,
const CSeq_graph graph 
)
protected

◆ xWriteSingleGraphReal()

bool CBedGraphWriter::xWriteSingleGraphReal ( const CBedTrackRecord trackdata,
const CSeq_graph graph 
)
protected

Member Data Documentation

◆ m_colCount

unsigned int CBedGraphWriter::m_colCount
protected

Definition at line 131 of file bedgraph_writer.hpp.

Referenced by CBedGraphWriter(), and WriteAnnot().

◆ m_Scope

CScope& CBedGraphWriter::m_Scope
protected

Definition at line 130 of file bedgraph_writer.hpp.


The documentation for this class was generated from the following files:
Modified on Wed May 22 11:35:26 2024 by modify_doxy.py rev. 669887