NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Functions | Variables
wgs_client.cpp File Reference
#include <ncbi_pch.hpp>
#include "wgs_client.hpp"
#include "pubseq_gateway.hpp"
#include "pubseq_gateway_logging.hpp"
#include <objects/seqset/seqset__.hpp>
#include <objects/seqsplit/ID2S_Split_Info.hpp>
#include <sra/readers/sra/wgsresolver.hpp>
#include <objects/id2/ID2_Blob_Id.hpp>
#include <objects/id2/ID2_Blob_State.hpp>
+ Include dependency graph for wgs_client.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CIndexUpdateThread
 

Typedefs

typedef int TAllowSeqType
 

Enumerations

enum  EAddMasterDescr { eAddMasterDescr_none , eAddMasterDescr_detached , eAddMasterDescr_all }
 
enum  EResolveMaster {
  eResolveMaster_never , eResolveMaster_without_gi , eResolveMaster_always , eResolveMaster_never ,
  eResolveMaster_without_gi , eResolveMaster_always
}
 
enum  EAlligSeqType { fAllow_contig = 1 , fAllow_scaffold = 2 , fAllow_protein = 4 }
 
enum  EBlobType {
  eBlobType_none , eBlobType_Text , eBlobType_Binary , eBlobType_contig = 1 ,
  eBlobType_scaffold = 2 , eBlobType_protein = 3
}
 
enum  EBlobIdBits { eBlobIdBits_type = 2 , eBlobIdBits_letter = 5 , eBlobIdBits_digit = 4 }
 

Functions

 BEGIN_NAMESPACE (psg)
 
 BEGIN_NAMESPACE (wgs)
 
 USING_SCOPE (objects)
 
 NCBI_PARAM_DECL (bool, WGS, FILTER_ALL)
 
 NCBI_PARAM_DEF_EX (bool, WGS, FILTER_ALL, false, eParam_NoThread, WGS_FILTER_ALL)
 
 NCBI_PARAM_DECL (bool, WGS, SPLIT_FEATURES)
 
 NCBI_PARAM_DEF (bool, WGS, SPLIT_FEATURES, true)
 
 NCBI_PARAM_DECL (bool, WGS, KEEP_REPLACED)
 
 NCBI_PARAM_DEF (bool, WGS, KEEP_REPLACED, true)
 
 NCBI_PARAM_DECL (bool, WGS, KEEP_MIGRATED)
 
 NCBI_PARAM_DEF (bool, WGS, KEEP_MIGRATED, false)
 
 NCBI_PARAM_DECL (bool, WGS, KEEP_EXTERNAL)
 
 NCBI_PARAM_DEF (bool, WGS, KEEP_EXTERNAL, true)
 
 NCBI_PARAM_DECL (string, WGS, ADD_MASTER_DESCR)
 
 NCBI_PARAM_DEF (string, WGS, ADD_MASTER_DESCR, "detached")
 
 NCBI_PARAM_DECL (bool, WGS, MARK_MASTER_DESCR)
 
 NCBI_PARAM_DEF (bool, WGS, MARK_MASTER_DESCR, false)
 
static bool s_SplitFeatures (void)
 
static bool s_KeepReplaced (void)
 
static bool s_KeepMigrated (void)
 
static EAddMasterDescr s_ProcessAddMasterDescr (void)
 
static EAddMasterDescr s_AddMasterDescrLevel (void)
 
static bool s_AddMasterDescrContig ()
 
static bool s_AddMasterDescrScaffold ()
 
static bool s_AddMasterDescrProtein ()
 
static bool s_MarkMasterDescr (void)
 
static bool s_IsEnabledOSGSat (CWGSClient::TEnabledFlags enabled_flags, Int4 sat)
 
static bool s_IsOSGSat (Int4 sat)
 
static bool s_Skip (CTempString &str, char c)
 
static bool s_IsValidIntChar (char c)
 
template<class Int >
static bool s_ParseInt (CTempString &str, Int &v)
 
