94 CSRABlobId(
const string& acc,
unsigned spot_id);
107 : m_Accession(acc), m_SpotId(spot_id)
233 const string& rep_path,
234 const string& vol_path,
262 const string& rep_path,
263 const string& vol_path,
279 string ret =
"SRADataLoader";
301 const string& vol_path)
318 const string& vol_path,
342 typedef pair<CRef<CSRABlobId>,
unsigned>
TReadId;
347 if ( dot1 ==
NPOS ) {
350 SIZE_TYPE dot2 = with_chunk? sra.find(
'.', dot1+1): sra.size();
351 if ( dot2 ==
NPOS || dot1+1 >= dot2 || sra[dot1+1] ==
'0' ||
352 (with_chunk && (dot2+2 != sra.size() ||
353 (sra[dot2+1] !=
'2' && sra[dot2+1] !=
'4') )) ) {
359 ret.first =
new CSRABlobId(sra.substr(0, dot1), spot_id);
360 ret.second = sra[dot2+1] -
'0';
371 const CDbtag& general =
id->GetGeneral();
372 if ( general.
GetDb() !=
"SRA") {
431 if ( read_id.first ) {
446 if ( read_id.first ) {
CObjectManager::TPriority GetPriority(const TPluginManagerParamTree *params) const
CObjectManager::EIsDefault GetIsDefault(const TPluginManagerParamTree *params) const
bool ValidParams(const TPluginManagerParamTree *params) const
CTSE_LoadLock GetTSE_LoadLock(const TBlobId &blob_id)
bool IsDataLoaderMatches(CDataLoader &loader) const
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
bool operator==(const CBlobId &id) const
CSRABlobId(const string &acc, unsigned spot_id)
string ToString(void) const
Get string representation of blob id.
bool operator<(const CBlobId &id) const
~CSRADataLoader_Impl(void)
CRef< CSeq_entry > LoadSRAEntry(const string &accession, unsigned spot_id)
TSeqPos GetSequenceLength(const string &accession, unsigned spot_id, unsigned read_id)
CSRADataLoader_Impl(CSraMgr::ETrim trim)
CSeq_inst::TMol GetSequenceType(const string &accession, unsigned spot_id, unsigned read_id)
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
virtual TSeqPos GetSequenceLength(const CSeq_id_Handle &idh)
Request for a length of a sequence.
virtual STypeFound GetSequenceTypeFound(const CSeq_id_Handle &idh)
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
virtual bool CanGetBlobById(void) const
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
static string GetLoaderNameFromArgs(void)
virtual TBlobId GetBlobIdFromString(const string &str) const
CRef< CSRADataLoader_Impl > m_Impl
virtual CObjectManager::TPriority GetDefaultPriority(void) const
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
virtual ~CSRA_DataLoaderCF(void)
virtual CDataLoader * CreateAndRegister(CObjectManager &om, const TPluginManagerParamTree *params) const
@ eLifeLevel_AppMain
Destroyed in CNcbiApplication::AppMain, if possible.
void Init(CSraMgr &mgr, const string &acc)
const string & GetAccession(void) const
TSeqPos GetSequenceLength(spotid_t spot_id, uint8_t read_id) const
CSeq_inst::TMol GetSequenceType(spotid_t spot_id, uint8_t read_id) const
CRef< CSeq_entry > GetSpotEntry(spotid_t spot_id) const
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
bool IsLoaded(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
definition of a Culling tree
iterator_bool insert(const value_type &val)
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
CConstRef< CSeq_id > GetSeqId(void) const
CSeq_id::E_Choice Which(void) const
TLoader * GetLoader(void) const
Get pointer to the loader.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void RevokeDataLoaders(IDataLoaderFilter &filter)
Revoke data loaders by filter, even if they were still used.
CDataSource * GetDataSource(void) const
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
EIsDefault
Flag defining if the data loader is included in the "default" group.
TRegisterInfo GetRegisterInfo(void)
static void RegisterInObjectManager(CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
Register the loader only if the name is not yet registered in the object manager.
@ kPriority_Replace
Default priority for replacement loaders.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
@ eParam_NoThread
Do not use per-thread values.
static void NCBI_EntryPointImpl(TDriverInfoList &info_list, EEntryPointRequest method)
Entry point implementation.
list< SDriverInfo > TDriverInfoList
List of driver information.
EEntryPointRequest
Actions performed by the entry point.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
NCBI_NS_STD::string::size_type SIZE_TYPE
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
const TTag & GetTag(void) const
Get the Tag member data.
const TDb & GetDb(void) const
Get the Db member data.
const TStr & GetStr(void) const
Get the variant data.
@ e_General
for other databases
EMol
molecule class in living organism
string s_Value(TValue value)
Helper classes and templates to implement plugins.
void NCBI_EntryPoint_DataLoader_Sra(CPluginManager< CDataLoader >::TDriverInfoList &info_list, CPluginManager< CDataLoader >::EEntryPointRequest method)
const string kDataLoader_Sra_DriverName("sra")
NCBI_PARAM_DEF_EX(bool, SRA_LOADER, TRIM, false, eParam_NoThread, SRA_LOADER_TRIM)
void NCBI_EntryPoint_xloader_sra(CPluginManager< objects::CDataLoader >::TDriverInfoList &info_list, CPluginManager< objects::CDataLoader >::EEntryPointRequest method)
pair< CRef< CSRABlobId >, unsigned > TReadId
static bool GetTrimParam(void)
void DataLoaders_Register_SRA(void)
static TReadId sx_GetReadId(const string &sra, bool with_chunk)
NCBI_PARAM_DECL(bool, SRA_LOADER, TRIM)
static CSafeStatic< CRevoker > s_Revoker(CSafeStaticLifeSpan(CSafeStaticLifeSpan::eLifeLevel_AppMain, CSafeStaticLifeSpan::eLifeSpan_Long))
CRef< objects::CObjectManager > om
Better replacement of GetSequenceType(), this method should be defined in data loaders,...