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

Search Toolkit Book for CVcfWriter

#include <objtools/writers/vcf_writer.hpp>

+ Inheritance diagram for CVcfWriter:
+ Collaboration diagram for CVcfWriter:

Public Types

enum  TFlags { fNormal = 0 }
 
- 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...
 

Public Member Functions

 CVcfWriter (CScope &, CNcbiOstream &, TFlags=fNormal)
 
virtual ~CVcfWriter ()
 
bool WriteAnnot (const CSeq_annot &, const string &="", const string &="") override
 Write a raw Seq-annot to the internal output stream. More...
 
virtual SAnnotSelectorSetAnnotSelector (void) override
 
- 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)
 
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 ()
 
- Public Member Functions inherited from CFeatWriter
virtual ~CFeatWriter (void)=default
 
bool WriteFeatures (CFeat_CI &first)
 

Protected Member Functions

void x_GetTypeRefAlt (const CVariation_inst &inst, int &rtype, string &ref, list< int > &alt_types, vector< string > &alt)
 
bool x_WriteInit (const CSeq_annot &)
 
bool x_WriteMeta (const CSeq_annot &)
 
bool x_WriteHeader (const CSeq_annot &)
 
bool x_WriteData (const CSeq_annot &)
 
bool x_WriteMetaCreateNew (const CSeq_annot &)
 
bool xWriteFeature (CFeat_CI feat_it) override
 
bool x_WriteFeature (const CMappedFeat &)
 
bool x_WriteFeatureChrom (const CMappedFeat &)
 
bool x_WriteFeaturePos (const CMappedFeat &, unsigned int start, const int type)
 
bool x_WriteFeatureId (const CMappedFeat &)
 
bool x_WriteFeatureRef (const unsigned int start, const int type, const string &anchor, const string &ref)
 
bool x_WriteFeatureAlt (const unsigned int start, const int type, const string &anchor, const list< int > &alt_types, const vector< string > &alt)
 
bool x_WriteFeatureQual (const CMappedFeat &)
 
bool x_WriteFeatureFilter (const CMappedFeat &)
 
bool x_WriteFeatureInfo (const CMappedFeat &)
 
bool x_WriteFeatureGenotypeData (const CMappedFeat &)
 
- 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
 
vector< stringm_GenotypeHeaders
 
- 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

- 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

Definition at line 43 of file vcf_writer.hpp.

Member Enumeration Documentation

◆ TFlags

Enumerator
fNormal 

Definition at line 48 of file vcf_writer.hpp.

Constructor & Destructor Documentation

◆ CVcfWriter()

CVcfWriter::CVcfWriter ( CScope scope,
CNcbiOstream ostr,
TFlags  uFlags = fNormal 
)

Definition at line 100 of file vcf_writer.cpp.

◆ ~CVcfWriter()

CVcfWriter::~CVcfWriter ( )
virtual

Definition at line 111 of file vcf_writer.cpp.

Member Function Documentation

◆ SetAnnotSelector()

SAnnotSelector & CVcfWriter::SetAnnotSelector ( void  )
overridevirtual

◆ WriteAnnot()

bool CVcfWriter::WriteAnnot ( const CSeq_annot ,
const string = "",
const string = "" 
)
overridevirtual

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

This implementation will just generate an error and then exit. It should be re-implemented in format specific subclasses.

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

Reimplemented from CWriterBase.

Definition at line 117 of file vcf_writer.cpp.

References CScope::AddSeq_annot(), CSerialObject::Assign(), ERR_POST, Error(), CVariationNormalization::eVCF, CScope::GetBioseqHandle(), CSeq_id::GetLabel(), CMappedFeat::GetLocation(), label, m_Scope, CVariationNormalization::NormalizeVariation(), SetAnnotSelector(), x_WriteData(), x_WriteHeader(), x_WriteInit(), and x_WriteMeta().

Referenced by sRunTest(), and sUpdateCase().

◆ x_GetTypeRefAlt()

void CVcfWriter::x_GetTypeRefAlt ( const CVariation_inst inst,
int rtype,
string ref,
list< int > &  alt_types,
vector< string > &  alt 
)
protected

◆ x_WriteData()

bool CVcfWriter::x_WriteData ( const CSeq_annot annot)
protected

◆ x_WriteFeature()

bool CVcfWriter::x_WriteFeature ( const CMappedFeat mf)
protected

◆ x_WriteFeatureAlt()

bool CVcfWriter::x_WriteFeatureAlt ( const unsigned int  start,
const int  type,
const string anchor,
const list< int > &  alt_types,
const vector< string > &  alt 
)
protected

◆ x_WriteFeatureChrom()

bool CVcfWriter::x_WriteFeatureChrom ( const CMappedFeat mf)
protected

◆ x_WriteFeatureFilter()

