NCBI C++ ToolKit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CVCFVariantList Class Reference

Search Toolkit Book for CVCFVariantList

#include <gui/widgets/loaders/columnar_vcf_variants.hpp>

+ Inheritance diagram for CVCFVariantList:
+ Collaboration diagram for CVCFVariantList:

Public Member Functions

 CVCFVariantList (const string &chr_name, bool load_all_info=true, const set< string > &info_fields=set< string >(), const map< unsigned, string > &sample_cols=map< unsigned, string >())
 CVCFVariantList (const string &chr_name, const vector< char > &data)
 CVCFVariantList (const string &chr_name, const string &filename)
 CVCFVariantList (const vector< char > &data, const string &data_version)
 ~CVCFVariantList ()
void ParseLine (const string &line)
void FinalizeReading ()
virtual bool GetPositionsForVariant (const string &variant_id, vector< unsigned > &positions)
virtual void GetPositionsForMissingVarID (vector< unsigned > &positions)
const stringGetChrName () const
const vector< char > & GetSerializedData () const
void WriteSerializedData (const string &filename)
bool AreVariantIdsUnique (vector< pair< string, unsigned >> &copies)
void List (CNcbiOstream &out, bool only_sv_cols=false) const
void ListSamples (CNcbiOstream &out) const
vector< stringGetAllVariantIDS () const
bool operator== (const CVCFVariantList &other) const
 CVCFVariantList (const CVCFVariantList &)=delete
CVCFVariantListoperator= (const CVCFVariantList &)=delete
bool SerializeVariantData (const string &prefix, CNcbiOstream *out=nullptr)
bool DeserializeAndCheck (const string &prefix, CNcbiOstream *out=nullptr)
bool RemoveSerializedOutput (const string &prefix)
void GetStatistics (CNcbiOstream &out)
- Public Member Functions inherited from CVCFVariantsBase
virtual ~CVCFVariantsBase ()
const CVariantDescriptorsGetDescriptors () const
unsigned GetPositionForIndex (const size_t &index) const
size_t GetIndexForPosition (const unsigned &pos, CPosToIndex::EType type) const
TSeqPos GetStart () const
TSeqPos GetStop () const
unsigned Count () const
unsigned Count (const TSeqRange &range) const
void GetHistogram (svector &hist, const svector::size_type &bin_width) const
void GetHistogram (TIndexVector &hist, const svector::size_type &bin_width)
bool operator== (const CVCFVariantsBase &other) const
void ListPositionVectors (CNcbiOstream &out) const
TSeqPos GetLeftShiftedStartPos (const TSeqRange &range) const
const vector< size_t > * GetIncludedItems () const
unique_ptr< vector< size_t > > Filter (const TSeqRange &range) const
 CVCFVariantsBase (const CVCFVariantsBase &)=delete
CVCFVariantsBaseoperator= (const CVCFVariantsBase &)=delete
size_t GetNumberOfIndexVecs () const
const size_t & GetMaxIndex () const
const unsigned & GetMaxFeatLength () 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

Private Member Functions

string x_ParseNextColumn (string &line, size_t &pos)
string x_GetFilePrefix (const string &prefix) const

Private Attributes

string m_ChrName
size_t m_Index { 0 }

Additional Inherited Members

- Public Types inherited from CVCFVariantsBase
using TSparseStrVector = CVariantDescriptors::TSparseStrVector
using TSparseOptVector = CVariantDescriptors::TSparseOptVector
using TIndexVector = CPosToIndex::TIndexVector
using svector = CPosToIndex::svector
- 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 CVCFVariantsBase
static const vector< string > & s_GetColNames ()
 does not contain sm_INFO and sm_SAMPLES More...
static const vector< string > & s_GetAllColNames ()
 contains sm_INFO, sm_SAMPLES More...
static string s_GetPreviousVersion ()
static string s_GetCurrentVersion (bool format_only=false)
- 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 CVCFVariantsBase
static const string sm_MissingValue = "."
static const string sm_ID = "ID"
static const string sm_REF = "REF"
static const string sm_ALT = "ALT"
static const string sm_QUAL = "QUAL"
static const string sm_FILTER = "FILTER"
static const string sm_INFO = "INFO"
static const string sm_FORMAT = "FORMAT"
static const string sm_SAMPLES = "SAMPLES"
- 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...
- Protected Member Functions inherited from CVCFVariantsBase
 CVCFVariantsBase ()
 CVCFVariantsBase (bool load_info, const set< string > &info_fields, const map< unsigned, string > &sample_cols)
void x_SerializeData () const
void x_DeserializeAllData ()
void x_DeserializeIndexVectors (const unsigned char *&buf_ptr, size_t &nr_cols, bool skip_feat_length=false)
void x_DeserializeDescr_All (const unsigned char *buf_ptr, const size_t &nr_cols)
void x_DeserializeDescr_Range (const unsigned char *buf_ptr, const size_t &nr_cols, const TSeqRange *range=nullptr, const set< string > &cols_to_decode=set< string >(), bool only_start=false)
bool x_DeserializeColumn (const string &col_name, const unsigned char *buf_ptr, const size_t &nr_cols)
unique_ptr< vector< size_t > > x_Filter (const TSeqPos &pos) const
 Returns a vector of indices of the variants that cross sequence position 'pos'. More...
