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

Search Toolkit Book for CUpdateSeq_Input

Sets up the old and the update sequences, and generates the alignment between them. More...

#include <gui/packages/pkg_sequence_edit/update_seq_input.hpp>

+ Inheritance diagram for CUpdateSeq_Input:
+ Collaboration diagram for CUpdateSeq_Input:

Public Member Functions

 CUpdateSeq_Input (void)
 
 CUpdateSeq_Input (const objects::CBioseq_Handle &old_bsh, const objects::CBioseq_Handle &upd_bsh)
 
 ~CUpdateSeq_Input ()
 
const objects::CBioseq_Handle & GetOldBioseq (void) const
 
objects::CBioseq_Handle GetNCOldBioseq (void) const
 
const objects::CBioseq_Handle & GetUpdateBioseq (void) const
 
CConstRef< objects::CSeq_align > GetAlignment (void) const
 
void SetAlignment (const objects::CSeq_align *align)
 
bool SetOldBioseqAndScope (IWorkbench *workbench, const objects::CSeq_entry_Handle &tse)
 
bool SetOldBioseqAndScope (const objects::CBioseq_Handle &bsh)
 
bool SetUpdateBioseq (const objects::CBioseq_Handle &bsh)
 
bool ReadUpdateSequenceFromClipboard (objects::ILineErrorListener *msg_listener)
 Reads single update sequence from the clipboard. It supports FASTA and text ASN formats. More...
 
bool ReadSingleUpdateSequence (objects::ILineErrorListener *msg_listener)
 Reads (ASN.1 or FASTA) single update sequence from a file. More...
 
bool ReadSingleAccession (void)
 Reads single update sequence identified by an accession. More...
 
bool HaveIdenticalResidues (void) const
 
bool IsReadyForUpdate (void) const
 
bool UpdateSeqHasFeatures (void) const
 
bool OldSeqHasFeatures (void) const
 
bool OldSeqHasProteinFeats () const
 
void CalculateAlignmentForUnitTest (void)
 Calculates the alignment between the old and the update sequence, sets m_Align member. More...
 
unsigned int CountBioseqs ()
 
void ResetUpdateSequence ()
 
- 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
 

Static Public Member Functions

static CRef< objects::CSeq_annot > s_Align2IdenticalSeq (const objects::CBioseq_Handle &subject, const objects::CBioseq_Handle &query)
 
static void s_ConvertDeltaToRawEntry (objects::CSeq_entry &entry)
 Converts delta literals to raw sequence, applies only to NA sequences. More...
 
static void s_ConvertDeltaToRawBioseq (objects::CBioseq &bseq)
 
static bool s_IsGoodLiteral (const objects::CSeq_literal &lit)
 
static bool s_IsDeltaWithNoGaps (const objects::CBioseq &bseq)
 
static bool s_IsDeltaWithFarPointers (const objects::CBioseq &bseq)
 
static void s_FixCollidingIDs_Entry (objects::CSeq_entry &entry, const objects::CBioseq::TId &seq_ids)
 When the old and the update sequences have the same ID, the ID of the update sequence is modified. 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)
 

Private Member Functions

bool x_ReadFromStream (CNcbiIstream &istr, objects::ILineErrorListener *msg_listener)
 
bool x_ReadUpdateSeq_Fasta (CNcbiIstream &istr, objects::ILineErrorListener *msg_listener)
 
bool x_ReadUpdateSeq_ASN (CNcbiIstream &istr)
 
bool x_ReadAccession (const string &acc_id)
 
void x_FixCollidingIDs_Entry (objects::CSeq_entry &entry)
 
void x_FixCollidingIDs_Bioseq (objects::CBioseq &bioseq)
 
void x_AddNewEntryToScope (CRef< objects::CSeq_entry > entry)
 Function fixes colliding IDs, add the update entry to the scope and sets m_UpdSeq member. More...
 

Private Attributes

objects::CBioseq_Handle m_OldSeq
 
objects::CBioseq_Handle m_UpdSeq
 
CConstRef< objects::CSeq_align > m_Align
 
CRef< objects::CScope > m_Scope
 

Additional Inherited Members

- 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 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

Sets up the old and the update sequences, and generates the alignment between them.

Definition at line 51 of file update_seq_input.hpp.

Constructor & Destructor Documentation

◆ CUpdateSeq_Input() [1/2]

CUpdateSeq_Input::CUpdateSeq_Input ( void  )

Definition at line 65 of file update_seq_input.cpp.

