NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions | Variables
id2snp_impl.cpp File Reference
#include <ncbi_pch.hpp>
#include <sra/data_loaders/snp/impl/id2snp_impl.hpp>
#include <objects/id2/id2processor_interface.hpp>
#include <sra/data_loaders/snp/id2snp_params.h>
#include <sra/readers/sra/snpread.hpp>
#include <sra/error_codes.hpp>
#include <corelib/reader_writer.hpp>
#include <corelib/rwstream.hpp>
#include <util/compress/zlib.hpp>
#include <serial/objostrasnb.hpp>
#include <serial/serial.hpp>
#include <objects/id2/id2__.hpp>
#include <objects/seqsplit/seqsplit__.hpp>
#include <objects/general/general__.hpp>
#include <objects/seqloc/seqloc__.hpp>
#include <objects/seqres/seqres__.hpp>
#include <objects/seq/Bioseq.hpp>
#include <objects/seq/Seq_annot.hpp>
#include <objects/seq/Annot_descr.hpp>
#include <objects/seq/Annotdesc.hpp>
#include <objects/seqset/Seq_entry.hpp>
#include <objects/seqsplit/ID2S_Split_Info.hpp>
#include <objects/seqsplit/ID2S_Chunk.hpp>
#include <objmgr/bioseq_handle.hpp>
#include <objmgr/annot_selector.hpp>
+ Include dependency graph for id2snp_impl.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  COSSWriter
 

Macros

#define NCBI_USE_ERRCODE_X   ID2SNPProcessor
 
#define TRACE_PROCESSING
 
#define DEFAULT_VDB_CACHE_SIZE   10
 
#define DEFAULT_INDEX_UPDATE_TIME   600
 
#define DEFAULT_COMPRESS_DATA   CID2SNPContext::eCompressData_some
 
#define START_TRACE()   do { if(s_DebugLevel()>0)sw.Restart(); } while(0)
 
#define TRACE_X(t, l, m)
 

Enumerations

enum  EResolveMaster {
  eResolveMaster_never , eResolveMaster_without_gi , eResolveMaster_always , eResolveMaster_never ,
  eResolveMaster_without_gi , eResolveMaster_always
}
 
enum  EDebugLevel {
  eTraceError = 1 , eTraceOpen = 2 , eTraceConn = 4 , eTraceASN = 5 ,
  eTraceASNData = 8 , eDebug_none = 0 , eDebug_error = 1 , eDebug_open = 2 ,
  eDebug_request = 5 , eDebug_replies = 6 , eDebug_resolve = 7 , eDebug_data = 8 ,
  eDebug_all = 9
}
 

Functions

 NCBI_DEFINE_ERR_SUBCODE_X (24)
 
 BEGIN_NAMESPACE (objects)
 
 NCBI_PARAM_DECL (bool, ID2SNP, ENABLE)
 
 NCBI_PARAM_DEF_EX (bool, ID2SNP, ENABLE, true, eParam_NoThread, ID2SNP_ENABLE)
 
 NCBI_PARAM_DECL (int, ID2SNP, DEBUG)
 
 NCBI_PARAM_DEF_EX (int, ID2SNP, DEBUG, eDebug_error, eParam_NoThread, ID2SNP_DEBUG)
 
 NCBI_PARAM_DECL (bool, ID2SNP, FILTER_ALL)
 
 NCBI_PARAM_DEF_EX (bool, ID2SNP, FILTER_ALL, true, eParam_NoThread, ID2SNP_FILTER_ALL)
 
static bool s_Enabled (void)
 
static int s_DebugLevel (void)
 
static bool s_DebugEnabled (EDebugLevel level)
 
static bool s_FilterAll (void)
 
template<class Cont >
Cont::value_type::TObjectType & sx_AddNew (Cont &cont)
 
void sx_SetZoomLevel (CSeq_annot &annot, int zoom_level)
 
bool IsValidNAIndex (size_t na_index)
 
bool IsValidNAVersion (size_t na_version)
 
bool IsValidSeqIndex (size_t seq_index)
 
bool IsValidFilterIndex (size_t filter_index)
 
string GetNAAccession (const SSNPDbTrackInfo &track)
 
string FormatTrack (const SSNPDbTrackInfo &track)
 
SSNPDbTrackInfo ParseTrack (CTempString acc_filter)
 
