⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scope.hpp

📁 ncbi源码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
/* * =========================================================================== * PRODUCTION $Log: scope.hpp,v $ * PRODUCTION Revision 1000.6  2004/04/16 16:59:56  gouriano * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.78 * PRODUCTION * =========================================================================== */#ifndef OBJMGR_SCOPE__HPP#define OBJMGR_SCOPE__HPP/*  $Id: scope.hpp,v 1000.6 2004/04/16 16:59:56 gouriano Exp $* ===========================================================================**                            PUBLIC DOMAIN NOTICE*               National Center for Biotechnology Information**  This software/database is a "United States Government Work" under the*  terms of the United States Copyright Act.  It was written as part of*  the author's official duties as a United States Government employee and*  thus cannot be copyrighted.  This software/database is freely available*  to the public for use. The National Library of Medicine and the U.S.*  Government have not placed any restriction on its use or reproduction.**  Although all reasonable efforts have been taken to ensure the accuracy*  and reliability of the software and data, the NLM and the U.S.*  Government do not and cannot warrant the performance or results that*  may be obtained by using this software or data. The NLM and the U.S.*  Government disclaim all warranties, express or implied, including*  warranties of performance, merchantability or fitness for any particular*  purpose.**  Please cite the author in any work or product based on this material.** ===========================================================================** Authors:*           Andrei Gourianov*           Aleksey Grichenko*           Michael Kimelman*           Denis Vakatov*           Eugene Vasilchenko** File Description:*           Scope is top-level object available to a client.*           Its purpose is to define a scope of visibility and reference*           resolution and provide access to the bio sequence data**/#include <corelib/ncbiobj.hpp>#include <objmgr/seq_id_handle.hpp>#include <objmgr/seq_entry_handle.hpp>#include <objmgr/bioseq_set_handle.hpp>#include <objmgr/bioseq_handle.hpp>#include <objmgr/seq_annot_handle.hpp>BEGIN_NCBI_SCOPEBEGIN_SCOPE(objects)// fwd decl// objectsclass CSeq_entry;class CBioseq_set;class CBioseq;class CSeq_annot;class CSeq_id;class CSeq_loc;// objmgrclass CSeq_id_Handle;class CObjectManager;class CScope_Impl;class CSynonymsSet;/////////////////////////////////////////////////////////////////////////////// CScope/////////////////////////////////////////////////////////////////////////////class NCBI_XOBJMGR_EXPORT CScope : public CObject{public:    explicit CScope(CObjectManager& objmgr);    virtual ~CScope(void);    // CBioseq_Handle methods:    // Get bioseq handle by seq-id    CBioseq_Handle GetBioseqHandle(const CSeq_id& id);    CBioseq_Handle GetBioseqHandle(const CSeq_id_Handle& id);    CBioseq_Handle GetBioseqHandle(const CSeq_loc& loc);    // Get bioseq handle without loading new data    enum EGetBioseqFlag {        eGetBioseq_Resolved, // Search only in already resolved ids        eGetBioseq_Loaded,   // Search in all loaded TSEs in the scope        eGetBioseq_All       // Search bioseq, load if not loaded yet    };    CBioseq_Handle GetBioseqHandle(const CSeq_id& id,                                   EGetBioseqFlag get_flag);    CBioseq_Handle GetBioseqHandle(const CSeq_id_Handle& id,                                   EGetBioseqFlag get_flag);    // Deprecated interface    CBioseq_Handle GetBioseqHandle(const CBioseq& bioseq);    CSeq_entry_Handle GetSeq_entryHandle(const CSeq_entry& entry);    CSeq_annot_Handle GetSeq_annotHandle(const CSeq_annot& annot);    // Get bioseq handle for sequence withing one TSE    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id& id,                                          const CBioseq_Handle& bh);    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id& id,                                          const CSeq_entry_Handle& seh);    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id_Handle& id,                                          const CBioseq_Handle& bh);    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id_Handle& id,                                          const CSeq_entry_Handle& seh);    // CScope contents modification methods    typedef int TPriority;    enum EPriority {        kPriority_NotSet = -1    };    // Add default data loaders from object manager    void AddDefaults(TPriority pri = kPriority_NotSet);    // Add data loader by name.    // The loader (or its factory) must be known to Object Manager.    void AddDataLoader(const string& loader_name,                       TPriority pri = kPriority_NotSet);    // Add the scope's datasources as a single group with the given priority    void AddScope(CScope& scope,                  TPriority pri = kPriority_NotSet);    // Add seq_entry, default priority is higher than for defaults or loaders    CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry& top_entry,                                          TPriority pri = kPriority_NotSet);    // Add bioseq, return bioseq handle. Try to use unresolved seq-id    // from the bioseq, fail if all ids are already resolved to    // other sequences.    CBioseq_Handle AddBioseq(CBioseq& bioseq,                             TPriority pri = kPriority_NotSet);    // Add Seq-annot    CSeq_annot_Handle AddSeq_annot(const CSeq_annot& annot,                                   TPriority pri = kPriority_NotSet);    CBioseq_EditHandle GetEditHandle(const CBioseq_Handle& seq);    CSeq_entry_EditHandle GetEditHandle(const CSeq_entry_Handle& entry);    CSeq_annot_EditHandle GetEditHandle(const CSeq_annot_Handle& annot);    CBioseq_set_EditHandle GetEditHandle(const CBioseq_set_Handle& seqset);    void ResetHistory(void);    CConstRef<CSynonymsSet> GetSynonyms(const CSeq_id& id);    CConstRef<CSynonymsSet> GetSynonyms(const CSeq_id_Handle& id);    CConstRef<CSynonymsSet> GetSynonyms(const CBioseq_Handle& bh);    // deprecated interface    void AttachEntry(CSeq_entry& parent, CSeq_entry& entry);    void RemoveEntry(CSeq_entry& entry);    void AttachAnnot(CSeq_entry& parent, CSeq_annot& annot);    void RemoveAnnot(CSeq_entry& parent, CSeq_annot& annot);    void ReplaceAnnot(CSeq_entry& entry,                      CSeq_annot& old_annot, CSeq_annot& new_annot);    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id& id,                                          const CSeq_entry& tse);    CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id_Handle& id,                                          const CSeq_entry& tse);    enum ETSEKind {        eManualTSEs,        eAllTSEs    };    typedef vector<CSeq_entry_Handle> TTSE_Handles;    void GetAllTSEs(TTSE_Handles& tses, enum ETSEKind kind = eManualTSEs);protected:    CScope_Impl& GetImpl(void);private:    // to prevent copying    CScope(const CScope&);    CScope& operator=(const CScope&);    friend class CSeqMap_CI;    friend class CSeq_annot_CI;    friend class CAnnot_Collector;    friend class CBioseq_CI;    friend class CHeapScope;    friend class CPrefetchToken_Impl;    CRef<CScope>      m_HeapScope;    CRef<CScope_Impl> m_Impl;};/////////////////////////////////////////////////////////////////////////////// CScope inline methods/////////////////////////////////////////////////////////////////////////////inlineCScope_Impl& CScope::GetImpl(void){    return *m_Impl;}END_SCOPE(objects)END_NCBI_SCOPE/** ---------------------------------------------------------------------------* $Log: scope.hpp,v $* Revision 1000.6  2004/04/16 16:59:56  gouriano* PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.78** Revision 1.78  2004/04/16 13:31:46  grichenk* Added data pre-fetching functions.** Revision 1.77  2004/04/13 16:39:36  grichenk* Corrected comments** Revision 1.76  2004/04/13 15:59:35  grichenk* Added CScope::GetBioseqHandle() with id resolving flag.** Revision 1.75  2004/04/12 18:40:24  grichenk* Added GetAllTSEs()** Revision 1.74  2004/04/05 15:56:13  grichenk* Redesigned CAnnotTypes_CI: moved all data and data collecting* functions to CAnnotDataCollector. CAnnotTypes_CI is no more* inherited from SAnnotSelector.** Revision 1.73  2004/03/24 18:30:28  vasilche* Fixed edit API.* Every *_Info object has its own shallow copy of original object.** Revision 1.72  2004/03/16 15:47:26  vasilche* Added CBioseq_set_Handle and set of EditHandles** Revision 1.71  2004/02/19 17:23:00  vasilche* Changed order of deletion of heap scope and scope impl objects.* Reduce number of calls to x_ResetHistory().** Revision 1.70  2004/02/02 14:46:42  vasilche* Several performance fixed - do not iterate whole tse set in CDataSource.** Revision 1.69  2004/01/29 20:33:27  vasilche* Do not resolve any Seq-ids in CScope::GetSynonyms() -

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -