annot_types_ci.cpp
来自「ncbi源码」· C++ 代码 · 共 679 行 · 第 1/2 页
CPP
679 行
/* * =========================================================================== * PRODUCTION $Log: annot_types_ci.cpp,v $ * PRODUCTION Revision 1000.5 2004/06/01 19:22:48 gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.121 * PRODUCTION * =========================================================================== *//* $Id: annot_types_ci.cpp,v 1000.5 2004/06/01 19:22:48 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, Eugene Vasilchenko** File Description:* Object manager iterators**/#include <ncbi_pch.hpp>#include <objmgr/annot_types_ci.hpp>#include <objmgr/impl/handle_range_map.hpp>#include <objmgr/impl/snp_annot_info.hpp>BEGIN_NCBI_SCOPEBEGIN_SCOPE(objects)/////////////////////////////////////////////////////////////////////////////// CAnnotTypes_CI/////////////////////////////////////////////////////////////////////////////CAnnotTypes_CI::CAnnotTypes_CI(void) : m_DataCollector(0){ return;}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, CScope& scope, const CSeq_loc& loc, const SAnnotSelector& params) : m_DataCollector(new CAnnot_Collector(params, scope)){ m_DataCollector->GetSelector().CheckAnnotType(type); CHandleRangeMap master_loc; master_loc.AddLocation(loc); m_DataCollector->x_Initialize(master_loc); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CBioseq_Handle& bioseq, TSeqPos start, TSeqPos stop, const SAnnotSelector& params) : m_DataCollector(new CAnnot_Collector(params, bioseq.GetScope())){ m_DataCollector->GetSelector().CheckAnnotType(type); m_DataCollector->x_Initialize(bioseq, start, stop); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CSeq_annot_Handle& annot) : m_DataCollector(new CAnnot_Collector(SAnnotSelector(type), annot.GetScope())){ m_DataCollector->GetSelector() .SetResolveNone() // nothing to resolve .SetLimitSeqAnnot(annot); m_DataCollector->x_Initialize(); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CSeq_annot_Handle& annot, const SAnnotSelector& params) : m_DataCollector(new CAnnot_Collector(params, annot.GetScope())){ m_DataCollector->GetSelector() .CheckAnnotType(type) .SetResolveNone() // nothing to resolve .SetLimitSeqAnnot(annot); m_DataCollector->x_Initialize(); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CSeq_entry_Handle& entry) : m_DataCollector(new CAnnot_Collector(SAnnotSelector(type), entry.GetScope())){ m_DataCollector->GetSelector() .SetResolveNone() // nothing to resolve .SetSortOrder(SAnnotSelector::eSortOrder_None) .SetLimitSeqEntry(entry); m_DataCollector->x_Initialize(); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CSeq_entry_Handle& entry, const SAnnotSelector& params) : m_DataCollector(new CAnnot_Collector(params, entry.GetScope())){ m_DataCollector->GetSelector() .CheckAnnotType(type) .SetResolveNone() // nothing to resolve .SetSortOrder(SAnnotSelector::eSortOrder_None) .SetLimitSeqEntry(entry); m_DataCollector->x_Initialize(); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, CScope& scope, const CSeq_loc& loc, //const SAnnotSelector& selector, SAnnotSelector::EOverlapType overlap_type, SAnnotSelector::EResolveMethod resolve_method) : m_DataCollector(new CAnnot_Collector(SAnnotSelector(), scope)){ m_DataCollector->GetSelector() .CheckAnnotType(type) .SetOverlapType(overlap_type) .SetResolveMethod(resolve_method); CHandleRangeMap master_loc; master_loc.AddLocation(loc); m_DataCollector->x_Initialize(master_loc); Rewind();}CAnnotTypes_CI::CAnnotTypes_CI(TAnnotType type, const CBioseq_Handle& bioseq, TSeqPos start, TSeqPos stop, //const SAnnotSelector& selector, SAnnotSelector::EOverlapType overlap_type, SAnnotSelector::EResolveMethod resolve_method) : m_DataCollector(new CAnnot_Collector(SAnnotSelector(), bioseq.GetScope())){ m_DataCollector->GetSelector() .CheckAnnotType(type) .SetOverlapType(overlap_type) .SetResolveMethod(resolve_method); m_DataCollector->x_Initialize(bioseq, start, stop); Rewind();}CSeq_annot_Handle CAnnotTypes_CI::GetAnnot(void) const{ const CAnnotObject_Ref& ref = Get(); const CSeq_annot_Info* info; if ( ref.GetObjectType() == ref.eType_Seq_annot_SNP_Info ) { info = &ref.GetSeq_annot_SNP_Info().GetParentSeq_annot_Info(); } else { info = &ref.GetSeq_annot_Info(); } return CSeq_annot_Handle(GetScope(), *info);}const CSeq_annot& CAnnotTypes_CI::GetSeq_annot(void) const{ ERR_POST_ONCE(Warning<< "CAnnotTypes_CI::GetSeq_annot() is deprecated, " "use GetAnnot()"); return *GetAnnot().GetCompleteSeq_annot();}CAnnotTypes_CI::~CAnnotTypes_CI(void){ return;}END_SCOPE(objects)END_NCBI_SCOPE/** ---------------------------------------------------------------------------* $Log: annot_types_ci.cpp,v $* Revision 1000.5 2004/06/01 19:22:48 gouriano* PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.121** Revision 1.121 2004/05/21 21:42:12 gorelenk* Added PCH ncbi_pch.hpp** Revision 1.120 2004/04/05 15:56:14 grichenk* Redesigned CAnnotTypes_CI: moved all data and data collecting* functions to CAnnotDataCollector. CAnnotTypes_CI is no more* inherited from SAnnotSelector.** Revision 1.119 2004/04/01 20:18:12 grichenk* Added initialization of m_MultiId member.** Revision 1.118 2004/03/31 20:43:29 grichenk* Fixed mapping of seq-locs containing both master sequence* and its segments.** Revision 1.117 2004/03/30 15:42:33 grichenk* Moved alignment mapper to separate file, added alignment mapping* to CSeq_loc_Mapper.** Revision 1.116 2004/03/24 18:30:29 vasilche* Fixed edit API.* Every *_Info object has its own shallow copy of original object.** Revision 1.115 2004/03/16 15:47:27 vasilche* Added CBioseq_set_Handle and set of EditHandles** Revision 1.114 2004/02/26 14:41:41 grichenk* Fixed types excluding in SAnnotSelector and multiple types search* in CAnnotTypes_CI.** Revision 1.113 2004/02/19 19:25:08 vasilche* Hidded implementation of CAnnotObject_Ref.* Added necessary access methods.** Revision 1.112 2004/02/09 14:48:37 vasilche* Got rid of performance warning on MSVC.** Revision 1.111 2004/02/06 18:31:54 vasilche* Fixed annot sorting class - deal with different annot types (graph align feat).** Revision 1.110 2004/02/05 19:53:40 grichenk* Fixed type matching in SAnnotSelector. Added IncludeAnnotType().** Revision 1.109 2004/02/04 18:05:38 grichenk* Added annotation filtering by set of types/subtypes.* Renamed *Choice to *Type in SAnnotSelector.** Revision 1.108 2004/01/30 15:25:45 grichenk* Fixed alignments mapping and sorting** Revision 1.107 2004/01/28 20:54:36 vasilche* Fixed mapping of annotations.** Revision 1.106 2004/01/26 17:50:55 vasilche* Do assert check only when object is non-null.** Revision 1.105 2004/01/23 16:14:47 grichenk* Implemented alignment mapping** Revision 1.104 2004/01/22 20:10:40 vasilche* 1. Splitted ID2 specs to two parts.* ID2 now specifies only protocol.* Specification of ID2 split data is moved to seqsplit ASN module.* For now they are still reside in one resulting library as before - libid2.* As the result split specific headers are now in objects/seqsplit.* 2. Moved ID2 and ID1 specific code out of object manager.* Protocol is processed by corresponding readers.* ID2 split parsing is processed by ncbi_xreader library - used by all readers.* 3. Updated OBJMGR_LIBS correspondingly.** Revision 1.103 2003/11/26 17:55:56 vasilche* Implemented ID2 split in ID1 cache.* Fixed loading of splitted annotations.** Revision 1.102 2003/11/13 19:12:53 grichenk* Added possibility to exclude TSEs from annotations request.** Revision 1.101 2003/11/10 18:11:03 grichenk* Moved CSeq_loc_Conversion_Set to seq_loc_cvt** Revision 1.100 2003/11/05 00:33:53 ucko* Un-inline CSeq_loc_Conversion_Set::Add due to use before definition.** Revision 1.99 2003/11/04 21:10:01 grichenk* Optimized feature mapping through multiple segments.* Fixed problem with CAnnotTypes_CI not releasing scope* when exception is thrown from constructor.** Revision 1.98 2003/11/04 16:21:37 grichenk* Updated CAnnotTypes_CI to map whole features instead of splitting* them by sequence segments.** Revision 1.97 2003/10/28 14:46:29 vasilche* Fixed wrong _ASSERT().** Revision 1.96 2003/10/27 20:07:10 vasilche* Started implementation of full annotations' mapping.** Revision 1.95 2003/10/10 12:47:24 dicuccio* Fixed off-by-one error in x_Search() - allocate correct size for array** Revision 1.94 2003/10/09 20:20:58 vasilche* Added possibility to include and exclude Seq-annot names to annot iterator.* Fixed adaptive search. It looked only on selected set of annot names before.** Revision 1.93 2003/10/07 13:43:23 vasilche* Added proper handling of named Seq-annots.* Added feature search from named Seq-annots.* Added configurable adaptive annotation search (default: gene, cds, mrna).* Fixed selection of blobs for loading from GenBank.* Added debug checks to CSeq_id_Mapper for easier finding lost CSeq_id_Handles.* Fixed leaked split chunks annotation stubs.* Moved some classes definitions in separate *.cpp files.** Revision 1.92 2003/09/30 16:22:02 vasilche* Updated internal object manager classes to be able to load ID2 data.* SNP blobs are loaded as ID2 split blobs - readers convert them automatically.* Scope caches results of requests for data to data loaders.* Optimized CSeq_id_Handle for gis.* Optimized bioseq lookup in scope.* Reduced object allocations in annotation iterators.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?