NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CBioseq Class Reference

Represents ASN.1 type Bioseq defined in file seq.asn

Search Toolkit Book for CBioseq

#include <objects/seq/Bioseq.hpp>

+ Inheritance diagram for CBioseq:
+ Collaboration diagram for CBioseq:

Public Types

enum  ELabelType { eType , eContent , eBoth }
- Public Types inherited from CBioseq_Base
enum class  E_memberIndex {
  e__allMandatory = 0 , e_id , e_descr , e_inst ,
typedef list< CRef< CSeq_id > > TId
typedef CSeq_descr TDescr
typedef CSeq_inst TInst
typedef list< CRef< CSeq_annot > > TAnnot
typedef Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
- 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

 CBioseq (void)
 ~CBioseq (void)
CSeq_entryGetParentEntry (void) const
CConstRef< CBioseq_setGetParentSet (void) const
CConstRef< CSeqdescGetClosestDescriptor (CSeqdesc::E_Choice choice, int *level=NULL) const
 CBioseq (const CSeq_loc &loc, const string &str_id=kEmptyStr)
void GetLabel (string *label, ELabelType type, bool worst=false) const
const CSeq_idGetFirstId () const
const CSeq_idGetNonLocalId () const
 Find a non-local ID if present, consulting assembly details if all IDs for the overall sequence are local. More...
const CSeq_idGetLocalId () const
 Find a local ID if present. More...
bool IsNa (void) const
bool IsAa (void) const
TTaxId GetTaxId () const
 Determine the tax-id for this bioseq. More...
bool IsSetLength (void) const
TSeqPos GetLength (void) const
void PackAsDeltaSeq (bool gaps_ok=false)
 Convert a raw nucleotide sequence with occasional ambiguities or gaps into a tighter (but somewhat more complex) delta-seq representation. More...
- Public Member Functions inherited from CBioseq_Base
 CBioseq_Base (void)
virtual ~CBioseq_Base (void)
bool IsSetId (void) const
 equivalent identifiers Check if a value has been assigned to Id data member. More...
bool CanGetId (void) const
 Check if it is safe to call GetId method. More...
void ResetId (void)
 Reset Id data member. More...
const TIdGetId (void) const
 Get the Id member data. More...
TIdSetId (void)
 Assign a value to Id data member. More...
bool IsSetDescr (void) const
 descriptors Check if a value has been assigned to Descr data member. More...
bool CanGetDescr (void) const
 Check if it is safe to call GetDescr method. More...
void ResetDescr (void)
 Reset Descr data member. More...
const TDescrGetDescr (void) const
 Get the Descr member data. More...
void SetDescr (TDescr &value)
 Assign a value to Descr data member. More...
TDescrSetDescr (void)
 Assign a value to Descr data member. More...
bool IsSetInst (void) const
 the sequence data Check if a value has been assigned to Inst data member. More...
bool CanGetInst (void) const
 Check if it is safe to call GetInst method. More...
void ResetInst (void)
 Reset Inst data member. More...
const TInstGetInst (void) const
 Get the Inst member data. More...
void SetInst (TInst &value)
 Assign a value to Inst data member. More...
TInstSetInst (void)
 Assign a value to Inst data member. More...
bool IsSetAnnot (void) const
 Check if a value has been assigned to Annot data member. More...
bool CanGetAnnot (void) const
 Check if it is safe to call GetAnnot method. More...
void ResetAnnot (void)
 Reset Annot data member. More...
const TAnnotGetAnnot (void) const
 Get the Annot member data. More...
TAnnotSetAnnot (void)
 Assign a value to Annot data member. More...
virtual void Reset (void)
 Reset the whole object. 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
- Public Member Functions inherited from CSerialUserOp
virtual ~CSerialUserOp ()

Protected Member Functions

virtual void UserOp_Assign (const CSerialUserOp &source)
 Will be called after copying the datatool-generated members. More...
virtual bool UserOp_Equals (const CSerialUserOp &object) const
 Will be called after comparing the datatool-generated members. More...
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...

Private Types

typedef CBioseq_Base Tparent

Private Member Functions

