NCBI C++ ToolKit
|
Search Toolkit Book for CSplignFormatter
#include <algo/align/splign/splign_formatter.hpp>
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 } |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
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... | |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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 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 void | EnableDebugDump (bool on) |
![]() | |
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... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 49 of file splign_formatter.hpp.
Enumerator | |
---|---|
eAF_Disc | |
eAF_SplicedSegNoParts | |
eAF_SplicedSegWithParts | |
eAF_NoVersion |
Definition at line 66 of file splign_formatter.hpp.
Enumerator | |
---|---|
eTF_None | |
eTF_NoExonScores | |
eTF_UseFastaStyleIds |
Definition at line 60 of file splign_formatter.hpp.
CSplignFormatter::CSplignFormatter | ( | const CSplign::TResults & | results | ) |
Definition at line 70 of file splign_formatter.cpp.
References x_Init().
Definition at line 77 of file splign_formatter.cpp.
References x_Init().
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.
scope | Source for sequence data. |
results | Splign results for formatting. If not specified, the results will be read from the object used to construct the formatter. |
line_width | The maximum number of alignment chars per line. |
segnum | The segment to print in each compartment, or -1 to print all segments. |
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().
string CSplignFormatter::AsExonTable | ( | const CSplign::TResults * | results = 0 , |
int | flags = eTF_None |
||
) | const |
Definition at line 100 of file splign_formatter.cpp.
References eTF_NoExonScores, eTF_UseFastaStyleIds, flags, i, ITERATE, CNWFormatter::SSegment::m_annot, CNWFormatter::SSegment::m_box, CNWFormatter::SSegment::m_details, CNWFormatter::SSegment::m_exon, CNWFormatter::SSegment::m_idty, CNWFormatter::SSegment::m_len, m_QueryId, CNWFormatter::SSegment::m_score, m_splign_results, m_SubjId, results, and CAlignShadow::s_RunLengthEncode().
Referenced by BOOST_AUTO_TEST_CASE(), and CSplignApp::x_ProcessPair().
CRef< CSeq_align_set > CSplignFormatter::AsSeqAlignSet | ( | const CSplign::TResults * | results = 0 , |
int | flags = eAF_SplicedSegWithParts |
||
) | const |
Format alignment as a seq-align-set.
results | Splign results for formatting. If not specified, the results will be read from the object used to construct the formatter. |
flags | A bitwise combination of EAsnFlags. |
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().
void CSplignFormatter::SetSeqIds | ( | CConstRef< objects::CSeq_id > | id1, |
CConstRef< objects::CSeq_id > | id2 | ||
) |
Definition at line 92 of file splign_formatter.cpp.
References m_QueryId, and m_SubjId.
Referenced by BOOST_AUTO_TEST_CASE(), CSplignSimple::GetResultsAsAln(), CAdvancedAlignCleanup::RunSplignOnCompartment(), CSplignJob::x_CreateProjectItems(), and CSplignApp::x_ProcessPair().
|
private |
Definition at line 526 of file splign_formatter.cpp.
Referenced by AsSeqAlignSet().
|
private |
|
private |
Definition at line 84 of file splign_formatter.cpp.
References m_QueryId, and m_SubjId.
Referenced by CSplignFormatter().
|
private |
Definition at line 114 of file splign_formatter.hpp.
Referenced by AsAlignmentText(), AsExonTable(), AsSeqAlignSet(), SetSeqIds(), and x_Init().
|
private |
Definition at line 112 of file splign_formatter.hpp.
Referenced by AsAlignmentText(), AsExonTable(), and AsSeqAlignSet().
|
private |
Definition at line 114 of file splign_formatter.hpp.
Referenced by AsAlignmentText(), AsExonTable(), AsSeqAlignSet(), SetSeqIds(), and x_Init().