unique_ptr< vector< size_t > > x_NullOrFilterClinVar (const TSeqPos &pos) const
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
- Protected Attributes inherited from CVCFVariantsBase
CVariantDescriptors m_Descriptors
CPosToIndex m_Posindexmap
TSeqPos m_StartPos { 0 }
 in genomic coordinates (1-based) More...
TSeqPos m_StopPos { 0 }
 in genomic coordinates (1-based) More...
unsigned m_MaxFeatLength { 0 }
 maximum feature variant length More...
unique_ptr< vector< size_t > > m_VarsWithinRange
 variants included within a specific range More...
vector< char > * m_Buffer { nullptr }
bm::sparse_vector_deserializer< TSparseStrVectorm_Deserializer
bm::sparse_vector_deserializer< TSparseOptVectorm_OptDeserializer

Detailed Description

Definition at line 50 of file columnar_vcf_variants.hpp.

Constructor & Destructor Documentation

◆ CVCFVariantList() [1/5]

CVCFVariantList::CVCFVariantList ( const string chr_name,
bool  load_all_info = true,
const set< string > &  info_fields = set<string>(),
const map< unsigned, string > &  sample_cols = map<unsigned, string>() 

Definition at line 45 of file columnar_vcf_variants.cpp.

◆ CVCFVariantList() [2/5]

CVCFVariantList::CVCFVariantList ( const string chr_name,
const vector< char > &  data 

◆ CVCFVariantList() [3/5]

CVCFVariantList::CVCFVariantList ( const string chr_name,
const string filename 

◆ CVCFVariantList() [4/5]

CVCFVariantList::CVCFVariantList ( const vector< char > &  data,
const string data_version 

◆ ~CVCFVariantList()

CVCFVariantList::~CVCFVariantList ( )

Definition at line 176 of file columnar_vcf_variants.cpp.

References CVCFVariantsBase::m_Buffer.

◆ CVCFVariantList() [5/5]

CVCFVariantList::CVCFVariantList ( const CVCFVariantList )

Member Function Documentation

◆ AreVariantIdsUnique()

bool CVCFVariantList::AreVariantIdsUnique ( vector< pair< string, unsigned >> &  copies)

◆ DeserializeAndCheck()

bool CVCFVariantList::DeserializeAndCheck ( const string prefix,
CNcbiOstream out = nullptr 

◆ FinalizeReading()

void CVCFVariantList::FinalizeReading ( )

◆ GetAllVariantIDS()

vector< string > CVCFVariantList::GetAllVariantIDS ( ) const

Definition at line 416 of file columnar_vcf_variants.cpp.

◆ GetChrName()

const string& CVCFVariantList::GetChrName ( ) const

◆ GetPositionsForMissingVarID()

void CVCFVariantList::GetPositionsForMissingVarID ( vector< unsigned > &  positions)

◆ GetPositionsForVariant()

bool CVCFVariantList::GetPositionsForVariant ( const string variant_id,
vector< unsigned > &  positions 

◆ GetSerializedData()

const vector< char > & CVCFVariantList::GetSerializedData ( ) const

◆ GetStatistics()

void CVCFVariantList::GetStatistics ( CNcbiOstream out)

◆ List()

void CVCFVariantList::List ( CNcbiOstream out,
bool  only_sv_cols = false 
) const

Definition at line 387 of file columnar_vcf_variants.cpp.

References out().

◆ ListSamples()

void CVCFVariantList::ListSamples ( CNcbiOstream out) const

◆ operator=()

CVCFVariantList& CVCFVariantList::operator= ( const CVCFVariantList )

◆ operator==()

bool CVCFVariantList::operator== ( const CVCFVariantList other) const

◆ ParseLine()

void CVCFVariantList::ParseLine ( const string line)

◆ RemoveSerializedOutput()

bool CVCFVariantList::RemoveSerializedOutput ( const string prefix)

◆ SerializeVariantData()

bool CVCFVariantList::SerializeVariantData ( const string prefix,
CNcbiOstream out = nullptr 

◆ WriteSerializedData()

void CVCFVariantList::WriteSerializedData ( const string filename)

◆ x_GetFilePrefix()

string CVCFVariantList::x_GetFilePrefix ( const string prefix) const

Definition at line 575 of file columnar_vcf_variants.cpp.

References m_ChrName, and prefix.

Referenced by DeserializeAndCheck(), RemoveSerializedOutput(), and SerializeVariantData().

◆ x_ParseNextColumn()

string CVCFVariantList::x_ParseNextColumn ( string line,
size_t &  pos 

Definition at line 290 of file columnar_vcf_variants.cpp.

References NPOS, and CVCFVariantsBase::sm_MissingValue.

Referenced by ParseLine().

Member Data Documentation

◆ m_ChrName

string CVCFVariantList::m_ChrName

◆ m_Index

size_t CVCFVariantList::m_Index { 0 }

Definition at line 106 of file columnar_vcf_variants.hpp.

Referenced by CVCFVariantList(), FinalizeReading(), operator==(), and ParseLine().

The documentation for this class was generated from the following files:
Modified on Wed May 29 18:38:20 2024 by rev. 669887