CNcbiOstreamoperator<< (CNcbiOstream &out, const CID2SNPProcessor_Impl::SSNPEntryInfo &seq)
 
size_t sx_GetSize (const CID2_Reply_Data &data)
 
template<class Values >
bool sx_HasNonZero (const Values &values, TSeqPos index, TSeqPos count)
 
template<class TValues >
void sx_AddBits2 (vector< char > &bits, TSeqPos bit_values, TSeqPos pos_index, const TValues &values)
 
static void sx_AddBits (vector< char > &bits, TSeqPos kChunkSize, const CSeq_graph &graph)
 
 END_NAMESPACE (objects)
 

Variables

 BEGIN_NCBI_NAMESPACE
 
static const EResolveMaster kResolveMaster = eResolveMaster_never
 
const int kSNPSatBase = 2000
 
const int kNAIndexDigits = 9
 
const int kNAIndexMin = 1
 
const int kNAIndexMax = 999999999
 
const int kNAVersionDigitsMin = 1
 
const int kNAVersionDigitsMax = 2
 
const int kNALengthMin = 2 + kNAIndexDigits + 1 + kNAVersionDigitsMin
 
const int kNALengthMax = 2 + kNAIndexDigits + 1 + kNAVersionDigitsMax
 
const int kNAVersionMin = 1
 
const int kNAVersionMax = 99
 
const int kSeqIndexCount = 1000000
 
const int kFilterIndexCount = 2000
 
const int kFilterIndexMaxLength = 4
 
static const int kTSEId = 1
 
static const int kChunkIdFeat = 0
 
static const int kChunkIdGraph = 1
 
static const int kChunkIdMul = 2
 
static const TSeqPos kFeatChunkSize = 1000000
 
static const TSeqPos kGraphChunkSize = 10000000
 
 BEGIN_LOCAL_NAMESPACE
 
static CStopWatch sw
 
 END_LOCAL_NAMESPACE
 
 END_NCBI_NAMESPACE
 

Macro Definition Documentation

◆ DEFAULT_COMPRESS_DATA

#define DEFAULT_COMPRESS_DATA   CID2SNPContext::eCompressData_some

Definition at line 79 of file id2snp_impl.cpp.

◆ DEFAULT_INDEX_UPDATE_TIME

#define DEFAULT_INDEX_UPDATE_TIME   600

Definition at line 78 of file id2snp_impl.cpp.

◆ DEFAULT_VDB_CACHE_SIZE

#define DEFAULT_VDB_CACHE_SIZE   10

Definition at line 77 of file id2snp_impl.cpp.

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   ID2SNPProcessor

Definition at line 61 of file id2snp_impl.cpp.

◆ START_TRACE

#define START_TRACE ( )    do { if(s_DebugLevel()>0)sw.Restart(); } while(0)

Definition at line 279 of file id2snp_impl.cpp.

◆ TRACE_PROCESSING

#define TRACE_PROCESSING

Definition at line 67 of file id2snp_impl.cpp.

◆ TRACE_X

#define TRACE_X (   t,
  l,
 
)
Value:
do { \
if ( s_DebugEnabled(l) ) { \
LOG_POST_X(t, Info<<sw.Elapsed()<<": ID2SNP: "<<m); \
} \
} while(0)
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
Definition: ncbitime.hpp:2775
static CStopWatch sw
static bool s_DebugEnabled(EDebugLevel level)
EIPRangeType t
Definition: ncbi_localip.c:101

Definition at line 286 of file id2snp_impl.cpp.

Enumeration Type Documentation

◆ EDebugLevel

Enumerator
eTraceError 
eTraceOpen 
eTraceConn 
eTraceASN 
eTraceASNData 
eDebug_none 
eDebug_error 
eDebug_open 
eDebug_request 
eDebug_replies 
eDebug_resolve 
eDebug_data 
eDebug_all 

Definition at line 82 of file id2snp_impl.cpp.

◆ EResolveMaster

Enumerator
eResolveMaster_never 
eResolveMaster_without_gi 
eResolveMaster_always 
eResolveMaster_never 
eResolveMaster_without_gi 
eResolveMaster_always 

Definition at line 69 of file id2snp_impl.cpp.

Function Documentation

◆ BEGIN_NAMESPACE()

BEGIN_NAMESPACE ( objects  )

◆ END_NAMESPACE()

