NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
Seq_id.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbiutil.hpp>
#include <corelib/ncbi_param.hpp>
#include <util/line_reader.hpp>
#include <util/static_map.hpp>
#include <util/util_misc.hpp>
#include <util/bitset/ncbi_bitset.hpp>
#include <serial/serialimpl.hpp>
#include <objects/seq/Bioseq.hpp>
#include <objects/seq/Seq_inst.hpp>
#include <objects/seq/seq_id_handle.hpp>
#include <objects/seqloc/Seq_id.hpp>
#include <objects/seqloc/Textseq_id.hpp>
#include <objects/seqloc/Giimport_id.hpp>
#include <objects/seqloc/Patent_seq_id.hpp>
#include <objects/seqloc/PDB_seq_id.hpp>
#include <objects/biblio/Id_pat.hpp>
#include <objects/general/Object_id.hpp>
#include <objects/general/Dbtag.hpp>
#include <objects/general/Date.hpp>
#include <objects/general/Date_std.hpp>
#include <objects/misc/error_codes.hpp>
#include <corelib/ncbistre.hpp>
#include "accguide2.inc"
+ Include dependency graph for Seq_id.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SAccGuide
 
struct  SAccGuide::SSubMap
 
struct  SAccGuide::SHints
 

Macros

#define NCBI_USE_ERRCODE_X   Objects_SeqId
 

Typedefs

typedef SStaticPair< const char *, CSeq_id::E_ChoiceTChoiceMapEntry
 
typedef CStaticPairArrayMap< CTempString, CSeq_id::E_Choice, PNocase_Generic< CTempString > > TChoiceMap
 
typedef SStaticPair< const char *, CSeq_id::EAccessionInfoTAccInfoMapEntry
 
typedef CStaticPairArrayMap< CTempString, CSeq_id::EAccessionInfo, PNocase_Generic< CTempString > > TAccInfoMap
 

Functions

 DEFINE_STATIC_ARRAY_MAP_WITH_COPY (CStaticArraySet< string >, kSupportedRawDbtags, sc_SupportedRawDbtags)
 
static void s_SplitVersion (const CTempString &acc_in, CTempString &acc, int &ver)
 
void x_Assign (CObject_id &dst, const CObject_id &src)
 
void x_Assign (CGiimport_id &dst, const CGiimport_id &src)
 
void x_Assign (CTextseq_id &dst, const CTextseq_id &src)
 
void x_Assign (CDbtag &dst, const CDbtag &src)
 
void x_Assign (CPatent_seq_id &dst, const CPatent_seq_id &src)
 
void x_Assign (CDate &dst, const CDate &src)
 
void x_Assign (CPDB_seq_id &dst, const CPDB_seq_id &src)
 
bool CanCmpAcc (CSeq_id::E_Choice choice)
 
 DEFINE_STATIC_ARRAY_MAP_WITH_COPY (TChoiceMap, sc_ChoiceMap, sc_ChoiceArray)
 
static bool s_HasFastaTag (const CTempString &s)
 
static CSeq_id::E_Choice s_CheckForFastaTag (const CTempString &s)
 
 DEFINE_STATIC_ARRAY_MAP_WITH_COPY (TAccInfoMap, sc_AccInfoMap, sc_AccInfoArray)
 
static CRef< SAccGuide > * s_CreateGuide (void)
 
static void x_GetLabel_Type (const CSeq_id &id, string *label, CSeq_id::TLabelFlags flags)
 
static void x_GetLabel_Content (const CSeq_id &id, string *label, CSeq_id::TLabelFlags flags, int *version)
 
CTextseq_ids_GetTextseq_id (const CSeq_id::E_Choice &choice, CSeq_id &match)
 
 NCBI_PARAM_DECL (bool, SeqId, PreferAccessionOverGi)
 
 NCBI_PARAM_DEF_EX (bool, SeqId, PreferAccessionOverGi, false, eParam_NoThread, SEQ_ID_PREFER_ACCESSION_OVER_GI)
 
typedef NCBI_PARAM_TYPE (SeqId, PreferAccessionOverGi) TPreferAccessionOverGi
 
 NCBI_PARAM_DECL (bool, SeqId, AvoidGi)
 
 NCBI_PARAM_DEF_EX (bool, SeqId, AvoidGi, false, eParam_NoThread, SEQ_ID_AVOID_GI)
 
