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

Search Toolkit Book for CSplignFormatter

#include <algo/align/splign/splign_formatter.hpp>

+ Inheritance diagram for CSplignFormatter:
+ Collaboration diagram for CSplignFormatter:

Public Types

enum  ETextFlags { eTF_None = 0 , eTF_NoExonScores = 0x0001 , eTF_UseFastaStyleIds = 0x0002 }
 
enum  EAsnFlags { eAF_Disc = 0x0000 , eAF_SplicedSegNoParts = 0x0001 , eAF_SplicedSegWithParts = 0x0003 , eAF_NoVersion = 0x0004 }
 
- 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

 CSplignFormatter (const CSplign::TResults &results)
 
 CSplignFormatter (const CSplign &splign)
 
void SetSeqIds (CConstRef< objects::CSeq_id > id1, CConstRef< objects::CSeq_id > id2)
 
string AsExonTable (const CSplign::TResults *results=0, int flags=eTF_None) const
 
string AsAlignmentText (CRef< objects::CScope > scope, const CSplign::TResults *results=0, size_t line_width=80, int segnum=-1) const
 Format alignment as plain text. More...
 
CRef< objects::CSeq_align_set > AsSeqAlignSet (const CSplign::TResults *results=0, int flags=eAF_SplicedSegWithParts) const
 Format alignment as a seq-align-set. More...
 
- 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

CRef< objects::CSeq_align > x_Compartment2SeqAlign (const vector< size_t > &boxes, const vector< string > &transcripts, const vector< float > &scores) const
 
void x_Exon2DS (const size_t *box, const string &trans, objects::CDense_seg *pds) const
 
void x_Init (void)
 

Private Attributes

const CSplign::TResults m_splign_results
 
CConstRef< objects::CSeq_id > m_QueryId
 
CConstRef< objects::CSeq_id > m_SubjId
 

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...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Definition at line 49 of file splign_formatter.hpp.

Member Enumeration Documentation

◆ EAsnFlags

Enumerator
eAF_Disc 
eAF_SplicedSegNoParts 
eAF_SplicedSegWithParts 
eAF_NoVersion 

Definition at line 66 of file splign_formatter.hpp.

◆ ETextFlags

Enumerator
eTF_None 
eTF_NoExonScores 
eTF_UseFastaStyleIds 

Definition at line 60 of file splign_formatter.hpp.

Constructor & Destructor Documentation

◆ CSplignFormatter() [1/2]

CSplignFormatter::CSplignFormatter ( const CSplign::TResults results)

Definition at line 70 of file splign_formatter.cpp.

References x_Init().

◆ CSplignFormatter() [2/2]

CSplignFormatter::CSplignFormatter ( const CSplign splign)

Definition at line 77 of file splign_formatter.cpp.

References x_Init().

Member Function Documentation

◆ AsAlignmentText()

string CSplignFormatter::AsAlignmentText ( CRef< objects::CScope >  scope,
const CSplign::TResults results = 0,
size_t  line_width = 80,
int  segnum = -1 
) const

Format alignment as plain text.

Parameters
scopeSource for sequence data.
resultsSplign results for formatting. If not specified, the results will be read from the object used to construct the formatter.
line_widthThe maximum number of alignment chars per line.
segnumThe segment to print in each compartment, or -1 to print all segments.
Returns
Formatted alignment.

Definition at line 222 of file splign_formatter.cpp.

References CSeqVector::begin(), D, CBioseq_Handle::eCoding_Iupac, CSeqVector::end(), CSplign::SAlignedCompartment::eStatus_Ok, CSeqVector::GetSeqData(), CBioseq_Handle::GetSeqVector(), CConstRef< C, Locker >::IsNull(), ITERATE, M, m_QueryId, m_splign_results, m_SubjId, results, and t.

Referenced by CSplignApp::x_ProcessPair().

◆ AsExonTable()

string CSplignFormatter::AsExonTable ( const CSplign::TResults results = 0,
int  flags = eTF_None 
) const

◆ AsSeqAlignSet()

CRef< CSeq_align_set > CSplignFormatter::AsSeqAlignSet ( const CSplign::TResults results = 0,
int  flags = eAF_SplicedSegWithParts 
) const