static bool s_IsOSGBlob (Int4 sat, Int4, Int4)
 
static bool s_ParseOSGBlob (CTempString &s, Int4 &sat, Int4 &subsat, Int4 &satkey)
 
static void s_FormatBlobId (ostream &s, const CID2_Blob_Id &blob_id)
 
static bool IsWGSGeneral (const CDbtag &dbtag)
 
static bool IsWGSAccession (const string &acc, const CTextseq_id &id, TAllowSeqType allow_seq_type)
 
static bool IsWGSProtAccession (const CTextseq_id &id)
 
static bool IsWGSAccession (const CTextseq_id &id)
 
static int s_GBStateToID2 (NCBI_gb_state gb_state)
 
 END_NAMESPACE (wgs)
 
 END_NAMESPACE (psg)
 

Variables

 BEGIN_NCBI_NAMESPACE
 
static const EResolveMaster kResolveMaster = eResolveMaster_never
 
static const char kSubSatSeparator = '/'
 
static const int kOSG_Sat_WGS_min = 1000
 
static const int kOSG_Sat_WGS_max = 1130
 
static const int kOSG_Sat_SNP_min = 2001
 
static const int kOSG_Sat_SNP_max = 3999
 
static const int kOSG_Sat_CDD_min = 8087
 
static const int kOSG_Sat_CDD_max = 8088
 
static const size_t kTypePrefixLen = 4
 
static const size_t kNumLettersV1 = 4
 
static const size_t kNumLettersV2 = 6
 
static const size_t kVersionDigits = 2
 
static const size_t kPrefixLenV1 = kNumLettersV1 + kVersionDigits
 
static const size_t kPrefixLenV2 = kNumLettersV2 + kVersionDigits
 
static const size_t kMinRowDigitsV1 = 6
 
static const size_t kMaxRowDigitsV1 = 8
 
static const size_t kMinRowDigitsV2 = 7
 
static const size_t kMaxRowDigitsV2 = 9
 
static const size_t kMinProtAccLen = 8
 
static const size_t kMaxProtAccLen = 10
 
static const int kBlobIdV1Sat = 1000
 
static const int kBlobIdV2SatMin = 1001
 
static const int kBlobIdV2SatMax = 1129
 
static const int kBlobIdV2VersionScaffold = 0
 
static const int kBlobIdV2VersionProtein = 1
 
static const int kBlobIdV2VersionContig = 2
 
 BEGIN_LOCAL_NAMESPACE
 
 END_LOCAL_NAMESPACE
 
 END_NCBI_NAMESPACE
 

Typedef Documentation

◆ TAllowSeqType

typedef int TAllowSeqType

Definition at line 306 of file wgs_client.cpp.

Enumeration Type Documentation

◆ EAddMasterDescr

Enumerator
eAddMasterDescr_none 
eAddMasterDescr_detached 
eAddMasterDescr_all 

Definition at line 96 of file wgs_client.cpp.

◆ EAlligSeqType

Enumerator
fAllow_contig 
fAllow_scaffold 
fAllow_protein 

Definition at line 301 of file wgs_client.cpp.

◆ EBlobIdBits

Enumerator
eBlobIdBits_type 
eBlobIdBits_letter 
eBlobIdBits_digit 

Definition at line 447 of file wgs_client.cpp.

◆ EBlobType

enum EBlobType
Enumerator
eBlobType_none 
eBlobType_Text 
eBlobType_Binary 
eBlobType_contig 
eBlobType_scaffold 
eBlobType_protein 

Definition at line 442 of file wgs_client.cpp.

◆ EResolveMaster

Enumerator
eResolveMaster_never 
eResolveMaster_without_gi 
eResolveMaster_always 
eResolveMaster_never 
eResolveMaster_without_gi 
eResolveMaster_always 

Definition at line 142 of file wgs_client.cpp.

Function Documentation

◆ BEGIN_NAMESPACE() [1/2]

BEGIN_NAMESPACE ( psg  )

◆ BEGIN_NAMESPACE() [2/2]

