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

📄 bioseq_handle.hpp

📁 ncbi源码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
/* * =========================================================================== * PRODUCTION $Log: bioseq_handle.hpp,v $ * PRODUCTION Revision 1000.4  2004/06/01 19:21:17  gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.56 * PRODUCTION * =========================================================================== */#ifndef BIOSEQ_HANDLE__HPP#define BIOSEQ_HANDLE__HPP/*  $Id: bioseq_handle.hpp,v 1000.4 2004/06/01 19:21:17 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.** ===========================================================================** Author: Aleksey Grichenko, Michael Kimelman, Eugene Vasilchenko** File Description:**/#include <corelib/ncbistd.hpp>#include <objects/seqloc/Na_strand.hpp>#include <objects/seqset/Bioseq_set.hpp> // for EClass#include <objects/seq/Seq_inst.hpp> // for EMol#include <objmgr/seq_id_handle.hpp>#include <objmgr/impl/heap_scope.hpp>BEGIN_NCBI_SCOPEBEGIN_SCOPE(objects)class CDataSource;class CSeqMap;class CSeqVector;class CScope;class CSeq_id;class CSeq_loc;class CBioseq_Info;class CTSE_Info;class CSeq_entry;class CSeq_annot;class CSeqMatch_Info;class CSynonymsSet;class CBioseq_ScopeInfo;class CSeq_id_ScopeInfo;class CBioseq_Handle;class CSeq_annot_Handle;class CSeq_entry_Handle;class CBioseq_EditHandle;class CBioseq_set_EditHandle;class CSeq_annot_EditHandle;class CSeq_entry_EditHandle;// Bioseq handle -- must be a copy-safe const type.class NCBI_XOBJMGR_EXPORT CBioseq_Handle{public:    // Default constructor    CBioseq_Handle(void);    // Get scope this handle belongs to    CScope& GetScope(void) const;    // Get id used to obtain this bioseq handle    CConstRef<CSeq_id> GetSeqId(void) const;    const CSeq_id_Handle& GetSeq_id_Handle(void) const;    // Check if this id can be used to obtain this bioseq handle    bool IsSynonym(const CSeq_id& id) const;    CConstRef<CSynonymsSet> GetSynonyms(void) const;    // Get parent Seq-entry handle    CSeq_entry_Handle GetParentEntry(void) const;    CSeq_entry_Handle GetSeq_entry_Handle(void) const;    // Get top level Seq-entry handle    CSeq_entry_Handle GetTopLevelEntry(void) const;    // Get 'edit' version of handle    CBioseq_EditHandle GetEditHandle(void) const;    // Bioseq core -- using partially populated CBioseq    typedef CConstRef<CBioseq> TBioseqCore;    // Get bioseq core structure    TBioseqCore GetBioseqCore(void) const;    // Get the complete bioseq    CConstRef<CBioseq> GetCompleteBioseq(void) const;    // Deprecated interface.    const CBioseq& GetBioseq(void) const;    const CSeq_entry& GetTopLevelSeqEntry(void) const;    //////////////////////////////////////////////////////////////////    // Bioseq members    // id    typedef vector<CSeq_id_Handle> TId;    bool IsSetId(void) const;    bool CanGetId(void) const;    const TId& GetId(void) const;    // descr    typedef CSeq_descr TDescr;    bool IsSetDescr(void) const;    bool CanGetDescr(void) const;    const TDescr& GetDescr(void) const;    // inst    typedef CSeq_inst TInst;    bool IsSetInst(void) const;    bool CanGetInst(void) const;    const TInst& GetInst(void) const;    // inst.repr    typedef TInst::TRepr TInst_Repr;    bool IsSetInst_Repr(void) const;    bool CanGetInst_Repr(void) const;    TInst_Repr GetInst_Repr(void) const;    // inst.mol    typedef TInst::TMol TInst_Mol;    bool IsSetInst_Mol(void) const;    bool CanGetInst_Mol(void) const;    TInst_Mol GetInst_Mol(void) const;    // inst.length    typedef TInst::TLength TInst_Length;    bool IsSetInst_Length(void) const;    bool CanGetInst_Length(void) const;    TInst_Length GetInst_Length(void) const;    TSeqPos GetBioseqLength(void) const; // try to calculate it if not set    // inst.fuzz    typedef TInst::TFuzz TInst_Fuzz;    bool IsSetInst_Fuzz(void) const;    bool CanGetInst_Fuzz(void) const;    const TInst_Fuzz& GetInst_Fuzz(void) const;    // inst.topology    typedef TInst::TTopology TInst_Topology;    bool IsSetInst_Topology(void) const;    bool CanGetInst_Topology(void) const;    TInst_Topology GetInst_Topology(void) const;    // inst.strand    typedef TInst::TStrand TInst_Strand;    bool IsSetInst_Strand(void) const;    bool CanGetInst_Strand(void) const;    TInst_Strand GetInst_Strand(void) const;    // inst.seq-data    typedef TInst::TSeq_data TInst_Seq_data;    bool IsSetInst_Seq_data(void) const;    bool CanGetInst_Seq_data(void) const;    const TInst_Seq_data& GetInst_Seq_data(void) const;    // inst.ext    typedef TInst::TExt TInst_Ext;    bool IsSetInst_Ext(void) const;    bool CanGetInst_Ext(void) const;    const TInst_Ext& GetInst_Ext(void) const;    // inst.hist    typedef TInst::THist TInst_Hist;    bool IsSetInst_Hist(void) const;    bool CanGetInst_Hist(void) const;    const TInst_Hist& GetInst_Hist(void) const;    // annot    bool HasAnnots(void) const;    //////////////////////////////////////////////////////////////////    // Old interface:    // Go up to a certain complexity level (or the nearest level of the same    // priority if the required class is not found):    // level   class    // 0       not-set (0) ,    // 3       nuc-prot (1) ,       -- nuc acid and coded proteins    // 2       segset (2) ,         -- segmented sequence + parts    // 2       conset (3) ,         -- constructed sequence + parts    // 1       parts (4) ,          -- parts for 2 or 3    // 1       gibb (5) ,           -- geninfo backbone    // 1       gi (6) ,             -- geninfo    // 5       genbank (7) ,        -- converted genbank    // 3       pir (8) ,            -- converted pir    // 4       pub-set (9) ,        -- all the seqs from a single publication    // 4       equiv (10) ,         -- a set of equivalent maps or seqs    // 3       swissprot (11) ,     -- converted SWISSPROT    // 3       pdb-entry (12) ,     -- a complete PDB entry    // 4       mut-set (13) ,       -- set of mutations    // 4       pop-set (14) ,       -- population study    // 4       phy-set (15) ,       -- phylogenetic study    // 4       eco-set (16) ,       -- ecological sample study    // 4       gen-prod-set (17) ,  -- genomic products, chrom+mRNa+protein    // 4       wgs-set (18) ,       -- whole genome shotgun project    // 0       other (255)    CSeq_entry_Handle GetComplexityLevel(CBioseq_set::EClass cls) const;    // Return level with exact complexity, or empty handle if not found.    CSeq_entry_Handle GetExactComplexityLevel(CBioseq_set::EClass cls) const;    // Get some values from core:    CSeq_inst::TMol GetBioseqMolType(void) const;    // Get sequence map.    const CSeqMap& GetSeqMap(void) const;    // CSeqVector constructor flags    enum EVectorCoding {        eCoding_NotSet, // Use original coding - DANGEROUS! - may change        eCoding_Ncbi,   // Set coding to binary coding (Ncbi4na or Ncbistdaa)        eCoding_Iupac   // Set coding to printable coding (Iupacna or Iupacaa)    };    enum EVectorStrand {        eStrand_Plus,   // Plus strand        eStrand_Minus   // Minus strand    };    // Get sequence: Iupacna or Iupacaa if use_iupac_coding is true    CSeqVector GetSeqVector(EVectorCoding coding,                            ENa_strand strand = eNa_strand_plus) const;    CSeqVector GetSeqVector(ENa_strand strand = eNa_strand_plus) const;    CSeqVector GetSeqVector(EVectorCoding coding, EVectorStrand strand) const;    CSeqVector GetSeqVector(EVectorStrand strand) const;    // Sequence filtering: get a seq-vector for a part of the sequence.    // The part shown depends oon the mode selected. If the location    // contains references to other sequences they are ignored (unlike    // CBioseq constructor, which constructs a bioseq using all references    // from a location). Strand information from "location" is ingored    // when creating merged or excluded views. If "minus_strand" is true,    // the result is reverse-complement.    enum ESequenceViewMode {        eViewConstructed,    // Do not merge or reorder intervals        eViewMerged,         // Merge overlapping intervals, sort by location        eViewExcluded        // Show intervals not included in the seq-loc    };    CSeqVector GetSequenceView(const CSeq_loc& location,                               ESequenceViewMode mode,                               EVectorCoding coding = eCoding_Ncbi,                               ENa_strand strand = eNa_strand_plus) const;    CConstRef<CSeqMap> GetSeqMapByLocation(const CSeq_loc& location,                                           ESequenceViewMode mode) const;    CRef<CSeq_loc> MapLocation(const CSeq_loc& loc) const;    // Utility methods/operators    // Comparison    bool operator== (const CBioseq_Handle& h) const;    bool operator!= (const CBioseq_Handle& h) const;    bool operator<  (const CBioseq_Handle& h) const;    // Check    operator bool(void)  const;    bool operator!(void) const;    // these methods are for cross scope move only.    CBioseq_EditHandle CopyTo(const CSeq_entry_EditHandle& entry,                              int index = -1) const;    CBioseq_EditHandle CopyTo(const CBioseq_set_EditHandle& seqset,                              int index = -1) const;    CBioseq_EditHandle CopyToSeq(const CSeq_entry_EditHandle& entry) const;protected:    friend class CScope_Impl;    friend class CSynonymsSet;    CBioseq_Handle(const CSeq_id_Handle& id, CBioseq_ScopeInfo* bioseq_info);    const CBioseq_ScopeInfo& x_GetScopeInfo(void) const;    CHeapScope          m_Scope;    CSeq_id_Handle      m_Seq_id;    CConstRef<CObject>  m_Bioseq_Info;public: // non-public section    const CBioseq_Info& x_GetInfo(void) const;};class NCBI_XOBJMGR_EXPORT CBioseq_EditHandle : public CBioseq_Handle{public:    CBioseq_EditHandle(void);        CSeq_entry_EditHandle GetParentEntry(void) const;    // Modification functions    //////////////////////////////////////////////////////////////////    // Bioseq members    // id    void ResetId(void) const;    bool AddId(const CSeq_id_Handle& id) const;    bool RemoveId(const CSeq_id_Handle& id) const;    // descr    void SetDescr(TDescr& v) const;    // inst    void SetInst(TInst& v) const;    // inst.repr    void SetInst_Repr(TInst_Repr v) const;    // inst.mol    void SetInst_Mol(TInst_Mol v) const;

⌨️ 快捷键说明

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