◆ CUpdateSeq_Input() [2/2]

CUpdateSeq_Input::CUpdateSeq_Input ( const objects::CBioseq_Handle &  old_bsh,
const objects::CBioseq_Handle &  upd_bsh 
)

◆ ~CUpdateSeq_Input()

CUpdateSeq_Input::~CUpdateSeq_Input ( )

Definition at line 79 of file update_seq_input.cpp.

References m_UpdSeq.

Member Function Documentation

◆ CalculateAlignmentForUnitTest()

void CUpdateSeq_Input::CalculateAlignmentForUnitTest ( void  )

Calculates the alignment between the old and the update sequence, sets m_Align member.

To be used only in the unit tests

Definition at line 188 of file update_seq_input.cpp.

References _ASSERT, sequpd::CompareAlignments(), i, Info(), CConstRef< C, Locker >::IsNull(), LOG_POST, m_Align, m_OldSeq, m_UpdSeq, CConstRef< C, Locker >::Reset(), and sequpd::RunBlast2Seq().

Referenced by SetupForUpdate(), and CUpdateMultipleSeq_Input::x_CreateUpdateSeqInputForUnitTest().

◆ CountBioseqs()

unsigned int CUpdateSeq_Input::CountBioseqs ( )

◆ GetAlignment()

CConstRef<objects::CSeq_align> CUpdateSeq_Input::GetAlignment ( void  ) const
inline

◆ GetNCOldBioseq()

objects::CBioseq_Handle CUpdateSeq_Input::GetNCOldBioseq ( void  ) const
inline

Definition at line 59 of file update_seq_input.hpp.

References m_OldSeq.

◆ GetOldBioseq()

const objects::CBioseq_Handle& CUpdateSeq_Input::GetOldBioseq ( void  ) const
inline

◆ GetUpdateBioseq()

const objects::CBioseq_Handle& CUpdateSeq_Input::GetUpdateBioseq ( void  ) const
inline

◆ HaveIdenticalResidues()

bool CUpdateSeq_Input::HaveIdenticalResidues ( void  ) const

◆ IsReadyForUpdate()

bool CUpdateSeq_Input::IsReadyForUpdate ( void  ) const

◆ OldSeqHasFeatures()

bool CUpdateSeq_Input::OldSeqHasFeatures ( void  ) const

◆ OldSeqHasProteinFeats()

bool CUpdateSeq_Input::OldSeqHasProteinFeats ( ) const

Definition at line 242 of file update_seq_input.cpp.

References CSeq_inst_Base::eMol_aa, and m_OldSeq.

Referenced by CUpdateSeq_Dlg::OnUpdateSequence().

◆ ReadSingleAccession()

bool CUpdateSeq_Input::ReadSingleAccession ( void  )

Reads single update sequence identified by an accession.

Definition at line 584 of file update_seq_input.cpp.

References CLoadSeqFromEntrez_dlg::GetData(), NStr::IsBlank(), m_UpdSeq, NCBI_THROW, NULL, and x_ReadAccession().

Referenced by CSeqUpdateWorker::UpdateSingleSequence().

◆ ReadSingleUpdateSequence()

bool CUpdateSeq_Input::ReadSingleUpdateSequence ( objects::ILineErrorListener *  msg_listener)

◆ ReadUpdateSequenceFromClipboard()

bool CUpdateSeq_Input::ReadUpdateSequenceFromClipboard ( objects::ILineErrorListener *  msg_listener)

Reads single update sequence from the clipboard. It supports FASTA and text ASN formats.

Definition at line 313 of file update_seq_input.cpp.

References CSimpleClipboard::Get(), CSimpleClipboard::Instance(), m_UpdSeq, NCBI_THROW, and x_ReadFromStream().

Referenced by CSeqUpdateWorker::UpdateSingleSequence().

◆ ResetUpdateSequence()

void CUpdateSeq_Input::ResetUpdateSequence ( )

◆ s_Align2IdenticalSeq()

CRef< CSeq_annot > CUpdateSeq_Input::s_Align2IdenticalSeq ( const objects::CBioseq_Handle &  subject,
const objects::CBioseq_Handle &  query 
)
static

◆ s_ConvertDeltaToRawBioseq()

void CUpdateSeq_Input::s_ConvertDeltaToRawBioseq ( objects::CBioseq &  bseq)
static

◆ s_ConvertDeltaToRawEntry()

void CUpdateSeq_Input::s_ConvertDeltaToRawEntry ( objects::CSeq_entry &  entry)
static