END_NAMESPACE ( objects  )

◆ FormatTrack()

string FormatTrack ( const SSNPDbTrackInfo track)

◆ GetNAAccession()

string GetNAAccession ( const SSNPDbTrackInfo track)

◆ IsValidFilterIndex()

bool IsValidFilterIndex ( size_t  filter_index)

Definition at line 211 of file id2snp_impl.cpp.

References kFilterIndexCount.

Referenced by ParseTrack(), and CID2SNPProcessor_Impl::x_ResolveBlobId().

◆ IsValidNAIndex()

bool IsValidNAIndex ( size_t  na_index)

Definition at line 193 of file id2snp_impl.cpp.

References kNAIndexMax, and kNAIndexMin.

Referenced by ParseTrack(), and CID2SNPProcessor_Impl::x_ResolveBlobId().

◆ IsValidNAVersion()

bool IsValidNAVersion ( size_t  na_version)

Definition at line 199 of file id2snp_impl.cpp.

References kNAVersionMax, and kNAVersionMin.

Referenced by ParseTrack().

◆ IsValidSeqIndex()

bool IsValidSeqIndex ( size_t  seq_index)

Definition at line 205 of file id2snp_impl.cpp.

References kSeqIndexCount.

Referenced by CID2SNPProcessor_Impl::x_ResolveBlobId().

◆ NCBI_DEFINE_ERR_SUBCODE_X()

NCBI_DEFINE_ERR_SUBCODE_X ( 24  )

◆ NCBI_PARAM_DECL() [1/3]

NCBI_PARAM_DECL ( bool  ,
ID2SNP  ,
ENABLE   
)

◆ NCBI_PARAM_DECL() [2/3]

NCBI_PARAM_DECL ( bool  ,
ID2SNP  ,
FILTER_ALL   
)

◆ NCBI_PARAM_DECL() [3/3]

NCBI_PARAM_DECL ( int  ,
ID2SNP  ,
DEBUG   
)

◆ NCBI_PARAM_DEF_EX() [1/3]

NCBI_PARAM_DEF_EX ( bool  ,
ID2SNP  ,
ENABLE  ,
true  ,
eParam_NoThread  ,
ID2SNP_ENABLE   
)

◆ NCBI_PARAM_DEF_EX() [2/3]

NCBI_PARAM_DEF_EX ( bool  ,
ID2SNP  ,
FILTER_ALL  ,
true  ,
eParam_NoThread  ,
ID2SNP_FILTER_ALL   
)

◆ NCBI_PARAM_DEF_EX() [3/3]

NCBI_PARAM_DEF_EX ( int  ,
ID2SNP  ,
DEBUG  ,
eDebug_error  ,
eParam_NoThread  ,
ID2SNP_DEBUG   
)

◆ operator<<()

◆ ParseTrack()

SSNPDbTrackInfo ParseTrack ( CTempString  acc_filter)

◆ s_DebugEnabled()

static bool s_DebugEnabled ( EDebugLevel  level)
inlinestatic

Definition at line 126 of file id2snp_impl.cpp.

References s_DebugLevel().

◆ s_DebugLevel()

static int s_DebugLevel ( void  )
inlinestatic

Definition at line 119 of file id2snp_impl.cpp.

References DEBUG, NCBI_PARAM_TYPE, and ncbi::grid::netcache::search::s_Value().

Referenced by s_DebugEnabled().

◆ s_Enabled()

static bool s_Enabled ( void  )
inlinestatic

Definition at line 112 of file id2snp_impl.cpp.

References NCBI_PARAM_TYPE, and ncbi::grid::netcache::search::s_Value().

◆ s_FilterAll()

static bool s_FilterAll ( void  )
inlinestatic

Definition at line 132 of file id2snp_impl.cpp.

References NCBI_PARAM_TYPE, and ncbi::grid::netcache::search::s_Value().

◆ sx_AddBits()

static void sx_AddBits ( vector< char > &  bits,
TSeqPos  kChunkSize,
const CSeq_graph graph 
)
static

◆ sx_AddBits2()

template<class TValues >
void sx_AddBits2 ( vector< char > &  bits,
TSeqPos  bit_values,
TSeqPos  pos_index,
const TValues values 
)

Definition at line 680 of file id2snp_impl.cpp.

References map_checker< Container >::size(), and sx_HasNonZero().