Format alignment as a seq-align-set.

Parameters
resultsSplign results for formatting. If not specified, the results will be read from the object used to construct the formatter.
flagsA bitwise combination of EAsnFlags.
Returns
Formatted alignment as a seq-align-set reference.

Definition at line 621 of file splign_formatter.cpp.

References CUtf8::AsUTF8(), Convert(), copy(), count, CreateSplicedExonChunk(), data, eAF_NoVersion, eEncoding_UTF8, eNa_strand_minus, eNa_strand_plus, CSpliced_seg_Base::eProduct_type_transcript, CSplign::SAlignedCompartment::eStatus_Ok, CSeq_align_Base::eType_global, CVersionAPI::fVersionInfo, CConstRef< C, Locker >::GetNonNullPointer(), i, ITERATE, CNWFormatter::SSegment::m_annot, CNWFormatter::SSegment::m_box, CNWFormatter::SSegment::m_details, CNWFormatter::SSegment::m_exon, CNWFormatter::SSegment::m_idty, m_QueryId, CNWFormatter::SSegment::m_score, m_splign_results, m_SubjId, NCBI_THROW, PIsSpace(), Print(), remove_if(), results, CSplign::s_GetVersion(), CSeq_align_set_Base::Set(), CUser_field_Base::SetData(), CUser_object_Base::SetData(), CSeq_align_Base::SetDim(), CSpliced_seg_Base::SetExons(), CSeq_align_Base::SetExt(), CSpliced_seg_Base::SetGenomic_id(), CSpliced_seg_Base::SetGenomic_strand(), CUser_field_Base::SetLabel(), CSpliced_seg_Base::SetPoly_a(), CSpliced_seg_Base::SetProduct_id(), CSpliced_seg_Base::SetProduct_length(), CSpliced_seg_Base::SetProduct_strand(), CSpliced_seg_Base::SetProduct_type(), CSeq_align_Base::SetSegs(), CObject_id_Base::SetStr(), CUser_object_Base::SetType(), CSeq_align_Base::SetType(), and x_Compartment2SeqAlign().

Referenced by BOOST_AUTO_TEST_CASE(), CSplignSimple::GetResultsAsAln(), CAdvancedAlignCleanup::RunSplignOnCompartment(), CSplignJob::x_CreateProjectItems(), and CSplignApp::x_ProcessPair().

◆ SetSeqIds()

void CSplignFormatter::SetSeqIds ( CConstRef< objects::CSeq_id >  id1,
CConstRef< objects::CSeq_id >  id2 
)

◆ x_Compartment2SeqAlign()

CRef< CSeq_align > CSplignFormatter::x_Compartment2SeqAlign ( const vector< size_t > &  boxes,
const vector< string > &  transcripts,
const vector< float > &  scores 
) const
private

Definition at line 526 of file splign_formatter.cpp.

Referenced by AsSeqAlignSet().

◆ x_Exon2DS()

void CSplignFormatter::x_Exon2DS ( const size_t *  box,
const string trans,
objects::CDense_seg *  pds 
) const
private

◆ x_Init()

void CSplignFormatter::x_Init ( void  )
private

Definition at line 84 of file splign_formatter.cpp.

References m_QueryId, and m_SubjId.

Referenced by CSplignFormatter().

Member Data Documentation

◆ m_QueryId

CConstRef<objects::CSeq_id> CSplignFormatter::m_QueryId
private

Definition at line 114 of file splign_formatter.hpp.

Referenced by AsAlignmentText(), AsExonTable(), AsSeqAlignSet(), SetSeqIds(), and x_Init().

◆ m_splign_results

const CSplign::TResults CSplignFormatter::m_splign_results
private

Definition at line 112 of file splign_formatter.hpp.

Referenced by AsAlignmentText(), AsExonTable(), and AsSeqAlignSet().

◆ m_SubjId

CConstRef<objects::CSeq_id> CSplignFormatter::m_SubjId
private

Definition at line 114 of file splign_formatter.hpp.

Referenced by AsAlignmentText(), AsExonTable(), AsSeqAlignSet(), SetSeqIds(), and x_Init().


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