BEGIN_NAMESPACE ( wgs  )

◆ END_NAMESPACE() [1/2]

END_NAMESPACE ( psg  )

◆ END_NAMESPACE() [2/2]

END_NAMESPACE ( wgs  )

◆ IsWGSAccession() [1/2]

static bool IsWGSAccession ( const CTextseq_id id)
static

◆ IsWGSAccession() [2/2]

static bool IsWGSAccession ( const string acc,
const CTextseq_id id,
TAllowSeqType  allow_seq_type 
)
static

◆ IsWGSGeneral()

static bool IsWGSGeneral ( const CDbtag dbtag)
static

◆ IsWGSProtAccession()

static bool IsWGSProtAccession ( const CTextseq_id id)
static

Definition at line 382 of file wgs_client.cpp.

References kMaxProtAccLen, and kMinProtAccLen.

Referenced by IsWGSAccession().

◆ NCBI_PARAM_DECL() [1/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
FILTER_ALL   
)

◆ NCBI_PARAM_DECL() [2/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
KEEP_EXTERNAL   
)

◆ NCBI_PARAM_DECL() [3/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
KEEP_MIGRATED   
)

◆ NCBI_PARAM_DECL() [4/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
KEEP_REPLACED   
)

◆ NCBI_PARAM_DECL() [5/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
MARK_MASTER_DESCR   
)

◆ NCBI_PARAM_DECL() [6/7]

NCBI_PARAM_DECL ( bool  ,
WGS  ,
SPLIT_FEATURES   
)

◆ NCBI_PARAM_DECL() [7/7]

NCBI_PARAM_DECL ( string  ,
WGS  ,
ADD_MASTER_DESCR   
)

◆ NCBI_PARAM_DEF() [1/6]

NCBI_PARAM_DEF ( bool  ,
WGS  ,
KEEP_EXTERNAL  ,
true   
)

◆ NCBI_PARAM_DEF() [2/6]

NCBI_PARAM_DEF ( bool  ,
WGS  ,
KEEP_MIGRATED  ,
false   
)

◆ NCBI_PARAM_DEF() [3/6]

NCBI_PARAM_DEF ( bool  ,
WGS  ,
KEEP_REPLACED  ,
true   
)

◆ NCBI_PARAM_DEF() [4/6]

NCBI_PARAM_DEF ( bool  ,
WGS  ,
MARK_MASTER_DESCR  ,
false   
)

◆ NCBI_PARAM_DEF() [5/6]

NCBI_PARAM_DEF ( bool  ,
WGS  ,
SPLIT_FEATURES  ,
true   
)

◆ NCBI_PARAM_DEF() [6/6]

NCBI_PARAM_DEF ( string  ,
WGS  ,
ADD_MASTER_DESCR  ,
"detached"   
)

◆ NCBI_PARAM_DEF_EX()

NCBI_PARAM_DEF_EX ( bool  ,
WGS  ,
FILTER_ALL  ,
false  ,
eParam_NoThread  ,
WGS_FILTER_ALL   
)

◆ s_AddMasterDescrContig()

static bool s_AddMasterDescrContig ( )
static

Definition at line 117 of file wgs_client.cpp.

References eAddMasterDescr_all, and s_AddMasterDescrLevel().

Referenced by CWGSClient::GetWGSData().

◆ s_AddMasterDescrLevel()

static EAddMasterDescr s_AddMasterDescrLevel ( void  )
static

◆ s_AddMasterDescrProtein()

static bool s_AddMasterDescrProtein ( )
static

Definition at line 129 of file wgs_client.cpp.

References eAddMasterDescr_none, and s_AddMasterDescrLevel().

Referenced by CWGSClient::GetWGSData().

◆ s_AddMasterDescrScaffold()

static bool s_AddMasterDescrScaffold ( )
static

Definition at line 123 of file wgs_client.cpp.

References eAddMasterDescr_none, and s_AddMasterDescrLevel().

Referenced by CWGSClient::GetWGSData().

◆ s_FormatBlobId()