typedef NCBI_PARAM_TYPE (SeqId, AvoidGi) TAvoidGi
 

Variables

static const char * sc_SupportedRawDbtags []
 
static const TChoiceMapEntry sc_ChoiceArray []
 
static const char *const s_TextId [CSeq_id::e_MaxChoice+1]
 
static const TAccInfoMapEntry sc_AccInfoArray []
 
static const char kDigits [] = "0123456789"
 
static const unsigned int kMaxSmallSpecialDigits = 9
 
static const bm::bvector ::size_type kBVSizes [kMaxSmallSpecialDigits+1]
 
static const SAccGuide::TAccInfo kUnrecognized = static_cast<SAccGuide::TAccInfo>(-1)
 
static CSafeStatic< CRef< SAccGuide > > s_Guide (s_CreateGuide, NULL)
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Objects_SeqId

Definition at line 74 of file Seq_id.cpp.

Typedef Documentation

◆ TAccInfoMap

Definition at line 863 of file Seq_id.cpp.

◆ TAccInfoMapEntry

Definition at line 645 of file Seq_id.cpp.

◆ TChoiceMap

Definition at line 568 of file Seq_id.cpp.

◆ TChoiceMapEntry

Definition at line 524 of file Seq_id.cpp.

Function Documentation

◆ CanCmpAcc()

bool CanCmpAcc ( CSeq_id::E_Choice  choice)
inline

◆ DEFINE_STATIC_ARRAY_MAP_WITH_COPY() [1/3]

DEFINE_STATIC_ARRAY_MAP_WITH_COPY ( CStaticArraySet< string ,
kSupportedRawDbtags  ,
sc_SupportedRawDbtags   
)

◆ DEFINE_STATIC_ARRAY_MAP_WITH_COPY() [2/3]

DEFINE_STATIC_ARRAY_MAP_WITH_COPY ( TAccInfoMap  ,
sc_AccInfoMap  ,
sc_AccInfoArray   
)

◆ DEFINE_STATIC_ARRAY_MAP_WITH_COPY() [3/3]

DEFINE_STATIC_ARRAY_MAP_WITH_COPY ( TChoiceMap  ,
sc_ChoiceMap  ,
sc_ChoiceArray   
)

◆ NCBI_PARAM_DECL() [1/2]

NCBI_PARAM_DECL ( bool  ,
SeqId  ,
AvoidGi   
)

◆ NCBI_PARAM_DECL() [2/2]

NCBI_PARAM_DECL ( bool  ,
SeqId  ,
PreferAccessionOverGi   
)

◆ NCBI_PARAM_DEF_EX() [1/2]

NCBI_PARAM_DEF_EX ( bool  ,
SeqId  ,
AvoidGi  ,
false  ,
eParam_NoThread  ,
SEQ_ID_AVOID_GI   
)

◆ NCBI_PARAM_DEF_EX() [2/2]

NCBI_PARAM_DEF_EX ( bool  ,
SeqId  ,
PreferAccessionOverGi  ,
false  ,
eParam_NoThread  ,
SEQ_ID_PREFER_ACCESSION_OVER_GI   
)

◆ NCBI_PARAM_TYPE() [1/2]

typedef NCBI_PARAM_TYPE ( SeqId  ,
AvoidGi   
)

◆ NCBI_PARAM_TYPE() [2/2]

typedef NCBI_PARAM_TYPE ( SeqId  ,
PreferAccessionOverGi   
)

◆ s_CheckForFastaTag()

static CSeq_id::E_Choice s_CheckForFastaTag ( const CTempString s)
static

◆ s_CreateGuide()

static CRef<SAccGuide>* s_CreateGuide ( void  )
static

Definition at line 1627 of file Seq_id.cpp.

◆ s_GetTextseq_id()

CTextseq_id* s_GetTextseq_id ( const CSeq_id::E_Choice choice,
CSeq_id match 
)

◆ s_HasFastaTag()

static bool s_HasFastaTag ( const CTempString s)
inlinestatic

Definition at line 618 of file Seq_id.cpp.

References CTempString::size().

Referenced by CSeq_id::ParseIDs().

◆ s_SplitVersion()

static void s_SplitVersion ( const CTempString acc_in,
CTempString acc,
int ver 
)
static

Definition at line 151 of file Seq_id.cpp.

References CTempString::empty(), NCBI_THROW, NStr::SplitInTwo(), and NStr::StringToNonNegativeInt().

