NCBI C++ ToolKit
|
Search Toolkit Book for CGenomicCollectionsService
#include <objects/genomecoll/genomic_collections_cli.hpp>
Classes | |
struct | SAssemblyMode |
Static Public Member Functions | |
static void | AddArguments (CArgDescriptions &arg_desc) |
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) |
Private Member Functions | |
CGenomicCollectionsService (const CGenomicCollectionsService &value) | |
CGenomicCollectionsService & | operator= (const CGenomicCollectionsService &value) |
CRef< CGCClient_AssembliesForSequences > | x_FindAssembliesBySequences (const list< string > &sequence_acc, int filter, CGCClient_GetAssemblyBySequenceRequest::ESort sort, bool top_only, bool with_roles) |
void | x_ConfigureConnection () |
void | x_ConfigureCache (const string &cache_file) |
Private Attributes | |
string | m_CacheFile |
unique_ptr< CSQLITE_Connection > | m_CacheConn |
Additional Inherited Members | |
Public Types inherited from CGenomicCollectionsService_Base | |
typedef CGCClientRequest | TRequest |
typedef CGCClientResponse | TReply |
typedef TRequest | TRequestChoice |
typedef TReply | TReplyChoice |
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< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
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 CRPCClient< CGCClientRequest, CGCClientResponse > | |
virtual string | GetAffinity (const CGCClientRequest &) const |
virtual void | x_WriteRequest (CObjectOStream &out, const CSerialObject &request) override |
virtual void | x_ReadReply (CObjectIStream &in, CSerialObject &reply) override |
virtual string | x_GetAffinity (const CSerialObject &request) const override |
virtual void | x_Connect (void) override |
These run with m_Mutex already acquired. More... | |
void | x_ConnectURL (const string &url) |
Connect to a URL. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Member Functions inherited from CRPCClient_Base | |
void | SetAffinity (const string &affinity) |
virtual void | x_Disconnect (void) |
Disconnect as cleanly as possible. More... | |
void | x_SetStream (CNcbiIostream *stream) |
void | x_Ask (const CSerialObject &request, CSerialObject &reply) |
virtual bool | x_ShouldRetry (unsigned int tries) |
CTimeSpan | x_GetRetryDelay (double max_delay) const |
Protected Member Functions inherited from CConnIniter | |
CConnIniter (void) | |
Static Protected Member Functions inherited from CRPCClient< CGCClientRequest, CGCClientResponse > | |
static EHTTP_HeaderParse | sx_ParseHeader (const char *http_header, void *user_data, int server_error) |
static bool | sx_IsSpecial (const STimeout *timeout) |
Static Protected Member Functions inherited from CRPCClient_Base | |
static const char * | GetContentTypeHeader (ESerialDataFormat format) |
Protected Attributes inherited from CRPCClient< CGCClientRequest, CGCClientResponse > | |
const STimeout * | m_Timeout |
Cloned if not special. More... | |
Protected Attributes inherited from CRPCClient_Base | |
string | m_Service |
Used by default Connect(). More... | |
string | m_Args |
unique_ptr< CNcbiIostream > | m_Stream |
unique_ptr< CObjectIStream > | m_In |
unique_ptr< CObjectOStream > | m_Out |
string | m_Affinity |
unsigned int | m_TryLimit |
CHttpRetryContext | m_RetryCtx |
CConstIRef< ICanceled > | m_Canceler |
Definition at line 73 of file genomic_collections_cli.hpp.
Definition at line 75 of file genomic_collections_cli.cpp.
References x_ConfigureCache(), and x_ConfigureConnection().
Definition at line 84 of file genomic_collections_cli.cpp.
References CArgs::Exist(), x_ConfigureCache(), and x_ConfigureConnection().
CGenomicCollectionsService::~CGenomicCollectionsService | ( | ) |
Definition at line 109 of file genomic_collections_cli.cpp.
References CSQLITE_Global::Finalize(), m_CacheConn, m_CacheFile, and NULL.
|
private |
|
static |
Definition at line 355 of file genomic_collections_cli.cpp.
References CArgDescriptions::AddOptionalKey(), CArgDescriptions::eString, and CArgDescriptions::SetCurrentGroup().
Referenced by CClientGenomicCollectionsSvcApplication::Init().
CRef< CGCClient_AssembliesForSequences > CGenomicCollectionsService::FindAssembliesBySequences | ( | const list< string > & | sequence_acc, |
int | filter, | ||
CGCClient_GetAssemblyBySequenceRequest::ESort | sort = CGCClient_GetAssemblyBySequenceRequest::eSort_default , |
||
bool | with_roles = false |
||
) |
Find assemblies by sequence accessions.
sequence_acc | Sequence accessions in ACC.VER format |
filter | Bitfield, OR-ed combination of eGCClient_GetAssemblyBySequenceFilter_* values: eGCClient_GetAssemblyBySequenceFilter_all - do not filter out anything eGCClient_GetAssemblyBySequenceFilter_latest - look up for latest releases only eGCClient_GetAssemblyBySequenceFilter_major - look up for major releases only eGCClient_GetAssemblyBySequenceFilter_genbank - look up for GenBank releases only eGCClient_GetAssemblyBySequenceFilter_refseq - look up for RefSeq releases only If none of genbank of refseq filters are specified then both GenBank and RefSeq releases will be returned |
sort | Assembly ordering: CGCClient_GetAssemblyBySequenceRequest::eSort_default - sort by number of sequences found in assembly, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_latest - sort by number of sequences found in assembly, then latest first, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_major - sort by number of sequences found in assembly, then major first, then by reference/representative/other, then by modification date |
Definition at line 274 of file genomic_collections_cli.cpp.
References ct::sort(), and x_FindAssembliesBySequences().
CRef< CGCClient_AssembliesForSequences > CGenomicCollectionsService::FindAssembliesBySequences | ( | const string & | sequence_acc, |
int | filter, | ||
CGCClient_GetAssemblyBySequenceRequest::ESort | sort = CGCClient_GetAssemblyBySequenceRequest::eSort_default , |
||
bool | with_roles = false |
||
) |
Find assemblies by sequence accession.
sequence_acc | Sequence accession in ACC.VER format |
filter | Bitfield, OR-ed combination of eGCClient_GetAssemblyBySequenceFilter_* values: eGCClient_GetAssemblyBySequenceFilter_all - do not filter out anything eGCClient_GetAssemblyBySequenceFilter_latest - look up for latest releases only eGCClient_GetAssemblyBySequenceFilter_major - look up for major releases only eGCClient_GetAssemblyBySequenceFilter_genbank - look up for GenBank releases only eGCClient_GetAssemblyBySequenceFilter_refseq - look up for RefSeq releases only If none of genbank of refseq filters are specified then both GenBank and RefSeq releases will be returned |
sort | Assembly ordering: CGCClient_GetAssemblyBySequenceRequest::eSort_default - sort by number of sequences found in assembly, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_latest - sort by number of sequences found in assembly, then latest first, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_major - sort by number of sequences found in assembly, then major first, then by reference/representative/other, then by modification date |
Definition at line 269 of file genomic_collections_cli.cpp.
References ct::sort().
Referenced by CClientGenomicCollectionsSvcApplication::RunWithService().
CRef< CGCClient_AssemblySequenceInfo > CGenomicCollectionsService::FindOneAssemblyBySequences | ( | const list< string > & | sequence_acc, |
int | filter, | ||
CGCClient_GetAssemblyBySequenceRequest::ESort | sort = CGCClient_GetAssemblyBySequenceRequest::eSort_default , |
||
bool | with_roles = false |
||
) |
Find assembly by sequence accessions.
sequence_acc | Sequence accessions in ACC.VER format |
filter | Bitfield, OR-ed combination of eGCClient_GetAssemblyBySequenceFilter_* values: eGCClient_GetAssemblyBySequenceFilter_all - do not filter out anything eGCClient_GetAssemblyBySequenceFilter_latest - look up for latest releases only eGCClient_GetAssemblyBySequenceFilter_major - look up for major releases only eGCClient_GetAssemblyBySequenceFilter_genbank - look up for GenBank releases only eGCClient_GetAssemblyBySequenceFilter_refseq - look up for RefSeq releases only If none of genbank of refseq filters are specified then both GenBank and RefSeq releases will be returned |
sort | Assembly ordering: CGCClient_GetAssemblyBySequenceRequest::eSort_default - sort by number of sequences found in assembly, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_latest - sort by number of sequences found in assembly, then latest first, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_major - sort by number of sequences found in assembly, then major first, then by reference/representative/other, then by modification date |
Definition at line 260 of file genomic_collections_cli.cpp.
References ct::sort(), and x_FindAssembliesBySequences().
CRef< CGCClient_AssemblyInfo > CGenomicCollectionsService::FindOneAssemblyBySequences | ( | const string & | sequence_acc, |
int | filter, | ||
CGCClient_GetAssemblyBySequenceRequest::ESort | sort = CGCClient_GetAssemblyBySequenceRequest::eSort_default |
||
) |
Find assembly by sequence accession.
sequence_acc | Sequence accession in ACC.VER format |
filter | Bitfield, OR-ed combination of eGCClient_GetAssemblyBySequenceFilter_* values: eGCClient_GetAssemblyBySequenceFilter_all - do not filter out anything eGCClient_GetAssemblyBySequenceFilter_latest - look up for latest releases only eGCClient_GetAssemblyBySequenceFilter_major - look up for major releases only eGCClient_GetAssemblyBySequenceFilter_genbank - look up for GenBank releases only eGCClient_GetAssemblyBySequenceFilter_refseq - look up for RefSeq releases only If none of genbank of refseq filters are specified then both GenBank and RefSeq releases will be returned |
sort | Assembly ordering: CGCClient_GetAssemblyBySequenceRequest::eSort_default - sort by number of sequences found in assembly, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_latest - sort by number of sequences found in assembly, then latest first, then by reference/representative/other, then by modification date CGCClient_GetAssemblyBySequenceRequest::eSort_major - sort by number of sequences found in assembly, then major first, then by reference/representative/other, then by modification date |
Definition at line 253 of file genomic_collections_cli.cpp.
References ct::sort().
Referenced by CClientGenomicCollectionsSvcApplication::RunWithService().
CRef< CGC_Assembly > CGenomicCollectionsService::GetAssembly | ( | const string & | acc, |
const string & | mode | ||
) |
Definition at line 134 of file genomic_collections_cli.cpp.
References CGenomicCollectionsService_Base::AskGet_assembly_blob(), CCachedAssembly::Assembly(), CSQLITE_Statement::Bind(), DIAG_COMPILE_INFO, CRPCClientException::eFailed, ERR_POST, Error(), CException::GetErrCode(), CGCClientResponse_Base::GetSrvr_error(), CSQLITE_Statement::GetString(), Info(), CGCClientResponse_Base::IsSrvr_error(), LogRequest(), m_CacheConn, m_CacheFile, CGCClient_GetAssemblyBlobRequest_Base::SetAccession(), CGCClient_GetAssemblyBlobRequest_Base::SetMode(), CSQLITE_Statement::Step(), NStr::TruncateSpaces(), and ValidateAsmAccession().
Referenced by BOOST_AUTO_TEST_CASE(), CIdMapperTestApp::Run(), CAnalyzeShiftApp::Run(), and CClientGenomicCollectionsSvcApplication::RunWithService().
CRef< CGC_Assembly > CGenomicCollectionsService::GetAssembly | ( | int | releaseId, |
const string & | mode | ||
) |
Definition at line 180 of file genomic_collections_cli.cpp.
References CGenomicCollectionsService_Base::AskGet_assembly_blob(), CCachedAssembly::Assembly(), CSQLITE_Statement::Bind(), DIAG_COMPILE_INFO, CRPCClientException::eFailed, ERR_POST, Error(), CException::GetErrCode(), CGCClientResponse_Base::GetSrvr_error(), CSQLITE_Statement::GetString(), CGCClientResponse_Base::IsSrvr_error(), LogRequest(), m_CacheConn, m_CacheFile, CGCClient_GetAssemblyBlobRequest_Base::SetMode(), CGCClient_GetAssemblyBlobRequest_Base::SetRelease_id(), and CSQLITE_Statement::Step().
CRef< CGCClient_EquivalentAssemblies > CGenomicCollectionsService::GetEquivalentAssemblies | ( | const string & | acc, |
int | equivalency | ||
) |
Definition at line 322 of file genomic_collections_cli.cpp.
References CGenomicCollectionsService_Base::AskGet_equivalent_assemblies(), DIAG_COMPILE_INFO, ERR_POST, eUnknown, CException::GetMsg(), CGCClientResponse_Base::GetSrvr_error(), CGCClientResponse_Base::IsSrvr_error(), LogRequest(), NCBI_THROW, CGCClient_GetEquivalentAssembliesRequest_Base::SetAccession(), CGCClient_GetEquivalentAssembliesRequest_Base::SetEquivalency(), SleepSec(), and Warning().
Referenced by CClientGenomicCollectionsSvcApplication::RunWithService(), and s_GetAssmEquiv().
|
private |
string CGenomicCollectionsService::ValidateChrType | ( | const string & | chrType, |
const string & | chrLoc | ||
) |
Definition at line 221 of file genomic_collections_cli.cpp.
References CGenomicCollectionsService_Base::AskGet_chrtype_valid(), DIAG_COMPILE_INFO, ERR_POST, eUnknown, CException::GetMsg(), CGCClientResponse_Base::GetSrvr_error(), CGCClientResponse_Base::IsSrvr_error(), LogRequest(), NCBI_THROW, CGCClient_ValidateChrTypeLocRequest_Base::SetLocation(), CGCClient_ValidateChrTypeLocRequest_Base::SetType(), SleepSec(), and Warning().
Referenced by CClientGenomicCollectionsSvcApplication::RunWithService().
Definition at line 362 of file genomic_collections_cli.cpp.
References CSQLITE_Connection::eAllMT, CSQLITE_Connection::fReadOnly, CSQLITE_Global::Initialize(), m_CacheConn, and m_CacheFile.
Referenced by CGenomicCollectionsService().
|
private |
Definition at line 94 of file genomic_collections_cli.cpp.
References eSerial_AsnText, kTimeout, CRPCClient_Base::SetArgs(), CRPCClient_Base::SetFormat(), CRPCClient_Base::SetRetryLimit(), and CRPCClient< CGCClientRequest, CGCClientResponse >::SetTimeout().
Referenced by CGenomicCollectionsService().
|
private |
Definition at line 278 of file genomic_collections_cli.cpp.
References CGenomicCollectionsService_Base::AskGet_assembly_by_sequence(), DIAG_COMPILE_INFO, ERR_POST, eUnknown, CException::GetMsg(), CGCClientResponse_Base::GetSrvr_error(), CGCClientResponse_Base::IsSrvr_error(), LogRequest(), NCBI_THROW, CGCClient_GetAssemblyBySequenceRequest_Base::SetAdd_sequence_roles(), CGCClient_GetAssemblyBySequenceRequest_Base::SetFilter(), CGCClient_GetAssemblyBySequenceRequest_Base::SetSequence_acc(), CGCClient_GetAssemblyBySequenceRequest_Base::SetSort(), CGCClient_GetAssemblyBySequenceRequest_Base::SetTop_assembly_only(), SleepSec(), ct::sort(), and Warning().
Referenced by FindAssembliesBySequences(), and FindOneAssemblyBySequences().
|
private |
Definition at line 245 of file genomic_collections_cli.hpp.
Referenced by GetAssembly(), x_ConfigureCache(), and ~CGenomicCollectionsService().
|
private |
Definition at line 244 of file genomic_collections_cli.hpp.
Referenced by GetAssembly(), x_ConfigureCache(), and ~CGenomicCollectionsService().