bool CVcfWriter::x_WriteFeatureFilter ( const CMappedFeat mf)
protected

◆ x_WriteFeatureGenotypeData()

bool CVcfWriter::x_WriteFeatureGenotypeData ( const CMappedFeat mf)
protected

◆ x_WriteFeatureId()

bool CVcfWriter::x_WriteFeatureId ( const CMappedFeat mf)
protected

◆ x_WriteFeatureInfo()

bool CVcfWriter::x_WriteFeatureInfo ( const CMappedFeat mf)
protected

Definition at line 715 of file vcf_writer.cpp.

References CDbtag_Base::CanGetTag(), NStr::DoubleToString(), CDbtag::eDbtagType_BioProject, NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, CVariantProperties_Base::GetAllele_frequency(), CUser_field_Base::GetData(), CSeq_feat_Handle::GetData(), CDbtag_Base::GetDb(), CSeq_feat_Handle::GetDbxref(), CVariantProperties_Base::GetEffect(), CSeq_feat_Handle::GetExt(), CUser_object::GetField(), CVariantProperties_Base::GetFrequency_based_validation(), CVariantProperties_Base::GetGene_location(), CVariantProperties_Base::GetGenotype(), CObject_id_Base::GetId(), CVariation_ref_Base::GetId(), CVariation_ref_Base::GetOther_ids(), CVariantProperties_Base::GetQuality_check(), CVariantProperties_Base::GetResource_link(), CObject_id_Base::GetStr(), CUser_field_Base::C_Data::GetStr(), CDbtag_Base::GetTag(), CDbtag::GetType(), CUser_object_Base::GetType(), CVariation_ref_Base::GetVariant_prop(), CSeqFeatData_Base::GetVariation(), gt, CUser_object::HasField(), info, NStr::IntToString(), CObject_id_Base::IsId(), CVariantProperties_Base::IsSetAllele_frequency(), CDbtag_Base::IsSetDb(), CSeq_feat_Handle::IsSetDbxref(), CVariantProperties_Base::IsSetEffect(), CSeq_feat_Handle::IsSetExt(), CVariantProperties_Base::IsSetFrequency_based_validation(), CVariantProperties_Base::IsSetGene_location(), CVariantProperties_Base::IsSetGenotype(), CVariation_ref_Base::IsSetId(), CVariation_ref_Base::IsSetOther_ids(), CVariantProperties_Base::IsSetQuality_check(), CVariantProperties_Base::IsSetResource_link(), CDbtag_Base::IsSetTag(), CUser_object_Base::IsSetType(), CVariation_ref_Base::IsSetVariant_prop(), CObject_id_Base::IsStr(), NStr::Join(), CWriterBase::m_Os, NStr::Split(), NStr::ToLower(), and rapidjson::value.

Referenced by x_WriteFeature().

◆ x_WriteFeaturePos()

bool CVcfWriter::x_WriteFeaturePos ( const CMappedFeat mf,
unsigned int  start,
const int  type 
)
protected

◆ x_WriteFeatureQual()

bool CVcfWriter::x_WriteFeatureQual ( const CMappedFeat mf)
protected

◆ x_WriteFeatureRef()

bool CVcfWriter::x_WriteFeatureRef ( const unsigned int  start,
const int  type,
const string anchor,
const string ref 
)
protected

◆ x_WriteHeader()

bool CVcfWriter::x_WriteHeader ( const CSeq_annot annot)
protected

Definition at line 254 of file vcf_writer.cpp.

References m_GenotypeHeaders, CWriterBase::m_Os, and s_GetVcfMetaInfo().

Referenced by WriteAnnot().

◆ x_WriteInit()

bool CVcfWriter::x_WriteInit ( const CSeq_annot annot)
protected

◆ x_WriteMeta()

bool CVcfWriter::x_WriteMeta ( const CSeq_annot annot)
protected

◆ x_WriteMetaCreateNew()

bool CVcfWriter::x_WriteMetaCreateNew ( const CSeq_annot annot)
protected

◆ xWriteFeature()

bool CVcfWriter::xWriteFeature ( CFeat_CI  feat_it)
overrideprotectedvirtual

Reimplemented from CFeatWriter.

Definition at line 347 of file vcf_writer.cpp.

References x_WriteFeature().

Member Data Documentation

◆ m_GenotypeHeaders

vector<string> CVcfWriter::m_GenotypeHeaders
protected

Definition at line 128 of file vcf_writer.hpp.

Referenced by x_WriteFeatureGenotypeData(), x_WriteHeader(), and x_WriteInit().

◆ m_Scope

CScope& CVcfWriter::m_Scope
protected

Definition at line 127 of file vcf_writer.hpp.

Referenced by WriteAnnot(), x_WriteData(), and x_WriteFeature().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:28 2024 by modify_doxy.py rev. 669887