 CBioseq (const CBioseq &value)
CBioseqoperator= (const CBioseq &value)
void SetParentEntry (CSeq_entry *entry)

Static Private Member Functions

static void x_SeqLoc_To_DeltaExt (const CSeq_loc &loc, CDelta_ext &ext)

Private Attributes


Static Private Attributes

static int sm_ConstructedId = 0


class CSeq_entry

Additional Inherited Members

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

Detailed Description

Definition at line 62 of file Bioseq.hpp.

Member Typedef Documentation

◆ Tparent

typedef CBioseq_Base CBioseq::Tparent

Definition at line 64 of file Bioseq.hpp.

Member Enumeration Documentation

◆ ELabelType


Definition at line 101 of file Bioseq.hpp.

Constructor & Destructor Documentation

◆ CBioseq() [1/3]

CBioseq::CBioseq ( void  )

Definition at line 162 of file Bioseq.hpp.

◆ ~CBioseq()

CBioseq::~CBioseq ( void  )

Definition at line 84 of file Bioseq.cpp.

◆ CBioseq() [2/3]

CBioseq::CBioseq ( const CSeq_loc loc,
const string str_id = kEmptyStr 

◆ CBioseq() [3/3]

CBioseq::CBioseq ( const CBioseq value)

Member Function Documentation

◆ GetClosestDescriptor()

CConstRef< CSeqdesc > CBioseq::GetClosestDescriptor ( CSeqdesc::E_Choice  choice,
int level = NULL 
) const

◆ GetFirstId()

const CSeq_id * CBioseq::GetFirstId ( void  ) const

◆ GetLabel()

void CBioseq::GetLabel ( string label,
ELabelType  type,
bool  worst = false 
) const

◆ GetLength()

TSeqPos CBioseq::GetLength ( void  ) const

Definition at line 360 of file Bioseq.cpp.

References CBioseq_Base::GetInst(), and CSeq_inst_Base::GetLength().

Referenced by CGapsEditor::AddBioseqAsLiteral(), AddFeat(), AddProteinFeature(), CBuildDatabase::AddSequences(), AddToDeltaSeq(), AdjustSingleFeature(), CForeignContaminationScreenReportReader::AnnotateOrRemove(), BOOST_AUTO_TEST_CASE(), CheckGene(), CCmdAddCDS::Execute(), CCmdCreateCDS::Execute(), CBlastDBExtractor::ExtractFasta(), CdBlaster::FillOutSeqLoc(), FindGene(), fta_parse_tpa_tsa_block(), GapsToDelta(), GetLabel(), CBulkLocationPanel::GetLocForBioseq(), GetProtRefAnnot(), GetRetranslateCDSCommand(), GetSeqData(), GetSeqLen(), GetSPSegLocInfo(), IfOnlyStopCodon(), CBlastFormatUtil::InsertSubjectScores(), CConvertBadCdsAndRnaToMiscFeat::IsExtendableRight(), IsExtendableRight(), CConvertBadCdsAndRnaToMiscFeat::IsNonExtendable(), IsNonExtendable(), MakeEntryForDeltaConversion(), CScoreSeqCoverage::MakeScore(), CScoreUniqSeqCoverage::MakeScore(), OneTerminalTranslationExceptionTest(), CRemoveSequencesDlg::OnSelect(), CLengthSubpanel::OnSelectButton(), QSbuf_To_Single_Qscore_SeqGraph(), RetranslateCdregion(), RetranslateCDS(), RetrieveGi555WithTimeOut(), RetrieveLargeNuclSequence(), RetrieveLargeProteinWithTimeOut(), RetrievePartsOfLargeChromosome(), RevComp(), CUpdateSeq_Input::s_ConvertDeltaToRawBioseq(), s_ReadAndTestQueryFromString_CFastaReader(), SeqToDelta(), CLengthSubpanel::SetClusters(), SimpleSeqLocFromBioseq(), Split_Qscore_SeqGraph_By_DeltaSeq(), SrchSegLength(), TestOneGapSeq(), TestUTRPair(), CValidError_bioseq::ValidateDelta(), CValidError_bioseq::ValidateNsAndGaps(), CQualScoreWriter::Write(), CSequenceUpdater::x_AdjustProteinFeature(), CSequenceEditingEventHandler::x_CacheSelectedLocations(), CLocation_constraint::x_DoesLocationMatchDistanceConstraint(), CAdjustFeaturesForGaps::x_DoOne(), CNewCleanup_imp::x_ExtendFeatureToCoverSequence(), CNewCleanup_imp::x_ExtendProteinFeatureOnProteinSeq(), CAsn2FastaApp::x_GetFastaOstream(), CEditObjectSeq_feat::x_HandleCdsProduct(), CAgpConverter::x_InitializeAndCheckCopyOfTemplate(), CVectorTrimPanel::x_RetranslateCDS(), CQualScoreWriter::x_WriteHeader(), and CForeignContaminationScreenReportReader::xCheckLen().

◆ GetLocalId()

const CSeq_id * CBioseq::GetLocalId ( ) const

◆ GetNonLocalId()

const CSeq_id * CBioseq::GetNonLocalId ( ) const

Find a non-local ID if present, consulting assembly details if all IDs for the overall sequence are local.

Definition at line 292 of file Bioseq.cpp.

References CSeq_hist_Base::CanGetAssembly(), CSeq_inst_Base::CanGetHist(), Empty(), FindBestChoice(), CSeq_hist_Base::GetAssembly(), CSeq_inst_Base::GetHist(), CBioseq_Base::GetId(), CBioseq_Base::GetInst(), CSeq_id_Base::IsLocal(), ITERATE, CSeq_id::Match(), NULL, and s_BestNonLocalRank().

Referenced by s_UseFastaReaderDeflines().

◆ GetParentEntry()

CSeq_entry * CBioseq::GetParentEntry ( void  ) const

◆ GetParentSet()

CConstRef< CBioseq_set > CBioseq::GetParentSet ( void  ) const

◆ GetTaxId()

TTaxId CBioseq::GetTaxId ( void  ) const

◆ IsAa()

bool CBioseq::IsAa ( void  ) const

Definition at line 350 of file Bioseq.cpp.

References CBioseq_Base::GetInst(), and CSeq_inst::IsAa().

Referenced by CValidError_imp::AddBioseqWithNoPub(), CCleanup::AddMissingMolInfo(), CWriteDB_Impl::AddSequence(), CBuildDatabase::AddSequences(), CFeatGapInfo::AdjustProteinSeq(), CSourceModParser::ApplyAllMods(), CClearKeywords::ApplyToCSeq_entry(), CSeqTranslator::ChangeDeltaProteinToRawProtein(), CFeatureTableReader::ChangeDeltaProteinToRawProtein(), CNewCleanup_imp::CreateMissingMolInfo(), CCmdAddSeqEntry::Execute(), objects::CFixSuspectProductName::FixSuspectProductNames(), CApplyRNAITSDlg::GetCommand(), CGuiObjectInfoBioseq::GetIcon(), CBioseqHandler::GetLabel(), CDUpdater::GetOneBioseqFromSeqEntry(), CGuiObjectInfoBioseq::GetSubtype(), GetTitle(), CReadBlastApp::hasGenomicLocation(), CReadBlastApp::less_seq(), LoadFileForSubmission(), CLocation_constraint::Match(), CCDSTranslationPanel::OnImportCdsProteinHyperlinkClicked(), CNewCleanup_imp::RemoveBadProteinTitle(), CReadBlastApp::RemoveProblems(), CNewCleanup_imp::ResynchPeptidePartials(), CProsplignProcess::SeqEntryProcess(), SetCompleteness(), CMacroFunction_AddDBLink::TheFunction(), CMacroFunction_ApplyCDS::TheFunction(), CMacroFunction_ApplyRNA::TheFunction(), CMacroFunction_ApplyGene::TheFunction(), CValidError_bioseq::ValidateBioseqContext(), CValidError_bioseq::ValidateInst(), CValidError_bioseq::ValidateMolInfoContext(), CValidError_bioseq::ValidateMoltypeDescriptors(), CValidError_bioseqset::ValidateNucProtSet(), CValidError_bioseq::ValidateRawConst(), CValidError_bioseq::ValidateSegRef(), CValidError_bioseq::ValidateSeqDescContext(), CValidError_feat::ValidateSeqFeatContext(), CValidError_bioseq::ValidateSeqIds(), CValidError_bioseq::ValidateSeqLen(), CSequenceEditingEventHandler::x_CacheSelectedLocations(), CLocation_constraint::x_DoesBioseqMatchSequenceType(), CWriteDB_Impl::x_GetFastaReaderDeflines(), and CMacroFunction_UpdateProteinSeqs::x_ReadUpdateSeqs().

◆ IsNa()

bool CBioseq::IsNa ( void  ) const

Definition at line 345 of file Bioseq.cpp.

References CBioseq_Base::GetInst(), and CSeq_inst::IsNa().

Referenced by CFeatModApply::Apply(), CSourceModParser::ApplyAllMods(), CSourceModParser::ApplyMods(), CClearKeywords::ApplyToCSeq_entry(), CFastaReader::CheckDataLine(), FindNucInSeqEntry(), CApplyRNAITSDlg::GetCommand(), CGuiObjectInfoBioseq::GetIcon(), CBioseqHandler::GetLabel(), CMaskFastaReader::GetNextSequence(), CBioseq_set::GetNucFromNucProtSet(), CGuiObjectInfoBioseq::GetSubtype(), CValidError_bioseq::IsHistAssemblyMissing(), CFeatureTableReader::MoveRegionsToProteins(), CFastaReader::ParseDataLine(), CTable2AsnStructuredCommentsReader::ProcessComments(), CReorderSequencesDlg::ReadBioseq(), CSegregateSetsBase::ReadBioseq(), NMacroUtil::RemoveEmptyDescriptors(), RestoreModelFromInternalGnomonFeature(), RestoreModelFromPublicMrnaFeature(), RevComp(), s_AutoDefUserObjectFromBioseq(), s_CollectCollidingIDs_Entry(), CUpdateSeq_Input::s_ConvertDeltaToRawBioseq(), CUpdateSeq_Input::s_ConvertDeltaToRawEntry(), CUpdateSeq_Input::s_FixCollidingIDs_Entry(), s_HasUnprocessedCdregions(), CAgpwriteProcess::SeqEntryProcess(), CProsplignProcess::SeqEntryProcess(), CMacroFunction_SetStructCommDb::TheFunction(), CMacroFunction_Autodef::TheFunction(), CMacroFunction_RemoveAllFeatures::TheFunction(), CValidError_bioseqset::ValidateBioseqSet(), CValidError_bioseq::ValidateCompleteGenome(), CValidError_bioseq::ValidateDelta(), CValidError_graph::ValidateGraphsOnBioseq(), CValidError_bioseq::ValidateInst(), CValidError_bioseq::ValidateMolInfoContext(), CValidError_bioseqset::ValidateNucProtSet(), CValidError_bioseq::ValidateRawConst(), CValidError_bioseq::ValidateSeqDescContext(), CValidError_bioseq::ValidateSeqIds(), CConversionApp::Write(), CSequenceUpdater::x_AdjustProteinFeature(), CLocation_constraint::x_DoesBioseqMatchSequenceType(), CSubmissionWizard::x_ExtractDescriptorsFromSeqEntry(), CShowBlastDefline::x_InitDefline(), CSequenceUpdater::x_UpdateProteinID(), CValidError_bioseq::x_ValidateCompletness(), and CFeatureTableReader::xConvertSeqIntoSeqSet().

◆ IsSetLength()

bool CBioseq::IsSetLength ( void  ) const

◆ operator=()

CBioseq& CBioseq::operator= ( const CBioseq value)

◆ PackAsDeltaSeq()

void CBioseq::PackAsDeltaSeq ( bool  gaps_ok = false)

◆ SetParentEntry()

void CBioseq::SetParentEntry ( CSeq_entry entry)

Definition at line 168 of file Bioseq.hpp.

References m_ParentEntry.

Referenced by CSeq_entry::Parentize(), and CSeq_entry::ParentizeOneLevel().

◆ UserOp_Assign()

void CBioseq::UserOp_Assign ( const CSerialUserOp source)

Will be called after copying the datatool-generated members.

Implements CSerialUserOp.

Definition at line 88 of file Bioseq.cpp.

◆ UserOp_Equals()

bool CBioseq::UserOp_Equals ( const CSerialUserOp object) const

Will be called after comparing the datatool-generated members.

Implements CSerialUserOp.

Definition at line 92 of file Bioseq.cpp.

◆ x_SeqLoc_To_DeltaExt()

void CBioseq::x_SeqLoc_To_DeltaExt ( const CSeq_loc loc,
CDelta_ext ext 

Friends And Related Function Documentation

◆ CSeq_entry

friend class CSeq_entry

Definition at line 153 of file Bioseq.hpp.

Member Data Documentation

◆ m_ParentEntry

CSeq_entry* CBioseq::m_ParentEntry

Definition at line 147 of file Bioseq.hpp.

Referenced by GetParentEntry(), and SetParentEntry().

◆ sm_ConstructedId

int CBioseq::sm_ConstructedId = 0

Definition at line 151 of file Bioseq.hpp.

Referenced by CBioseq().

The documentation for this class was generated from the following files:
Modified on Sat Sep 30 03:15:18 2023 by rev. 669887