NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbienv.hpp>
#include <corelib/ncbiargs.hpp>
#include <corelib/request_ctx.hpp>
#include <corelib/ncbifile.hpp>
#include <corelib/ncbistr.hpp>
#include <corelib/ncbitime.hpp>
#include <corelib/ncbi_signal.hpp>
#include <corelib/ncbi_process.hpp>
#include <objtools/data_loaders/asn_cache/asn_cache.hpp>
#include <objtools/data_loaders/asn_cache/file_names.hpp>
#include <objtools/data_loaders/asn_cache/chunk_file.hpp>
#include <objtools/data_loaders/asn_cache/seq_id_chunk_file.hpp>
#include <objtools/data_loaders/asn_cache/asn_cache_util.hpp>
#include <serial/iterator.hpp>
#include <connect/ncbi_pipe.hpp>
#include <dbapi/simple/sdbapi.hpp>
#include <util/file_manifest.hpp>
#include <util/compress/zlib.hpp>
#include <util/compress/stream.hpp>
#include <objects/seqset/Bioseq_set.hpp>
#include <objects/seq/Seq_inst.hpp>
#include <objects/seq/Seq_ext.hpp>
#include <objects/seq/Delta_seq.hpp>
#include <objects/seq/Delta_ext.hpp>
#include <objects/seq/Seq_annot.hpp>
#include <objects/seq/Seq_descr.hpp>
#include <objects/seq/Seqdesc.hpp>
#include <objects/seq/MolInfo.hpp>
#include <objects/seqfeat/Seq_feat.hpp>
#include <objects/seqloc/Seq_loc.hpp>
#include <objmgr/object_manager.hpp>
#include <objmgr/scope.hpp>
#include <objmgr/bioseq_handle.hpp>
#include <objmgr/seq_entry_handle.hpp>
#include <objmgr/feat_ci.hpp>
#include <objmgr/bioseq_ci.hpp>
#include <objmgr/util/sequence.hpp>
#include <objtools/data_loaders/genbank/gbloader.hpp>
#include <misc/data_loaders_util/data_loaders_util.hpp>
#include <db/bdb/bdb_cursor.hpp>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <functional>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SSeqIdIndex |
Indexing primitives. More... | |
struct | SBlobLocator |
struct | SSubcacheIndexData |
struct | SBlobCopier |
struct | SBlobInserter |
class | CAsnSubCacheCreateApplication |
struct | CAsnSubCacheCreateApplication::SBlobVersion |
Typedefs | |
typedef deque< SSubcacheIndexData > | TBlobLocationList |
typedef SSubcacheIndexData * | TBlobLocationEntry |
typedef map< SSeqIdIndex, TBlobLocationEntry > | TIndexMapById |
typedef TIndexMapById::iterator | TIndexRef |
typedef list< TIndexRef > | TIndexRefList |
typedef vector< pair< SBlobLocator, TBlobLocationEntry > > | TIndexMapByBlob |
typedef set< CSeq_id_Handle, CSeq_id_Handle::PLessOrdered > | TCachedSeqIds |
Functions | |
USING_SCOPE (objects) | |
void | ExtractExtraIds (CBioseq_Handle bsh, vector< CSeq_id_Handle > &extra_ids, bool extract_delta, bool extract_products) |
bool | s_RemoveAnnotsFromEntry (CSeq_entry &entry) |
bool | TrimEntry (CConstRef< CSeq_entry > &entry, CBioseq_Handle bsh) |
If entry is a large nucprot set, Optionally create a new trimmed Seq-entry containing only the needed Bioseq. More... | |
void | VerifyMolType (CBioseq_Handle bsh) |
bool | HasNameAndAccession (const CSeq_id_Handle &idh) |
CSeq_id_Handle | StrippedAccVer (const CSeq_id_Handle &idh) |
static void | s_ReadIdsFromFile (CNcbiIstream &istr, TIndexMapById &index_map, TBlobLocationList &blob_locations, TCachedSeqIds &cached_seq_ids) |
static bool | s_ShouldFetchOneByOne (TIndexMapById &ids) |
int | main (int argc, const char *argv[]) |
Variables | |
USING_NCBI_SCOPE | |
static bool | s_TrimLargeNucprots = false |
static bool | s_RemoveAnnot = false |
static CSeq_inst::EMol | s_MolType = CSeq_inst::eMol_not_set |
typedef SSubcacheIndexData* TBlobLocationEntry |
Definition at line 210 of file sub_cache_create.cpp.
typedef deque<SSubcacheIndexData> TBlobLocationList |
Definition at line 209 of file sub_cache_create.cpp.
Definition at line 215 of file sub_cache_create.cpp.
typedef vector< pair<SBlobLocator, TBlobLocationEntry> > TIndexMapByBlob |
Definition at line 214 of file sub_cache_create.cpp.
typedef map<SSeqIdIndex, TBlobLocationEntry> TIndexMapById |
Definition at line 211 of file sub_cache_create.cpp.
typedef TIndexMapById::iterator TIndexRef |
Definition at line 212 of file sub_cache_create.cpp.
typedef list<TIndexRef> TIndexRefList |
Definition at line 213 of file sub_cache_create.cpp.
void ExtractExtraIds | ( | CBioseq_Handle | bsh, |
vector< CSeq_id_Handle > & | extra_ids, | ||
bool | extract_delta, | ||
bool | extract_products | ||
) |
Definition at line 218 of file sub_cache_create.cpp.
References SAnnotSelector::ExcludeNamedAnnots(), CDelta_ext_Base::Get(), CSeq_ext_Base::GetDelta(), CSeq_inst_Base::GetExt(), CSeq_id_Handle::GetHandle(), CBioseq_Handle::GetInst(), CSeq_ext_Base::IsDelta(), CSeq_inst_Base::IsSetExt(), ITERATE, kMax_Int, SAnnotSelector::SetAdaptiveDepth(), SAnnotSelector::SetExactDepth(), SAnnotSelector::SetResolveAll(), and SAnnotSelector::SetResolveDepth().
Referenced by SBlobInserter::operator()(), and SBlobCopier::operator()().
bool HasNameAndAccession | ( | const CSeq_id_Handle & | idh | ) |
Definition at line 370 of file sub_cache_create.cpp.
References CSeq_id_Handle::GetSeqId(), CSeq_id::GetTextseq_Id(), CTextseq_id_Base::IsSetAccession(), and CTextseq_id_Base::IsSetName().
Referenced by CAsnSubCacheCreateApplication::WriteBlobsInSubCache(), and CAsnSubCacheCreateApplication::x_FetchMissingBlobs().
Definition at line 1737 of file sub_cache_create.cpp.
References CAsnSubCacheCreateApplication::CAsnSubCacheCreateApplication().
|
static |
Definition at line 898 of file sub_cache_create.cpp.
References Error(), CSeq_id_Handle::GetHandle(), map_checker< Container >::insert(), set< Key, Compare >::insert(), LOG_POST, and NcbiGetlineEOL().
Referenced by CAsnSubCacheCreateApplication::Run().
bool s_RemoveAnnotsFromEntry | ( | CSeq_entry & | entry | ) |
Definition at line 269 of file sub_cache_create.cpp.
References CSeq_entry_Base::GetSeq(), CSeq_entry_Base::GetSet(), CSeq_entry_Base::IsSeq(), CBioseq_Base::IsSetAnnot(), CBioseq_set_Base::IsSetAnnot(), NON_CONST_ITERATE, CBioseq_Base::ResetAnnot(), CBioseq_set_Base::ResetAnnot(), CSeq_entry_Base::SetSeq(), CBioseq_set_Base::SetSeq_set(), and CSeq_entry_Base::SetSet().
Referenced by TrimEntry().
|
static |
Definition at line 1384 of file sub_cache_create.cpp.
References map_checker< Container >::begin(), map_checker< Container >::end(), first(), max(), and map_checker< Container >::size().
Referenced by CAsnSubCacheCreateApplication::x_EliminateIdsAlreadyInCache(), and CAsnSubCacheCreateApplication::x_LocateBlobsInCache().
CSeq_id_Handle StrippedAccVer | ( | const CSeq_id_Handle & | idh | ) |
Definition at line 376 of file sub_cache_create.cpp.
References CTextseq_id_Base::GetAccession(), CSeq_id_Handle::GetHandle(), CSeq_id_Handle::GetSeqId(), CSeq_id::GetTextseq_Id(), CTextseq_id_Base::GetVersion(), CTextseq_id_Base::IsSetVersion(), and NStr::NumericToString().
Referenced by CAsnSubCacheCreateApplication::WriteBlobsInSubCache(), and CAsnSubCacheCreateApplication::x_FetchMissingBlobs().
bool TrimEntry | ( | CConstRef< CSeq_entry > & | entry, |
CBioseq_Handle | bsh | ||
) |
If entry is a large nucprot set, Optionally create a new trimmed Seq-entry containing only the needed Bioseq.
Also optionally remove all Seq-annots.
Definition at line 289 of file sub_cache_create.cpp.
References CMolInfo_Base::eBiomol_genomic, CBioseq_set_Base::eClass_nuc_prot, CSeq_descr_Base::Get(), CBioseq_set_Base::GetClass(), CSeq_entry_Handle::GetCompleteSeq_entry(), CBioseq_Base::GetDescr(), CBioseq_set_Base::GetLevel(), CConstRef< C, Locker >::GetPointer(), CBioseq_set_Base::GetRelease(), CSeq_entry_Base::GetSeq(), CBioseq_Handle::GetSeq_entry_Handle(), CBioseq_set_Base::GetSeq_set(), CSeq_entry_Base::GetSet(), CSeq_entry_Base::IsSet(), CBioseq_set_Base::IsSetAnnot(), CBioseq_set_Base::IsSetColl(), CBioseq_set_Base::IsSetDate(), CBioseq_set_Base::IsSetDescr(), CBioseq_set_Base::IsSetId(), CBioseq_set_Base::IsSetLevel(), CBioseq_set_Base::IsSetRelease(), ITERATE, CConstRef< C, Locker >::Reset(), s_RemoveAnnot, s_RemoveAnnotsFromEntry(), s_TrimLargeNucprots, CBioseq_set_Base::SetAnnot(), CBioseq_set_Base::SetClass(), CBioseq_set_Base::SetColl(), CBioseq_set_Base::SetDate(), CBioseq_set_Base::SetDescr(), CBioseq_set_Base::SetId(), CBioseq_set_Base::SetLevel(), CBioseq_set_Base::SetRelease(), CBioseq_set_Base::SetSeq_set(), and CSeq_entry_Base::SetSet().
Referenced by SBlobInserter::operator()(), and SBlobCopier::operator()().
USING_SCOPE | ( | objects | ) |
void VerifyMolType | ( | CBioseq_Handle | bsh | ) |
Definition at line 358 of file sub_cache_create.cpp.
References CSeq_inst_Base::eMol_not_set, eUnknown, CBioseq_Handle::GetBioseqMolType(), CBioseq_Handle::GetSeq_id_Handle(), NCBI_THROW, s_MolType, and s_TrimLargeNucprots.
Referenced by SBlobCopier::operator()(), and CAsnSubCacheCreateApplication::x_FetchMissingBlobs().
|
static |
Definition at line 267 of file sub_cache_create.cpp.
Referenced by VerifyMolType().
Definition at line 266 of file sub_cache_create.cpp.
Referenced by CAsnSubCacheCreateApplication::Run(), and TrimEntry().
Definition at line 265 of file sub_cache_create.cpp.
Referenced by CAsnSubCacheCreateApplication::Run(), TrimEntry(), and VerifyMolType().
USING_NCBI_SCOPE |
Definition at line 95 of file sub_cache_create.cpp.