Referenced by sx_AddBits().

◆ sx_AddNew()

template<class Cont >
Cont::value_type::TObjectType& sx_AddNew ( Cont &  cont)

◆ sx_GetSize()

size_t sx_GetSize ( const CID2_Reply_Data data)

◆ sx_HasNonZero()

template<class Values >
bool sx_HasNonZero ( const Values &  values,
TSeqPos  index,
TSeqPos  count 
)

Definition at line 667 of file id2snp_impl.cpp.

References i, and min().

Referenced by sx_AddBits2(), and CID2SNPProcessor_Impl::x_LoadBlob().

◆ sx_SetZoomLevel()

void sx_SetZoomLevel ( CSeq_annot annot,
int  zoom_level 
)

Variable Documentation

◆ BEGIN_LOCAL_NAMESPACE

BEGIN_LOCAL_NAMESPACE

Definition at line 173 of file id2snp_impl.cpp.

◆ BEGIN_NCBI_NAMESPACE

BEGIN_NCBI_NAMESPACE

Definition at line 59 of file id2snp_impl.cpp.

◆ END_LOCAL_NAMESPACE

END_LOCAL_NAMESPACE

Definition at line 340 of file id2snp_impl.cpp.

◆ END_NCBI_NAMESPACE

END_NCBI_NAMESPACE

Definition at line 1081 of file id2snp_impl.cpp.

◆ kChunkIdFeat

const int kChunkIdFeat = 0
static

◆ kChunkIdGraph

const int kChunkIdGraph = 1
static

◆ kChunkIdMul

const int kChunkIdMul = 2
static

◆ kFeatChunkSize

const TSeqPos kFeatChunkSize = 1000000
static

◆ kFilterIndexCount

const int kFilterIndexCount = 2000

Definition at line 160 of file id2snp_impl.cpp.

Referenced by IsValidFilterIndex().

◆ kFilterIndexMaxLength

const int kFilterIndexMaxLength = 4

Definition at line 161 of file id2snp_impl.cpp.

Referenced by ParseTrack().

◆ kGraphChunkSize

const TSeqPos kGraphChunkSize = 10000000
static

◆ kNAIndexDigits

const int kNAIndexDigits = 9

Definition at line 150 of file id2snp_impl.cpp.

Referenced by FormatTrack(), GetNAAccession(), and ParseTrack().

◆ kNAIndexMax

const int kNAIndexMax = 999999999

Definition at line 152 of file id2snp_impl.cpp.

Referenced by IsValidNAIndex().

◆ kNAIndexMin

const int kNAIndexMin = 1

Definition at line 151 of file id2snp_impl.cpp.

Referenced by IsValidNAIndex().

◆ kNALengthMax

const int kNALengthMax = 2 + kNAIndexDigits + 1 + kNAVersionDigitsMax

Definition at line 156 of file id2snp_impl.cpp.

Referenced by ParseTrack().

◆ kNALengthMin

const int kNALengthMin = 2 + kNAIndexDigits + 1 + kNAVersionDigitsMin

Definition at line 155 of file id2snp_impl.cpp.

Referenced by ParseTrack().

◆ kNAVersionDigitsMax

const int kNAVersionDigitsMax = 2

Definition at line 154 of file id2snp_impl.cpp.

◆ kNAVersionDigitsMin

const int kNAVersionDigitsMin = 1

Definition at line 153 of file id2snp_impl.cpp.

◆ kNAVersionMax

const int kNAVersionMax = 99

Definition at line 158 of file id2snp_impl.cpp.

Referenced by IsValidNAVersion(), and CID2SNPProcessor_Impl::x_ResolveBlobId().

◆ kNAVersionMin

const int kNAVersionMin = 1

Definition at line 157 of file id2snp_impl.cpp.

Referenced by IsValidNAVersion(), and CID2SNPProcessor_Impl::x_ResolveBlobId().

◆ kResolveMaster

const EResolveMaster kResolveMaster = eResolveMaster_never
static

Definition at line 74 of file id2snp_impl.cpp.

◆ kSeqIndexCount

const int kSeqIndexCount = 1000000

◆ kSNPSatBase

const int kSNPSatBase = 2000

◆ kTSEId

const int kTSEId = 1
static

◆ sw

CStopWatch sw
static

Definition at line 277 of file id2snp_impl.cpp.

