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

Represents ASN.1 type GC-Assembly defined in file genome_collection.asn

Search Toolkit Book for CGC_Assembly

#include <objects/genomecoll/GC_Assembly.hpp>

+ Inheritance diagram for CGC_Assembly:
+ Collaboration diagram for CGC_Assembly:

Public Types

enum  ESubset {
  eChromosome , eScaffold , eComponent , eTopLevel ,
  eSubmitterPseudoScaffold , eAll
}
 
enum  EFindSeqOption { eEnforceSingle , eChooseAny , eChooseBest }
 
typedef list< CConstRef< CGC_Sequence > > TSequenceList
 
typedef list< CConstRef< CGC_AssemblyUnit > > TAssemblyUnits
 
typedef list< CConstRef< CGC_Assembly > > TFullAssemblies
 
- Public Types inherited from CGC_Assembly_Base
enum  E_Choice { e_not_set = 0 , e_Unit , e_Assembly_set }
 Choice variants. More...
 
enum  E_ChoiceStopper { e_MaxChoice = 3 }
 Maximum+1 value of the choice variant enumerator. More...
 
typedef CGC_AssemblyUnit TUnit
 
typedef CGC_AssemblySet TAssembly_set
 
- 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

 CGC_Assembly (void)
 
 ~CGC_Assembly (void)
 
int GetReleaseId () const
 Retrieve the release id for this assembly. More...
 
string GetAccession () const
 Retrieve the accession for this assembly. More...
 
string GetBestIdentifier () const
 Either accession or submitter-provided id. More...
 
const CGC_AssemblyDescGetDesc () const
 Retrieve the full set of assembly descriptors. More...
 
TTaxId GetTaxId () const
 Retrieve the tax-id for this assembly. More...
 
string GetName () const
 Retrieve the name of this assembly. More...
 
string GetDisplayName () const
 Get full label for assmebly; if this is a unit, full assembly name followed by unit name. More...
 
string GetFileSafeName () const
 Retrieve the file-safe version of assembly name, if available; othwreise default to standard name. More...
 
string GetFileSafeDisplayName () const
 Get file-safe version of full label for assmebly. More...
 
bool IsRefSeq () const
 Is this assembly a RefSeq assembly? More...
 
bool IsGenBank () const
 Is this assembly a GenBank assembly? More...
 
bool IsOrganelle () const
 Is this a non-nuclear assembly unit? More...
 
CGC_AssemblyUnit::TClass GetUnitClass () const
 If this is an assembly unit, get unit class. More...
 
void CreateHierarchy (CGC_Assembly *target_set=NULL)
 Generate the internal up-pointers. More...
 
void CreateIndex ()
 Generate the Seq-id index. More...
 
void GetMolecules (TSequenceList &molecules, ESubset subset) const
 Retrieve a subset of molecules. More...
 
void GetMoleculesByUnit (vector< TSequenceList > &molecules, ESubset subset) const
 Retrieve a subset of molecules separately for each unit, in the same order in which the units are returned by GetAssemblyUnits() More...
 
TAssemblyUnits GetAssemblyUnits () const
 Retrieve a list of all assembly units contained in this assembly. More...
 
TFullAssemblies GetFullAssemblies () const
 Retrieve a list of all full assemblies contained in this assembly Note that, if the assembly is a full assembly, then it will be the only assembly returned; also, if the assembly is not an assembly set, then the base assembly will be returned. More...
 
void Find (const CSeq_id_Handle &id, TSequenceList &sequences) const
 Find all references to a given sequence within an assembly. More...
 
CConstRef< CGC_SequenceFind (const CSeq_id_Handle &id, EFindSeqOption find_option=eEnforceSingle) const
 Find a single sequence corresponding to the supplied id. More...
 
void GetRepliconTypeLocRole (const CSeq_id_Handle &id, string &type, string &location, set< int > &role) const
 Returns replicon type, location and role. More...
 
void PreWrite () const
 PreWrite() / PostRead() handle events for indexing of local structures. More...
 