Referenced by CSeq_id::Set().

◆ x_Assign() [1/7]

void x_Assign ( CDate dst,
const CDate src 
)
inline

Definition at line 287 of file Seq_id.cpp.

References CSerialObject::Assign().

◆ x_Assign() [2/7]

void x_Assign ( CDbtag dst,
const CDbtag src 
)
inline

◆ x_Assign() [3/7]

void x_Assign ( CGiimport_id dst,
const CGiimport_id src 
)
inline

◆ x_Assign() [4/7]

void x_Assign ( CObject_id dst,
const CObject_id src 
)
inline

◆ x_Assign() [5/7]

void x_Assign ( CPatent_seq_id dst,
const CPatent_seq_id src 
)
inline

◆ x_Assign() [6/7]

void x_Assign ( CPDB_seq_id dst,
const CPDB_seq_id src 
)
inline

◆ x_Assign() [7/7]

void x_Assign ( CTextseq_id dst,
const CTextseq_id src 
)
inline

◆ x_GetLabel_Content()

static void x_GetLabel_Content ( const CSeq_id id,
string label,
CSeq_id::TLabelFlags  flags,
int version 
)
inlinestatic

◆ x_GetLabel_Type()

static void x_GetLabel_Type ( const CSeq_id id,
string label,
CSeq_id::TLabelFlags  flags 
)
inlinestatic

Variable Documentation

◆ kBVSizes

const bm::bvector ::size_type kBVSizes[kMaxSmallSpecialDigits+1]
static
Initial value:
= {
1,
10,
100,
1000,
10000,
100000,
1000000,
10000000,
100000000,
1000000000
}

Definition at line 873 of file Seq_id.cpp.

Referenced by SAccGuide::x_AddSpecial(), and SAccGuide::x_SplitSpecial().

◆ kDigits

const char kDigits[] = "0123456789"
static

◆ kMaxSmallSpecialDigits

const unsigned int kMaxSmallSpecialDigits = 9
static

Definition at line 872 of file Seq_id.cpp.

Referenced by SAccGuide::x_AddSpecial(), and SAccGuide::x_SplitSpecial().

◆ kUnrecognized

const SAccGuide::TAccInfo kUnrecognized = static_cast<SAccGuide::TAccInfo>(-1)
static

Definition at line 971 of file Seq_id.cpp.

Referenced by SAccGuide::AddRule(), and SAccGuide::SHints::FindAccInfo().

◆ s_Guide

CSafeStatic<CRef<SAccGuide> > s_Guide(s_CreateGuide, NULL) ( s_CreateGuide  ,
NULL   
)
static

◆ s_TextId

const char* const s_TextId[CSeq_id::e_MaxChoice+1]
static
Initial value:
=
{
"???" ,
"lcl",
"bbs",
"bbm",
"gim",
"gb",
"emb",
"pir",
"sp",
"pat",
"ref",
"gnl",
"gi",
"dbj",
"prf",
"pdb",
"tpg",
"tpe",
"tpd",
"gpp",
"nat",
""
}

Definition at line 572 of file Seq_id.cpp.

Referenced by CSeq_id::WhichFastaTag(), CSeq_id::WriteAsFasta(), x_GetLabel_Type(), and CSeq_id::x_Init().

◆ sc_AccInfoArray

const TAccInfoMapEntry sc_AccInfoArray[]
static

Definition at line 647 of file Seq_id.cpp.

◆ sc_ChoiceArray

const TChoiceMapEntry sc_ChoiceArray[]
static

Definition at line 526 of file Seq_id.cpp.

◆ sc_SupportedRawDbtags

const char* sc_SupportedRawDbtags[]
static
Initial value:
= {
"ATGC",
"BCMHGSC",
"BERKELEY",
"CELERA",
"GSDB",
"HOOD",
"LANLCHGS",
"LRG",
"MIPS",
"NCBI_EXT_ACC",
"NCBI_GENOMES",
"NCBI_MITO",
"PGEC",
"PID",
"SGD",
"SHGC",
"SRA",
"TIGR",
"UOKNOR",
"UWGC",
"WASHU",
"WIBR",
"WUGSC",
"dbGSS",
"dbSTS"
}

Definition at line 96 of file Seq_id.cpp.

Modified on Sat May 18 11:40:03 2024 by modify_doxy.py rev. 669887