Ejemplo n.º 1
0
string CGenomicCollectionsService::ValidateChrType(string chrType, string chrLoc)
{
    CGCClient_ValidateChrTypeLocRequest req;
    CGCClientResponse reply;
    
    req.SetType(chrType);
    req.SetLocation(chrLoc);
    
#ifdef _DEBUG
    ostringstream ostrstrm;
    ostrstrm << "Making request -" << MSerial_AsnText << req;
    LOG_POST(Info << ostrstrm.str());
#endif
    
    try {
        return AskGet_chrtype_valid(req, &reply);
    } catch (CException& ex) {
        if(reply.Which() == CGCClientResponse::e_Srvr_error) {
            ERR_POST(Error << " at Server side (will be propagated) ...\n" 
                            << reply.GetSrvr_error().GetError_id() << ": "
                            << reply.GetSrvr_error().GetDescription());
            NCBI_THROW(CException, eUnknown, reply.GetSrvr_error().GetDescription());
        }
        throw;
    }
}
Ejemplo n.º 2
0
CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(string acc, 
                                            int level, 
                                            int asmAttrFlags, 
                                            int chrAttrFlags, 
                                            int scafAttrFlags, 
                                            int compAttrFlags)
{
    CGCClient_GetAssemblyRequest req;
    CGCClientResponse reply;
    
    req.SetAccession(acc);
    req.SetLevel(level);
    req.SetAssm_flags(asmAttrFlags);
    req.SetChrom_flags(chrAttrFlags);
    req.SetScaf_flags(scafAttrFlags);
    req.SetComponent_flags(compAttrFlags);
    
#ifdef _DEBUG
    ostringstream ostrstrm;
    ostrstrm << "Making request - " << MSerial_AsnText << req;
    LOG_POST(Info << ostrstrm.str());
#endif
    
    try {
        return AskGet_assembly(req, &reply);
    } catch (CException& ex) {
        if(reply.Which() == CGCClientResponse::e_Srvr_error) {
            ERR_POST(Error << " at Server  side (will be propagated) ...\nErrId:" 
                            << reply.GetSrvr_error().GetError_id() << ": "
                            << reply.GetSrvr_error().GetDescription());
            NCBI_THROW(CException, eUnknown, reply.GetSrvr_error().GetDescription());
        }
        throw;
    }
}
Ejemplo n.º 3
0
CRef<CGC_Assembly> CGenomicCollectionsService::GetAssembly(int releaseId, 
                                            int level, 
                                            int asmAttrFlags, 
                                            int chrAttrFlags, 
                                            int scafAttrFlags, 
                                            int compAttrFlags)
{
    CGCClient_GetAssemblyRequest req;
    CGCClientResponse reply;
    
    req.SetRelease_id(releaseId);
    req.SetLevel(level);
    req.SetAssm_flags(asmAttrFlags);
    req.SetChrom_flags(chrAttrFlags);
    req.SetScaf_flags(scafAttrFlags);
    req.SetComponent_flags(compAttrFlags);
    
#ifdef _DEBUG
    ostringstream ostrstrm;
    ostrstrm << "Making request -" << MSerial_AsnText << req;
    LOG_POST(Info << ostrstrm.str());
#endif
    
    try {
        return AskGet_assembly(req, &reply);
    } catch (CException& ex) {
        if(reply.Which() == CGCClientResponse::e_Srvr_error) {
            NCBI_THROW(CException, eUnknown, reply.GetSrvr_error().GetDescription());
        }
        throw;
    }
}