Referenced by CBuildDatabase::AddSequences(), BOOST_AUTO_TEST_CASE(), CBuildDatabase::Build(), CPhyloTreePS::CalcForces(), CBamFileInfo::CBamFileInfo(), CompressAssembly(), CBDB_Cache::EvaluateTimeLine(), CExecute::Exec(), CMacroWorker::ExecuteMacros(), CFlatFileGenerator::Generate(), CSNPDataLoader_Impl::GetBlobByIdOnce(), GetBlobReader(), CSNPDataLoader_Impl::GetChunkOnce(), CSNPFileInfo::InitializeDb(), CBamRefSeqInfo::LoadAlignChunk(), CSNPDataLoader_Impl::LoadBlob(), CBamRefSeqInfo::LoadMainSplit(), CBamRefSeqInfo::LoadPileupChunk(), CBamRefSeqInfo::LoadSeqChunk(), CBDB_SplitTest::LoadSplitStore(), CBDB_SplitTest::LoadTestSet(), CConnTestThread::Main(), CSeqGraphicWidget::OnDataChanged(), CLBLASTUIDataSource::Open(), CNetBLASTUIDataSource::Open(), CBamUIDataSource::Open(), CGenBankUIDataSource::Open(), CSQLITE3_Cache::Open(), CAlignSort::SAlignExtractor::operator()(), CQueryExecEvalFunc::operator()(), operator<<(), CSequenceInputStats::PrintReport(), CBam2GraphApp::ProcessFile(), CGlCgiImageApplication::ProcessRequest(), CBamIndex::Read(), CBiosampleChkApp::ReadClassMember(), CAsnvalThreadState::ReadClassMember(), CSeqDescrRetrievalJob::Run(), CAnnotMetaDataJob::Run(), CPubmedFetchApplication::Run(), CBlastInputDemoApplication::Run(), CAsnCacheTestApplication::Run(), CCacheIndexCopyApp::Run(), CConcatSeqEntriesApplication::Run(), CAsnCacheDumpSeqIdsApplication::Run(), CAsnSubCacheCreateApplication::Run(), CWalkAsnCacheApplication::Run(), CDemoApp::Run(), CMytestApplication::Run(), CProjBulderApp::Run(), CObjConvProfile::Run(), CSampleNetScheduleClient::Run(), CConvImageApp::Run(), CSubImageApp::Run(), s_GetDBTree(), CSparseGraph::Save(), CCachedTaxon3_impl::SendOrgRefList(), UncomressAndCreate(), CPhyloTreePS::Update(), CAsnvalThreadState::ValidateTraditionally(), CAsnvalThreadState::ValidateWorker(), CThread::WaitForAllThreads(), CBuildDatabase::x_AddRemoteSequences(), CPrimeCacheApplication::x_CacheSeqEntry(), CForceJob::x_Calculate(), CImportFeatTable::x_CreateCommand(), CAlnMultiDSBuilder::x_CreateSparseDataSource(), CComponentSearchJob::x_DoSearch(), CVcfSearchJob::x_DoSearch(), CCrossPanelIR::x_DrawCrossAlignment(), CBuildDatabase::x_DupLocal(), CBlastVdbCmdApp::x_FormatRuntime(), CNAUtils::x_GetAllNAIds(), CNAUtils::x_GetNAMetaData(), CRemoteBlast::x_GetRequestInfoFromRID(), CRemoteBlast::x_GetSubjects(), CBlastVdbCmdApp::x_GetVDBBlastUtil(), CCSRARefSeqInfo::x_LoadRangesStat(), CBlastVdbCmdApp::x_PrintBlastDatabaseInformation(), CBlastVdbCmdApp::x_PrintVDBPaths(), CPrimeCacheApplication::x_Process_Fasta(), CPrimeCacheApplication::x_Process_Ids(), CNetScheduleHandler::x_ProcessMsgBatchSubmit(), CId2FetchApp::x_ProcessRequest(), CBGZFFile::x_ReadBlock(), CPagedFile::x_ReadPage(), CRemoteBlast::x_SendRequest(), CAlignTabExportPage2::x_StartNAAlignNamesJob(), CReadIndexSpeedApp::x_WalkIndex(), and CEditObjectFeaturePropagate::xGetEditCommandAllSequences().

Modified on Sun May 19 04:42:15 2024 by modify_doxy.py rev. 669887