static void s_FormatBlobId ( ostream &  s,
const CID2_Blob_Id blob_id 
)
static

◆ s_GBStateToID2()

static int s_GBStateToID2 ( NCBI_gb_state  gb_state)
static

◆ s_IsEnabledOSGSat()

static bool s_IsEnabledOSGSat ( CWGSClient::TEnabledFlags  enabled_flags,
Int4  sat 
)
inlinestatic

◆ s_IsOSGBlob()

static bool s_IsOSGBlob ( Int4  sat,
Int4  ,
Int4   
)
static

Definition at line 223 of file wgs_client.cpp.

References s_IsOSGSat().

Referenced by CWGSClient::IsOSGBlob(), and s_ParseOSGBlob().

◆ s_IsOSGSat()

static bool s_IsOSGSat ( Int4  sat)
static

Definition at line 185 of file wgs_client.cpp.

References CWGSClient::fEnabledAll, and s_IsEnabledOSGSat().

Referenced by s_IsOSGBlob(), and s_ParseOSGBlob().

◆ s_IsValidIntChar()

static bool s_IsValidIntChar ( char  c)
inlinestatic

Definition at line 201 of file wgs_client.cpp.

Referenced by s_ParseInt().

◆ s_KeepMigrated()

static bool s_KeepMigrated ( void  )
static

Definition at line 90 of file wgs_client.cpp.

References NCBI_PARAM_TYPE, and rapidjson::value.

Referenced by CWGSClient::GetSeqInfoBySeqId(), and CWGSClient::ResolveSeqId().

◆ s_KeepReplaced()

static bool s_KeepReplaced ( void  )
static

Definition at line 84 of file wgs_client.cpp.

References NCBI_PARAM_TYPE, and rapidjson::value.

Referenced by CWGSClient::GetWGSDb().

◆ s_MarkMasterDescr()

static bool s_MarkMasterDescr ( void  )
static

Definition at line 135 of file wgs_client.cpp.

References NCBI_PARAM_TYPE, and rapidjson::value.

Referenced by CWGSClient::GetWGSData().

◆ s_ParseInt()

template<class Int >
static bool s_ParseInt ( CTempString str,
Int &  v 
)
static

◆ s_ParseOSGBlob()

static bool s_ParseOSGBlob ( CTempString s,
Int4 sat,
Int4 subsat,
Int4 satkey 
)
static

◆ s_ProcessAddMasterDescr()

static EAddMasterDescr s_ProcessAddMasterDescr ( void  )
static

◆ s_Skip()

static bool s_Skip ( CTempString str,
char  c 
)
static

Definition at line 191 of file wgs_client.cpp.

References str().

Referenced by CWGSClient::ParsePSGId2Info(), and s_ParseOSGBlob().

◆ s_SplitFeatures()

static bool s_SplitFeatures ( void  )
static

Definition at line 78 of file wgs_client.cpp.

References NCBI_PARAM_TYPE, and rapidjson::value.

Referenced by CWGSClient::GetWGSData().

◆ USING_SCOPE()

USING_SCOPE ( objects  )

Variable Documentation

◆ BEGIN_LOCAL_NAMESPACE

BEGIN_LOCAL_NAMESPACE

Definition at line 458 of file wgs_client.cpp.

◆ BEGIN_NCBI_NAMESPACE

BEGIN_NCBI_NAMESPACE

Definition at line 46 of file wgs_client.cpp.

◆ END_LOCAL_NAMESPACE

END_LOCAL_NAMESPACE

Definition at line 495 of file wgs_client.cpp.

◆ END_NCBI_NAMESPACE

END_NCBI_NAMESPACE

Definition at line 1999 of file wgs_client.cpp.

◆ kBlobIdV1Sat

const int kBlobIdV1Sat = 1000
static

Definition at line 436 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kBlobIdV2SatMax

const int kBlobIdV2SatMax = 1129
static

Definition at line 438 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kBlobIdV2SatMin

const int kBlobIdV2SatMin = 1001
static