◆ s_FixCollidingIDs_Entry()

void CUpdateSeq_Input::s_FixCollidingIDs_Entry ( objects::CSeq_entry &  entry,
const objects::CBioseq::TId &  seq_ids 
)
static

◆ s_IsDeltaWithFarPointers()

bool CUpdateSeq_Input::s_IsDeltaWithFarPointers ( const objects::CBioseq &  bseq)
static

◆ s_IsDeltaWithNoGaps()

bool CUpdateSeq_Input::s_IsDeltaWithNoGaps ( const objects::CBioseq &  bseq)
static

◆ s_IsGoodLiteral()

bool CUpdateSeq_Input::s_IsGoodLiteral ( const objects::CSeq_literal &  lit)
static

◆ SetAlignment()

void CUpdateSeq_Input::SetAlignment ( const objects::CSeq_align *  align)
inline

◆ SetOldBioseqAndScope() [1/2]

bool CUpdateSeq_Input::SetOldBioseqAndScope ( const objects::CBioseq_Handle &  bsh)

◆ SetOldBioseqAndScope() [2/2]

bool CUpdateSeq_Input::SetOldBioseqAndScope ( IWorkbench workbench,
const objects::CSeq_entry_Handle &  tse 
)

◆ SetUpdateBioseq()

bool CUpdateSeq_Input::SetUpdateBioseq ( const objects::CBioseq_Handle &  bsh)

Definition at line 170 of file update_seq_input.cpp.

References CRef< C, Locker >::GetNCPointer(), m_Scope, m_UpdSeq, and NCBI_THROW.

Referenced by SetupForUpdate().

◆ UpdateSeqHasFeatures()

bool CUpdateSeq_Input::UpdateSeqHasFeatures ( void  ) const

Definition at line 226 of file update_seq_input.cpp.

References m_UpdSeq.

Referenced by CUpdateSeqPanel::CreateControls(), and CUpdateSeqPanel::UpdatePanel().

◆ x_AddNewEntryToScope()

void CUpdateSeq_Input::x_AddNewEntryToScope ( CRef< objects::CSeq_entry >  entry)
private

Function fixes colliding IDs, add the update entry to the scope and sets m_UpdSeq member.

Definition at line 408 of file update_seq_input.cpp.

References CSeq_inst_Base::eMol_na, m_Scope, m_UpdSeq, CSeq_entry::Parentize(), and x_FixCollidingIDs_Entry().

Referenced by x_ReadUpdateSeq_ASN(), and x_ReadUpdateSeq_Fasta().

◆ x_FixCollidingIDs_Bioseq()

void CUpdateSeq_Input::x_FixCollidingIDs_Bioseq ( objects::CBioseq &  bioseq)
private

◆ x_FixCollidingIDs_Entry()

void CUpdateSeq_Input::x_FixCollidingIDs_Entry ( objects::CSeq_entry &  entry)
private

◆ x_ReadAccession()

bool CUpdateSeq_Input::x_ReadAccession ( const string acc_id)
private

◆ x_ReadFromStream()

bool CUpdateSeq_Input::x_ReadFromStream ( CNcbiIstream istr,
objects::ILineErrorListener *  msg_listener 
)
private

◆ x_ReadUpdateSeq_ASN()

bool CUpdateSeq_Input::x_ReadUpdateSeq_ASN ( CNcbiIstream istr)
private

◆ x_ReadUpdateSeq_Fasta()

bool CUpdateSeq_Input::x_ReadUpdateSeq_Fasta ( CNcbiIstream istr,
objects::ILineErrorListener *  msg_listener 
)
private

Member Data Documentation

◆ m_Align

CConstRef<objects::CSeq_align> CUpdateSeq_Input::m_Align
private

◆ m_OldSeq

objects::CBioseq_Handle CUpdateSeq_Input::m_OldSeq
private

◆ m_Scope

CRef<objects::CScope> CUpdateSeq_Input::m_Scope
private
Note
both the old and the update sequence should be placed in the same scope (NgAligner + visualization purposes)

Definition at line 125 of file update_seq_input.hpp.

Referenced by SetUpdateBioseq(), x_AddNewEntryToScope(), x_ReadAccession(), and x_ReadUpdateSeq_ASN().

◆ m_UpdSeq

objects::CBioseq_Handle CUpdateSeq_Input::m_UpdSeq
private

The documentation for this class was generated from the following files:
Modified on Sat Apr 20 12:17:02 2024 by modify_doxy.py rev. 669887