void PostRead ()
 
CConstRef< CGC_AssemblyGetTargetSet () const
 Access the top-level target set that this assemhly belongs to. More...
 
bool IsTargetSetReference () const
 Is this assembly the reference assembly of the target set, or part of it? More...
 
- Public Member Functions inherited from CGC_Assembly_Base
 CGC_Assembly_Base (void)
 
virtual ~CGC_Assembly_Base (void)
 
 DECLARE_INTERNAL_TYPE_INFO ()
 
virtual void Reset (void)
 Reset the whole object. More...
 
virtual void ResetSelection (void)
 Reset the selection (set it to e_not_set). More...
 
E_Choice Which (void) const
 Which variant is currently selected. More...
 
void CheckSelected (E_Choice index) const
 Verify selection, throw exception if it differs from the expected. More...
 
void ThrowInvalidSelection (E_Choice index) const
 Throw 'InvalidSelection' exception. More...
 
void Select (E_Choice index, EResetVariant reset=eDoResetVariant)
 Select the requested variant if needed. More...
 
void Select (E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
 Select the requested variant if needed, allocating CObject variants from memory pool. More...
 
bool IsUnit (void) const
 Check if variant Unit is selected. More...
 
const TUnitGetUnit (void) const
 Get the variant data. More...
 
TUnitSetUnit (void)
 Select the variant. More...
 
void SetUnit (TUnit &value)
 Select the variant and set its data. More...
 
bool IsAssembly_set (void) const
 Check if variant Assembly_set is selected. More...
 
const TAssembly_setGetAssembly_set (void) const
 Get the variant data. More...
 
TAssembly_setSetAssembly_set (void)
 Select the variant. More...
 
void SetAssembly_set (TAssembly_set &value)
 Select the variant and set its data. More...
 
- Public Member Functions inherited from CSerialObject
 CSerialObject (void)
 
virtual ~CSerialObject (void)
 
virtual const CTypeInfoGetThisTypeInfo (void) const =0
 
virtual void Assign (const CSerialObject &source, ESerialRecursionMode how=eRecursive)
 Set object to copy of another one. More...
 
virtual bool Equals (const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
 Check if both objects contain the same values. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
void ThrowUnassigned (TMemberIndex index) const
 
void ThrowUnassigned (TMemberIndex index, const char *file_name, int file_line) const
 
bool HasNamespaceName (void) const
 Check if object data type has namespace name. More...
 
const stringGetNamespaceName (void) const
 Get namespace name. More...
 
bool HasNamespacePrefix (void) const
 Check if data type has namespace prefix. More...
 
const stringGetNamespacePrefix (void) const
 Get namespace prefix. 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...
 
- 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 Types

typedef CGC_Assembly_Base Tparent
 
typedef map< CSeq_id_Handle, TSequenceListTSequenceIndex
 

Private Member Functions

 CGC_Assembly (const CGC_Assembly &value)
 
CGC_Assemblyoperator= (const CGC_Assembly &value)
 
void x_Index (CGC_Assembly &assm, CGC_Replicon &replicon)
 indexing infrastructure More...
 
void x_Index (CGC_Assembly &assm, CGC_Sequence &seq)
 
void x_Index (CGC_AssemblyUnit &unit, CGC_Replicon &replicon)
 
void x_Index (CGC_AssemblyUnit &unit, CGC_Sequence &seq)
 
void x_Index (CGC_Replicon &replicon, CGC_Sequence &seq)
 
void x_Index (CGC_Sequence &parent, CGC_Sequence &seq, CGC_TaggedSequences::TState relation)
 
void x_Index (CGC_Sequence &seq, CGC_TaggedSequences::TState relation)
 
void x_Index (CGC_Assembly &root)
 
const list< CRef< CDbtag > > & x_GetId () const
 
string x_GetSubmitterId () const
 

Private Attributes

CMutex m_Mutex
 
TSequenceIndex m_SequenceMap
 
CGC_Assemblym_TargetSet
 

Additional Inherited Members

- Static Public Member Functions inherited from CGC_Assembly_Base
static string SelectionName (E_Choice index)
 Retrieve selection name (for diagnostic purposes). More...
 
- Static Public Member Functions inherited from CSerialObject
static void SetVerifyDataThread (ESerialVerifyData verify)
 
static void SetVerifyDataGlobal (ESerialVerifyData verify)
 
static string UnassignedString (void)
 
static CStringUTF8 UnassignedStringUTF8 (void)
 
static char UnassignedByte (void)
 
- 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 CSerialObject
static const char * ms_UnassignedStr = "<*unassigned*>"
 
static const char ms_UnassignedByte = char(0xcd)
 
- 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 62 of file GC_Assembly.hpp.

Member Typedef Documentation

◆ TAssemblyUnits

Definition at line 68 of file GC_Assembly.hpp.

◆ TFullAssemblies

Definition at line 69 of file GC_Assembly.hpp.

◆ Tparent

Definition at line 64 of file GC_Assembly.hpp.

◆ TSequenceIndex

Definition at line 194 of file GC_Assembly.hpp.

◆ TSequenceList

Definition at line 67 of file GC_Assembly.hpp.

Member Enumeration Documentation

◆ EFindSeqOption

Enumerator
eEnforceSingle 
eChooseAny 
eChooseBest 

Definition at line 156 of file GC_Assembly.hpp.

◆ ESubset

Enumerator
eChromosome 
eScaffold 
eComponent 
eTopLevel 
eSubmitterPseudoScaffold 
eAll 

Definition at line 124 of file GC_Assembly.hpp.

Constructor & Destructor Documentation

◆ CGC_Assembly() [1/2]

CGC_Assembly::CGC_Assembly ( void  )

Definition at line 66 of file GC_Assembly.cpp.

◆ ~CGC_Assembly()

CGC_Assembly::~CGC_Assembly ( void  )

Definition at line 73 of file GC_Assembly.cpp.

◆ CGC_Assembly() [2/2]

CGC_Assembly::CGC_Assembly ( const CGC_Assembly value)
private

Member Function Documentation

◆ CreateHierarchy()

void CGC_Assembly::CreateHierarchy ( CGC_Assembly target_set = NULL)

◆ CreateIndex()

void CGC_Assembly::CreateIndex ( )

◆ Find() [1/2]

CConstRef< CGC_Sequence > CGC_Assembly::Find ( const CSeq_id_Handle id,
EFindSeqOption  find_option = eEnforceSingle 
) const

Find a single sequence corresponding to the supplied id.

Flag find_option specifies what to do if more than one sequence is found with this id.

  • eEnforceSingle: throw an exception. This is the default
  • eChooseAny: arbitrarily choose one of the sequences
  • eChooseBest: choose the best sequneces available with this id. Criteria are: – Choose a sequence from the reference full assembly in preference to a sequence from another full assembly – Choose a sequence from the primary unit in preference to a sequence from another unit – Choose a top-level sequence in preference to a non-top-level sequence – Choose a scaffold in preference to a component – If there's more than one sequence that's "best" by the above criteria, choose one arbitrarily

Definition at line 384 of file GC_Assembly.cpp.

References CreateIndex(), eChooseBest, eEnforceSingle, map_checker< Container >::empty(), map_checker< Container >::end(), eUnknown, map_checker< Container >::find(), GetSeqId(), m_SequenceMap, and NCBI_THROW.

◆ Find() [2/2]

void CGC_Assembly::Find ( const CSeq_id_Handle id,
TSequenceList sequences 
) const

◆ GetAccession()

string CGC_Assembly::GetAccession ( void  ) const

◆ GetAssemblyUnits()

CGC_Assembly::TAssemblyUnits CGC_Assembly::GetAssemblyUnits ( ) const

Retrieve a list of all assembly units contained in this assembly.

Definition at line 266 of file GC_Assembly.cpp.

References CGC_Assembly_Base::GetAssembly_set(), GetAssemblyUnits(), CGC_AssemblySet_Base::GetPrimary_assembly(), CGC_Assembly_Base::GetUnit(), CGC_Assembly_Base::IsUnit(), ITERATE, and tmp.

Referenced by GetAssemblyUnits(), and GetFullAssemblies().

◆ GetBestIdentifier()

string CGC_Assembly::GetBestIdentifier ( ) const

Either accession or submitter-provided id.

Definition at line 113 of file GC_Assembly.cpp.

References GetAccession(), and x_GetSubmitterId().

◆ GetDesc()

const CGC_AssemblyDesc & CGC_Assembly::GetDesc ( void  ) const

◆ GetDisplayName()

string CGC_Assembly::GetDisplayName ( ) const

Get full label for assmebly; if this is a unit, full assembly name followed by unit name.

Definition at line 164 of file GC_Assembly.cpp.

References CGC_AssemblyUnit::GetDisplayName(), GetName(), CGC_Assembly_Base::GetUnit(), CGC_Assembly_Base::IsAssembly_set(), CGC_Assembly_Base::IsUnit(), and kEmptyStr.

◆ GetFileSafeDisplayName()

string CGC_Assembly::GetFileSafeDisplayName ( ) const

◆ GetFileSafeName()

string CGC_Assembly::GetFileSafeName ( ) const

Retrieve the file-safe version of assembly name, if available; othwreise default to standard name.

Definition at line 176 of file GC_Assembly.cpp.

References GetDesc(), CGC_AssemblyDesc_Base::GetFilesafe_name(), GetName(), CGC_AssemblyDesc_Base::IsSetFilesafe_name(), and NStr::Replace().

Referenced by GetFileSafeDisplayName(), and CGC_AssemblyUnit::GetFileSafeDisplayName().

◆ GetFullAssemblies()

CGC_Assembly::TFullAssemblies CGC_Assembly::GetFullAssemblies ( ) const

Retrieve a list of all full assemblies contained in this assembly Note that, if the assembly is a full assembly, then it will be the only assembly returned; also, if the assembly is not an assembly set, then the base assembly will be returned.

Definition at line 290 of file GC_Assembly.cpp.

References CGC_AssemblySet_Base::eSet_type_assembly_set, CGC_AssemblySet_Base::eSet_type_full_assembly, CGC_Assembly_Base::GetAssembly_set(), GetAssemblyUnits(), CGC_Assembly_Base::IsAssembly_set(), ITERATE, and tmp.

◆ GetMolecules()

void CGC_Assembly::GetMolecules ( TSequenceList molecules,
ESubset  subset 
) const

◆ GetMoleculesByUnit()

void CGC_Assembly::GetMoleculesByUnit ( vector< TSequenceList > &  molecules,
ESubset  subset 
) const

Retrieve a subset of molecules separately for each unit, in the same order in which the units are returned by GetAssemblyUnits()

Definition at line 871 of file GC_Assembly.cpp.

References s_Extract().

◆ GetName()

string CGC_Assembly::GetName ( void  ) const

◆ GetReleaseId()

int CGC_Assembly::GetReleaseId ( ) const

Retrieve the release id for this assembly.

Definition at line 84 of file GC_Assembly.cpp.

References ITERATE, and x_GetId().

◆ GetRepliconTypeLocRole()

void CGC_Assembly::GetRepliconTypeLocRole ( const CSeq_id_Handle id,
string type,
string location,
set< int > &  role 
) const

Returns replicon type, location and role.

Definition at line 425 of file GC_Assembly.cpp.

References eGC_SequenceRole_chromosome, eGC_SequenceRole_pseudo_scaffold, eGC_SequenceRole_scaffold, Find(), set< Key, Compare >::insert(), ITERATE, and location.

◆ GetTargetSet()

CConstRef< CGC_Assembly > CGC_Assembly::GetTargetSet ( ) const

Access the top-level target set that this assemhly belongs to.

Definition at line 877 of file GC_Assembly.cpp.

References m_TargetSet.

◆ GetTaxId()

TTaxId CGC_Assembly::GetTaxId ( void  ) const

◆ GetUnitClass()

CGC_AssemblyUnit::TClass CGC_Assembly::GetUnitClass ( ) const

If this is an assembly unit, get unit class.

Definition at line 254 of file GC_Assembly.cpp.

References CGC_AssemblyUnit_Base::eClass_other, CGC_AssemblyUnit_Base::GetClass(), CGC_Assembly_Base::GetUnit(), and CGC_Assembly_Base::IsUnit().

◆ IsGenBank()

bool CGC_Assembly::IsGenBank ( ) const

◆ IsOrganelle()

bool CGC_Assembly::IsOrganelle ( ) const

Is this a non-nuclear assembly unit?

Definition at line 249 of file GC_Assembly.cpp.

References GetName().

◆ IsRefSeq()

bool CGC_Assembly::IsRefSeq ( ) const

◆ IsTargetSetReference()

bool CGC_Assembly::IsTargetSetReference ( ) const

◆ operator=()

CGC_Assembly& CGC_Assembly::operator= ( const CGC_Assembly value)
private

◆ PostRead()

void CGC_Assembly::PostRead ( )

Definition at line 454 of file GC_Assembly.cpp.

References CreateHierarchy().

◆ PreWrite()

void CGC_Assembly::PreWrite ( ) const

PreWrite() / PostRead() handle events for indexing of local structures.

Definition at line 450 of file GC_Assembly.cpp.

◆ x_GetId()

const list< CRef< CDbtag > > & CGC_Assembly::x_GetId ( ) const
private

◆ x_GetSubmitterId()

string CGC_Assembly::x_GetSubmitterId ( ) const
private

Definition at line 119 of file GC_Assembly.cpp.

References ITERATE, and x_GetId().

Referenced by GetBestIdentifier().

◆ x_Index() [1/8]

void CGC_Assembly::x_Index ( CGC_Assembly assm,
CGC_Replicon replicon 
)
private

◆ x_Index() [2/8]

void CGC_Assembly::x_Index ( CGC_Assembly assm,
CGC_Sequence seq 
)
private

◆ x_Index() [3/8]

void CGC_Assembly::x_Index ( CGC_Assembly root)
private

◆ x_Index() [4/8]

void CGC_Assembly::x_Index ( CGC_AssemblyUnit unit,
CGC_Replicon replicon 
)
private

◆ x_Index() [5/8]

void CGC_Assembly::x_Index ( CGC_AssemblyUnit unit,
CGC_Sequence seq 
)
private

◆ x_Index() [6/8]

void CGC_Assembly::x_Index ( CGC_Replicon replicon,
CGC_Sequence seq 
)
private

◆ x_Index() [7/8]

void CGC_Assembly::x_Index ( CGC_Sequence parent,
CGC_Sequence seq,
CGC_TaggedSequences::TState  relation 
)
private

◆ x_Index() [8/8]

void CGC_Assembly::x_Index ( CGC_Sequence seq,
CGC_TaggedSequences::TState  relation 
)
private

Member Data Documentation

◆ m_Mutex

CMutex CGC_Assembly::m_Mutex
private

Definition at line 193 of file GC_Assembly.hpp.

Referenced by CreateIndex().

◆ m_SequenceMap

TSequenceIndex CGC_Assembly::m_SequenceMap
private

Definition at line 195 of file GC_Assembly.hpp.

Referenced by CreateIndex(), and Find().

◆ m_TargetSet

CGC_Assembly* CGC_Assembly::m_TargetSet
private

Definition at line 197 of file GC_Assembly.hpp.

Referenced by CreateHierarchy(), GetTargetSet(), and IsTargetSetReference().


The documentation for this class was generated from the following files:
Modified on Wed Jun 19 16:59:48 2024 by modify_doxy.py rev. 669887