Definition at line 437 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kBlobIdV2VersionContig

const int kBlobIdV2VersionContig = 2
static

Definition at line 441 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kBlobIdV2VersionProtein

const int kBlobIdV2VersionProtein = 1
static

Definition at line 440 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kBlobIdV2VersionScaffold

const int kBlobIdV2VersionScaffold = 0
static

Definition at line 439 of file wgs_client.cpp.

Referenced by CWGSClient::GetBlobId(), and CWGSClient::ResolveBlobId().

◆ kMaxProtAccLen

const size_t kMaxProtAccLen = 10
static

Definition at line 282 of file wgs_client.cpp.

Referenced by IsWGSProtAccession(), and CWGSClient::ResolveProtAcc().

◆ kMaxRowDigitsV1

const size_t kMaxRowDigitsV1 = 8
static

Definition at line 277 of file wgs_client.cpp.

Referenced by IsWGSAccession(), and CWGSClient::ResolveWGSAcc().

◆ kMaxRowDigitsV2

const size_t kMaxRowDigitsV2 = 9
static

Definition at line 279 of file wgs_client.cpp.

Referenced by IsWGSAccession(), and CWGSClient::ResolveWGSAcc().

◆ kMinProtAccLen

const size_t kMinProtAccLen = 8
static

Definition at line 281 of file wgs_client.cpp.

Referenced by IsWGSProtAccession(), and CWGSClient::ResolveProtAcc().

◆ kMinRowDigitsV1

const size_t kMinRowDigitsV1 = 6
static

Definition at line 276 of file wgs_client.cpp.

Referenced by IsWGSAccession(), and CWGSClient::ResolveWGSAcc().

◆ kMinRowDigitsV2

const size_t kMinRowDigitsV2 = 7
static

Definition at line 278 of file wgs_client.cpp.

◆ kNumLettersV1

const size_t kNumLettersV1 = 4
static

◆ kNumLettersV2

const size_t kNumLettersV2 = 6
static

◆ kOSG_Sat_CDD_max

const int kOSG_Sat_CDD_max = 8088
static

Definition at line 155 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kOSG_Sat_CDD_min

const int kOSG_Sat_CDD_min = 8087
static

Definition at line 154 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kOSG_Sat_SNP_max

const int kOSG_Sat_SNP_max = 3999
static

Definition at line 153 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kOSG_Sat_SNP_min

const int kOSG_Sat_SNP_min = 2001
static

Definition at line 152 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kOSG_Sat_WGS_max

const int kOSG_Sat_WGS_max = 1130
static

Definition at line 151 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kOSG_Sat_WGS_min

const int kOSG_Sat_WGS_min = 1000
static

Definition at line 150 of file wgs_client.cpp.

Referenced by s_IsEnabledOSGSat().

◆ kPrefixLenV1

const size_t kPrefixLenV1 = kNumLettersV1 + kVersionDigits
static

◆ kPrefixLenV2

const size_t kPrefixLenV2 = kNumLettersV2 + kVersionDigits
static

◆ kResolveMaster

const EResolveMaster kResolveMaster = eResolveMaster_never
static

Definition at line 147 of file wgs_client.cpp.

Referenced by CWGSClient::ResolveGi(), and CWGSClient::ResolveWGSAcc().

◆ kSubSatSeparator

const char kSubSatSeparator = '/'
static

Definition at line 149 of file wgs_client.cpp.

Referenced by s_FormatBlobId(), and s_ParseOSGBlob().

◆ kTypePrefixLen

const size_t kTypePrefixLen = 4
static

Definition at line 270 of file wgs_client.cpp.

Referenced by IsWGSGeneral(), and CWGSClient::ResolveGeneral().

◆ kVersionDigits

const size_t kVersionDigits = 2
static

Definition at line 273 of file wgs_client.cpp.

Referenced by IsWGSAccession(), and CWGSClient::ResolveWGSAcc().

Modified on Fri Sep 20 14:57:10 2024 by modify_doxy.py rev. 669887