annot_selector.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:22k
源码类别:

生物技术

开发平台:

C/C++

  1. /*
  2.  * ===========================================================================
  3.  * PRODUCTION $Log: annot_selector.cpp,v $
  4.  * PRODUCTION Revision 1000.3  2004/06/01 19:22:41  gouriano
  5.  * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.12
  6.  * PRODUCTION
  7.  * ===========================================================================
  8.  */
  9. /*  $Id: annot_selector.cpp,v 1000.3 2004/06/01 19:22:41 gouriano Exp $
  10. * ===========================================================================
  11. *
  12. *                            PUBLIC DOMAIN NOTICE
  13. *               National Center for Biotechnology Information
  14. *
  15. *  This software/database is a "United States Government Work" under the
  16. *  terms of the United States Copyright Act.  It was written as part of
  17. *  the author's official duties as a United States Government employee and
  18. *  thus cannot be copyrighted.  This software/database is freely available
  19. *  to the public for use. The National Library of Medicine and the U.S.
  20. *  Government have not placed any restriction on its use or reproduction.
  21. *
  22. *  Although all reasonable efforts have been taken to ensure the accuracy
  23. *  and reliability of the software and data, the NLM and the U.S.
  24. *  Government do not and cannot warrant the performance or results that
  25. *  may be obtained by using this software or data. The NLM and the U.S.
  26. *  Government disclaim all warranties, express or implied, including
  27. *  warranties of performance, merchantability or fitness for any particular
  28. *  purpose.
  29. *
  30. *  Please cite the author in any work or product based on this material.
  31. *
  32. * ===========================================================================
  33. *
  34. * Author: Aleksey Grichenko, Eugene Vasilchenko
  35. *
  36. * File Description:
  37. *
  38. */
  39. #include <ncbi_pch.hpp>
  40. #include <objmgr/annot_selector.hpp>
  41. #include <objmgr/impl/tse_info.hpp>
  42. #include <objmgr/impl/seq_entry_info.hpp>
  43. #include <objmgr/impl/seq_annot_info.hpp>
  44. #include <objmgr/impl/annot_type_index.hpp>
  45. #include <objmgr/seq_entry_handle.hpp>
  46. #include <objmgr/seq_annot_handle.hpp>
  47. #include <objects/seqset/Seq_entry.hpp>
  48. #include <objects/seq/Seq_annot.hpp>
  49. #include <algorithm>
  50. BEGIN_NCBI_SCOPE
  51. BEGIN_SCOPE(objects)
  52. ////////////////////////////////////////////////////////////////////
  53. //
  54. //  SAnnotSelector
  55. //
  56. SAnnotSelector::SAnnotSelector(TAnnotType annot,
  57.                                TFeatType feat)
  58.     : SAnnotTypeSelector(annot),
  59.       m_FeatProduct(false),
  60.       m_ResolveDepth(kMax_Int),
  61.       m_OverlapType(eOverlap_Intervals),
  62.       m_ResolveMethod(eResolve_TSE),
  63.       m_SegmentSelect(eSegmentSelect_All),
  64.       m_SortOrder(eSortOrder_Normal),
  65.       m_CombineMethod(eCombine_None),
  66.       m_LimitObjectType(eLimit_None),
  67.       m_IdResolving(eIgnoreUnresolved),
  68.       m_MaxSize(kMax_UInt),
  69.       m_NoMapping(false),
  70.       m_AdaptiveDepth(false)
  71. {
  72.     if ( feat != CSeqFeatData::e_not_set ) {
  73.         SetFeatType(feat);
  74.     }
  75. }
  76. SAnnotSelector::SAnnotSelector(TFeatType feat)
  77.     : SAnnotTypeSelector(feat),
  78.       m_FeatProduct(false),
  79.       m_ResolveDepth(kMax_Int),
  80.       m_OverlapType(eOverlap_Intervals),
  81.       m_ResolveMethod(eResolve_TSE),
  82.       m_SegmentSelect(eSegmentSelect_All),
  83.       m_SortOrder(eSortOrder_Normal),
  84.       m_CombineMethod(eCombine_None),
  85.       m_LimitObjectType(eLimit_None),
  86.       m_IdResolving(eIgnoreUnresolved),
  87.       m_MaxSize(kMax_UInt),
  88.       m_NoMapping(false),
  89.       m_AdaptiveDepth(false)
  90. {
  91. }
  92. SAnnotSelector::SAnnotSelector(TAnnotType annot,
  93.                                TFeatType feat,
  94.                                bool feat_product)
  95.     : SAnnotTypeSelector(annot),
  96.       m_FeatProduct(feat_product),
  97.       m_ResolveDepth(kMax_Int),
  98.       m_OverlapType(eOverlap_Intervals),
  99.       m_ResolveMethod(eResolve_TSE),
  100.       m_SegmentSelect(eSegmentSelect_All),
  101.       m_SortOrder(eSortOrder_Normal),
  102.       m_CombineMethod(eCombine_None),
  103.       m_LimitObjectType(eLimit_None),
  104.       m_IdResolving(eIgnoreUnresolved),
  105.       m_MaxSize(kMax_UInt),
  106.       m_NoMapping(false),
  107.       m_AdaptiveDepth(false)
  108. {
  109.     if ( feat != CSeqFeatData::e_not_set ) {
  110.         SetFeatType(feat);
  111.     }
  112. }
  113. SAnnotSelector::SAnnotSelector(TFeatType feat,
  114.                                bool feat_product)
  115.     : SAnnotTypeSelector(feat),
  116.       m_FeatProduct(feat_product),
  117.       m_ResolveDepth(kMax_Int),
  118.       m_OverlapType(eOverlap_Intervals),
  119.       m_ResolveMethod(eResolve_TSE),
  120.       m_SegmentSelect(eSegmentSelect_All),
  121.       m_SortOrder(eSortOrder_Normal),
  122.       m_CombineMethod(eCombine_None),
  123.       m_LimitObjectType(eLimit_None),
  124.       m_IdResolving(eIgnoreUnresolved),
  125.       m_MaxSize(kMax_UInt),
  126.       m_NoMapping(false),
  127.       m_AdaptiveDepth(false)
  128. {
  129. }
  130. SAnnotSelector::SAnnotSelector(const SAnnotSelector& sel)
  131. {
  132.     *this = sel;
  133. }
  134. SAnnotSelector& SAnnotSelector::operator=(const SAnnotSelector& sel)
  135. {
  136.     if ( this != &sel ) {
  137.         static_cast<SAnnotTypeSelector&>(*this) = sel;
  138.         m_FeatProduct = sel.m_FeatProduct;
  139.         m_ResolveDepth = sel.m_ResolveDepth;
  140.         m_OverlapType = sel.m_OverlapType;
  141.         m_ResolveMethod = sel.m_ResolveMethod;
  142.         m_SegmentSelect = sel.m_SegmentSelect;
  143.         m_SortOrder = sel.m_SortOrder;
  144.         m_CombineMethod = sel.m_CombineMethod;
  145.         m_LimitObjectType = sel.m_LimitObjectType;
  146.         m_IdResolving = sel.m_IdResolving;
  147.         m_LimitObject = sel.m_LimitObject;
  148.         m_MaxSize = sel.m_MaxSize;
  149.         m_IncludeAnnotsNames = sel.m_IncludeAnnotsNames;
  150.         m_ExcludeAnnotsNames = sel.m_ExcludeAnnotsNames;
  151.         m_NoMapping = sel.m_NoMapping;
  152.         m_AdaptiveDepth = sel.m_AdaptiveDepth;
  153.         m_AdaptiveTriggers = sel.m_AdaptiveTriggers;
  154.         m_ExcludedTSE = sel.m_ExcludedTSE;
  155.         m_AnnotTypesSet = sel.m_AnnotTypesSet;
  156.     }
  157.     return *this;
  158. }
  159. SAnnotSelector::~SAnnotSelector(void)
  160. {
  161. }
  162. SAnnotSelector& SAnnotSelector::SetLimitNone(void)
  163. {
  164.     m_LimitObjectType = eLimit_None;
  165.     m_LimitObject.Reset();
  166.     return *this;
  167. }
  168. SAnnotSelector&
  169. SAnnotSelector::SetLimitTSE(const CSeq_entry_Handle& limit)
  170. {
  171.     if ( !limit )
  172.         return SetLimitNone();
  173.     
  174.     const CTSE_Info& info = limit.x_GetInfo().GetTSE_Info();
  175.     m_LimitObjectType = eLimit_TSE_Info;
  176.     m_LimitObject.Reset(&info);
  177.     return *this;
  178. }
  179. SAnnotSelector&
  180. SAnnotSelector::SetLimitSeqEntry(const CSeq_entry_Handle& limit)
  181. {
  182.     if ( !limit )
  183.         return SetLimitNone();
  184.     
  185.     const CSeq_entry_Info& info = limit.x_GetInfo();
  186.     m_LimitObjectType = eLimit_Seq_entry_Info;
  187.     m_LimitObject.Reset(&info);
  188.     return *this;
  189. }
  190. SAnnotSelector&
  191. SAnnotSelector::SetLimitSeqAnnot(const CSeq_annot_Handle& limit)
  192. {
  193.     if ( !limit )
  194.         return SetLimitNone();
  195.     
  196.     const CSeq_annot_Info& info = limit.x_GetInfo();
  197.     m_LimitObjectType = eLimit_Seq_annot_Info;
  198.     m_LimitObject.Reset(&info);
  199.     return *this;
  200. }
  201. SAnnotSelector&
  202. SAnnotSelector::SetLimitTSE(const CSeq_entry* limit)
  203. {
  204.     if ( !limit )
  205.         return SetLimitNone();
  206.     
  207.     m_LimitObjectType = eLimit_TSE;
  208.     m_LimitObject.Reset(limit);
  209.     return *this;
  210. }
  211. SAnnotSelector&
  212. SAnnotSelector::SetLimitSeqEntry(const CSeq_entry* limit)
  213. {
  214.     if ( !limit )
  215.         return SetLimitNone();
  216.     
  217.     m_LimitObjectType = eLimit_Seq_entry;
  218.     m_LimitObject.Reset(limit);
  219.     return *this;
  220. }
  221. SAnnotSelector&
  222. SAnnotSelector::SetLimitSeqAnnot(const CSeq_annot* limit)
  223. {
  224.     if ( !limit )
  225.         return SetLimitNone();
  226.     
  227.     m_LimitObjectType = eLimit_Seq_annot;
  228.     m_LimitObject.Reset(limit);
  229.     return *this;
  230. }
  231. bool SAnnotSelector::x_Has(const TAnnotsNames& names, const CAnnotName& name)
  232. {
  233.     return find(names.begin(), names.end(), name) != names.end();
  234. }
  235. void SAnnotSelector::x_Add(TAnnotsNames& names, const CAnnotName& name)
  236. {
  237.     if ( !x_Has(names, name) ) {
  238.         names.push_back(name);
  239.     }
  240. }
  241. void SAnnotSelector::x_Del(TAnnotsNames& names, const CAnnotName& name)
  242. {
  243.     NON_CONST_ITERATE( TAnnotsNames, it, names ) {
  244.         if ( *it == name ) {
  245.             names.erase(it);
  246.             return;
  247.         }
  248.     }
  249. }
  250. bool SAnnotSelector::IncludedAnnotName(const CAnnotName& name) const
  251. {
  252.     return x_Has(m_IncludeAnnotsNames, name);
  253. }
  254. bool SAnnotSelector::ExcludedAnnotName(const CAnnotName& name) const
  255. {
  256.     return x_Has(m_ExcludeAnnotsNames, name);
  257. }
  258. SAnnotSelector& SAnnotSelector::ResetAnnotsNames(void)
  259. {
  260.     m_IncludeAnnotsNames.clear();
  261.     m_ExcludeAnnotsNames.clear();
  262.     return *this;
  263. }
  264. SAnnotSelector& SAnnotSelector::AddNamedAnnots(const CAnnotName& name)
  265. {
  266.     x_Add(m_IncludeAnnotsNames, name);
  267.     x_Del(m_ExcludeAnnotsNames, name);
  268.     return *this;
  269. }
  270. SAnnotSelector& SAnnotSelector::AddNamedAnnots(const char* name)
  271. {
  272.     return AddNamedAnnots(CAnnotName(name));
  273. }
  274. SAnnotSelector& SAnnotSelector::AddUnnamedAnnots(void)
  275. {
  276.     return AddNamedAnnots(CAnnotName());
  277. }
  278. SAnnotSelector& SAnnotSelector::ExcludeNamedAnnots(const CAnnotName& name)
  279. {
  280.     x_Add(m_ExcludeAnnotsNames, name);
  281.     x_Del(m_IncludeAnnotsNames, name);
  282.     return *this;
  283. }
  284. SAnnotSelector& SAnnotSelector::ExcludeNamedAnnots(const char* name)
  285. {
  286.     return ExcludeNamedAnnots(CAnnotName(name));
  287. }
  288. SAnnotSelector& SAnnotSelector::ExcludeUnnamedAnnots(void)
  289. {
  290.     return ExcludeNamedAnnots(CAnnotName());
  291. }
  292. SAnnotSelector& SAnnotSelector::SetAllNamedAnnots(void)
  293. {
  294.     ResetAnnotsNames();
  295.     ExcludeUnnamedAnnots();
  296.     return *this;
  297. }
  298. SAnnotSelector& SAnnotSelector::SetDataSource(const string& source)
  299. {
  300.     if ( source.empty() ) {
  301.         AddUnnamedAnnots();
  302.     }
  303.     return AddNamedAnnots(source);
  304. }
  305. SAnnotSelector&
  306. SAnnotSelector::SetAdaptiveTrigger(const SAnnotTypeSelector& sel)
  307. {
  308.     ITERATE ( TAdaptiveTriggers, it, m_AdaptiveTriggers ) {
  309.         if ( *it == sel ) {
  310.             return *this;
  311.         }
  312.     }
  313.     m_AdaptiveTriggers.push_back(sel);
  314.     return *this;
  315. }
  316. SAnnotSelector&
  317. SAnnotSelector::ExcludeTSE(const CSeq_entry_Handle& tse)
  318. {
  319.     if ( !ExcludedTSE(tse) ) {
  320.         m_ExcludedTSE.push_back(tse);
  321.     }
  322.     return *this;
  323. }
  324. SAnnotSelector&
  325. SAnnotSelector::ResetExcludedTSE(void)
  326. {
  327.     m_ExcludedTSE.clear();
  328.     return *this;
  329. }
  330. bool SAnnotSelector::ExcludedTSE(const CSeq_entry_Handle& tse) const
  331. {
  332.     return find(m_ExcludedTSE.begin(), m_ExcludedTSE.end(), tse)
  333.         != m_ExcludedTSE.end();
  334. }
  335. void SAnnotSelector::x_ClearAnnotTypesSet(void)
  336. {
  337.     m_AnnotTypesSet.clear();
  338. }
  339. void SAnnotSelector::x_InitializeAnnotTypesSet(bool default_value)
  340. {
  341.     if (m_AnnotTypesSet.size() > 0) {
  342.         return;
  343.     }
  344.     m_AnnotTypesSet.resize(CAnnotType_Index::GetAnnotTypeRange(
  345.         CSeq_annot::C_Data::e_Ftable).second, default_value);
  346.     // Do not try to use flags from an uninitialized selector
  347.     if (GetAnnotType() != CSeq_annot::C_Data::e_not_set) {
  348.         // Copy current state to the set
  349.         CAnnotType_Index::TIndexRange range =
  350.             CAnnotType_Index::GetIndexRange(*this);
  351.         for (size_t i = range.first; i < range.second; ++i) {
  352.             m_AnnotTypesSet[i] = true;
  353.         }
  354.     }
  355.     // Do not call this->SetAnnotType() -- it will reset the types set.
  356.     // Set type to Ftable -- only feature types/subtypes may be selected.
  357.     SAnnotTypeSelector::SetAnnotType(CSeq_annot::C_Data::e_Ftable);
  358. }
  359. SAnnotSelector& SAnnotSelector::IncludeAnnotType(TAnnotType type)
  360. {
  361.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set) {
  362.         SAnnotTypeSelector::SetAnnotType(type);
  363.     }
  364.     else if (m_AnnotTypesSet.size() > 0  ||  !IncludedAnnotType(type)) {
  365.         x_InitializeAnnotTypesSet(false);
  366.         CAnnotType_Index::TIndexRange range =
  367.             CAnnotType_Index::GetAnnotTypeRange(type);
  368.         for (size_t i = range.first; i < range.second; ++i) {
  369.             m_AnnotTypesSet[i] = true;
  370.         }
  371.     }
  372.     return *this;
  373. }
  374. SAnnotSelector& SAnnotSelector::ExcludeAnnotType(TAnnotType type)
  375. {
  376.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set
  377.         ||  m_AnnotTypesSet.size() > 0  ||  IncludedAnnotType(type)) {
  378.         x_InitializeAnnotTypesSet(true);
  379.         CAnnotType_Index::TIndexRange range =
  380.             CAnnotType_Index::GetAnnotTypeRange(type);
  381.         for (size_t i = range.first; i < range.second; ++i) {
  382.             m_AnnotTypesSet[i] = false;
  383.         }
  384.     }
  385.     return *this;
  386. }
  387. SAnnotSelector& SAnnotSelector::IncludeFeatType(TFeatType type)
  388. {
  389.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set) {
  390.         SAnnotTypeSelector::SetFeatType(type);
  391.     }
  392.     else if (m_AnnotTypesSet.size() > 0  ||  !IncludedFeatType(type)) {
  393.         x_InitializeAnnotTypesSet(false);
  394.         CAnnotType_Index::TIndexRange range =
  395.             CAnnotType_Index::GetFeatTypeRange(type);
  396.         for (size_t i = range.first; i < range.second; ++i) {
  397.             m_AnnotTypesSet[i] = true;
  398.         }
  399.     }
  400.     return *this;
  401. }
  402. SAnnotSelector& SAnnotSelector::ExcludeFeatType(TFeatType type)
  403. {
  404.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set
  405.         ||  m_AnnotTypesSet.size() > 0  ||  IncludedFeatType(type)) {
  406.         x_InitializeAnnotTypesSet(true);
  407.         CAnnotType_Index::TIndexRange range =
  408.             CAnnotType_Index::GetFeatTypeRange(type);
  409.         for (size_t i = range.first; i < range.second; ++i) {
  410.             m_AnnotTypesSet[i] = false;
  411.         }
  412.     }
  413.     return *this;
  414. }
  415. SAnnotSelector& SAnnotSelector::IncludeFeatSubtype(TFeatSubtype subtype)
  416. {
  417.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set) {
  418.         SAnnotTypeSelector::SetFeatSubtype(subtype);
  419.     }
  420.     else if (m_AnnotTypesSet.size() > 0  ||  !IncludedFeatSubtype(subtype)) {
  421.         x_InitializeAnnotTypesSet(false);
  422.         m_AnnotTypesSet[CAnnotType_Index::GetSubtypeIndex(subtype)] = true;
  423.     }
  424.     return *this;
  425. }
  426. SAnnotSelector& SAnnotSelector::ExcludeFeatSubtype(TFeatSubtype subtype)
  427. {
  428.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set
  429.         ||  m_AnnotTypesSet.size() > 0  ||  IncludedFeatSubtype(subtype)) {
  430.         x_InitializeAnnotTypesSet(true);
  431.         m_AnnotTypesSet[CAnnotType_Index::GetSubtypeIndex(subtype)] = false;
  432.     }
  433.     return *this;
  434. }
  435. SAnnotSelector& SAnnotSelector::CheckAnnotType(TAnnotType type)
  436. {
  437.     if (GetAnnotType() == CSeq_annot::C_Data::e_not_set) {
  438.         SetAnnotType(type);
  439.     }
  440.     _ASSERT(GetAnnotType() == type);
  441.     if (m_AnnotTypesSet.size() > 0) {
  442.         CAnnotType_Index::TIndexRange range =
  443.             CAnnotType_Index::GetAnnotTypeRange(type);
  444.         for (size_t i = 0; i < range.first; ++i) {
  445.             m_AnnotTypesSet[i] = false;
  446.         }
  447.         for (size_t i = range.second; i < m_AnnotTypesSet.size(); ++i) {
  448.             m_AnnotTypesSet[i] = false;
  449.         }
  450.     }
  451.     return *this;
  452. }
  453. bool SAnnotSelector::IncludedAnnotType(TAnnotType type) const
  454. {
  455.     if (m_AnnotTypesSet.size() > 0) {
  456.         CAnnotType_Index::TIndexRange range =
  457.             CAnnotType_Index::GetAnnotTypeRange(type);
  458.         for (size_t i = range.first; i < range.second; ++i) {
  459.             if (m_AnnotTypesSet[i]) {
  460.                 return true;
  461.             }
  462.         }
  463.         return false;
  464.     }
  465.     return GetAnnotType() == CSeq_annot::C_Data::e_not_set
  466.         || GetAnnotType() == type;
  467. }
  468. bool SAnnotSelector::IncludedFeatType(TFeatType type) const
  469. {
  470.     if (m_AnnotTypesSet.size() > 0) {
  471.         CAnnotType_Index::TIndexRange range =
  472.             CAnnotType_Index::GetFeatTypeRange(type);
  473.         for (size_t i = range.first; i < range.second; ++i) {
  474.             if (m_AnnotTypesSet[i]) {
  475.                 return true;
  476.             }
  477.         }
  478.         return false;
  479.     }
  480.     return GetFeatType() == CSeqFeatData::e_not_set
  481.         || GetFeatType() == type;
  482. }
  483. bool SAnnotSelector::IncludedFeatSubtype(TFeatSubtype subtype) const
  484. {
  485.     if (m_AnnotTypesSet.size() > 0) {
  486.         return m_AnnotTypesSet[CAnnotType_Index::GetSubtypeIndex(subtype)];
  487.     }
  488.     return GetFeatSubtype() == subtype
  489.         ||  GetFeatSubtype() == CSeqFeatData::eSubtype_any;
  490. }
  491. bool SAnnotSelector::MatchType(const CAnnotObject_Info& annot_info) const
  492. {
  493.     if (annot_info.GetFeatSubtype() != CSeqFeatData::eSubtype_any) {
  494.         return IncludedFeatSubtype(annot_info.GetFeatSubtype());
  495.     }
  496.     if (annot_info.GetFeatType() != CSeqFeatData::e_not_set) {
  497.         return IncludedFeatType(annot_info.GetFeatType());
  498.     }
  499.     return IncludedAnnotType(annot_info.GetAnnotType());
  500. }
  501. END_SCOPE(objects)
  502. END_NCBI_SCOPE
  503. /*
  504. * ---------------------------------------------------------------------------
  505. * $Log: annot_selector.cpp,v $
  506. * Revision 1000.3  2004/06/01 19:22:41  gouriano
  507. * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.12
  508. *
  509. * Revision 1.12  2004/05/21 21:42:12  gorelenk
  510. * Added PCH ncbi_pch.hpp
  511. *
  512. * Revision 1.11  2004/03/17 16:04:26  vasilche
  513. * IRIX CC doesn't allow explicit call of implicit operator=()
  514. *
  515. * Revision 1.10  2004/03/16 15:47:27  vasilche
  516. * Added CBioseq_set_Handle and set of EditHandles
  517. *
  518. * Revision 1.9  2004/02/26 14:41:40  grichenk
  519. * Fixed types excluding in SAnnotSelector and multiple types search
  520. * in CAnnotTypes_CI.
  521. *
  522. * Revision 1.8  2004/02/11 22:19:24  grichenk
  523. * Fixed annot type initialization in iterators
  524. *
  525. * Revision 1.7  2004/02/05 19:53:40  grichenk
  526. * Fixed type matching in SAnnotSelector. Added IncludeAnnotType().
  527. *
  528. * Revision 1.6  2004/02/05 16:05:49  vasilche
  529. * Fixed int <-> unsigned warning.
  530. *
  531. * Revision 1.5  2004/02/04 18:05:38  grichenk
  532. * Added annotation filtering by set of types/subtypes.
  533. * Renamed *Choice to *Type in SAnnotSelector.
  534. *
  535. * Revision 1.4  2004/01/23 16:14:47  grichenk
  536. * Implemented alignment mapping
  537. *
  538. * Revision 1.3  2003/11/13 19:12:52  grichenk
  539. * Added possibility to exclude TSEs from annotations request.
  540. *
  541. * Revision 1.2  2003/10/09 20:20:58  vasilche
  542. * Added possibility to include and exclude Seq-annot names to annot iterator.
  543. * Fixed adaptive search. It looked only on selected set of annot names before.
  544. *
  545. * Revision 1.1  2003/10/07 13:43:23  vasilche
  546. * Added proper handling of named Seq-annots.
  547. * Added feature search from named Seq-annots.
  548. * Added configurable adaptive annotation search (default: gene, cds, mrna).
  549. * Fixed selection of blobs for loading from GenBank.
  550. * Added debug checks to CSeq_id_Mapper for easier finding lost CSeq_id_Handles.
  551. * Fixed leaked split chunks annotation stubs.
  552. * Moved some classes definitions in separate *.cpp files.
  553. *
  554. * Revision 1.27  2003/09/30 16:22:02  vasilche
  555. * Updated internal object manager classes to be able to load ID2 data.
  556. * SNP blobs are loaded as ID2 split blobs - readers convert them automatically.
  557. * Scope caches results of requests for data to data loaders.
  558. * Optimized CSeq_id_Handle for gis.
  559. * Optimized bioseq lookup in scope.
  560. * Reduced object allocations in annotation iterators.
  561. * CScope is allowed to be destroyed before other objects using this scope are
  562. * deleted (feature iterators, bioseq handles etc).
  563. * Optimized lookup for matching Seq-ids in CSeq_id_Mapper.
  564. * Added 'adaptive' option to objmgr_demo application.
  565. *
  566. * Revision 1.26  2003/08/27 21:24:51  vasilche
  567. * Reordered member initializers.
  568. *
  569. * Revision 1.25  2003/08/27 14:29:52  vasilche
  570. * Reduce object allocations in feature iterator.
  571. *
  572. * Revision 1.24  2003/08/26 21:28:47  grichenk
  573. * Added seq-align verification
  574. *
  575. * Revision 1.23  2003/07/18 16:58:23  grichenk
  576. * Fixed alignment coordinates
  577. *
  578. * Revision 1.22  2003/07/17 20:07:55  vasilche
  579. * Reduced memory usage by feature indexes.
  580. * SNP data is loaded separately through PUBSEQ_OS.
  581. * String compression for SNP data.
  582. *
  583. * Revision 1.21  2003/06/02 16:06:37  dicuccio
  584. * Rearranged src/objects/ subtree.  This includes the following shifts:
  585. *     - src/objects/asn2asn --> arc/app/asn2asn
  586. *     - src/objects/testmedline --> src/objects/ncbimime/test
  587. *     - src/objects/objmgr --> src/objmgr
  588. *     - src/objects/util --> src/objmgr/util
  589. *     - src/objects/alnmgr --> src/objtools/alnmgr
  590. *     - src/objects/flat --> src/objtools/flat
  591. *     - src/objects/validator --> src/objtools/validator
  592. *     - src/objects/cddalignview --> src/objtools/cddalignview
  593. * In addition, libseq now includes six of the objects/seq... libs, and libmmdb
  594. * replaces the three libmmdb? libs.
  595. *
  596. * Revision 1.20  2003/04/24 16:12:38  vasilche
  597. * Object manager internal structures are splitted more straightforward.
  598. * Removed excessive header dependencies.
  599. *
  600. * Revision 1.19  2003/03/11 15:51:06  kuznets
  601. * iterate -> ITERATE
  602. *
  603. * Revision 1.18  2003/02/24 18:57:22  vasilche
  604. * Make feature gathering in one linear pass using CSeqMap iterator.
  605. * Do not use feture index by sub locations.
  606. * Sort features at the end of gathering in one vector.
  607. * Extracted some internal structures and classes in separate header.
  608. * Delay creation of mapped features.
  609. *
  610. * Revision 1.17  2003/02/13 14:34:34  grichenk
  611. * Renamed CAnnotObject -> CAnnotObject_Info
  612. * + CSeq_annot_Info and CAnnotObject_Ref
  613. * Moved some members of CAnnotObject to CSeq_annot_Info
  614. * and CAnnotObject_Ref.
  615. * Added feat/align/graph to CAnnotObject_Info map
  616. * to CDataSource.
  617. *
  618. * Revision 1.16  2003/02/04 18:53:36  dicuccio
  619. * Include file clean-up
  620. *
  621. * Revision 1.15  2003/01/22 20:11:54  vasilche
  622. * Merged functionality of CSeqMapResolved_CI to CSeqMap_CI.
  623. * CSeqMap_CI now supports resolution and iteration over sequence range.
  624. * Added several caches to CScope.
  625. * Optimized CSeqVector().
  626. * Added serveral variants of CBioseqHandle::GetSeqVector().
  627. * Tried to optimize annotations iterator (not much success).
  628. * Rewritten CHandleRange and CHandleRangeMap classes to avoid sorting of list.
  629. *
  630. * Revision 1.14  2002/09/13 15:20:30  dicuccio
  631. * Fix memory leak (static deleted before termination).
  632. *
  633. * Revision 1.13  2002/09/11 16:08:26  dicuccio
  634. * Fixed memory leak in x_PrepareAlign().
  635. *
  636. * Revision 1.12  2002/09/03 17:45:45  ucko
  637. * Avoid overrunning alignment data when the claimed dimensions are too high.
  638. *
  639. * Revision 1.11  2002/07/25 15:01:51  grichenk
  640. * Replaced non-const GetXXX() with SetXXX()
  641. *
  642. * Revision 1.10  2002/07/08 20:51:00  grichenk
  643. * Moved log to the end of file
  644. * Replaced static mutex (in CScope, CDataSource) with the mutex
  645. * pool. Redesigned CDataSource data locking.
  646. *
  647. * Revision 1.9  2002/07/01 15:31:57  grichenk
  648. * Fixed 'enumeration value e_not_set...' warning
  649. *
  650. * Revision 1.8  2002/05/29 21:21:13  gouriano
  651. * added debug dump
  652. *
  653. * Revision 1.7  2002/05/24 14:57:12  grichenk
  654. * SerialAssign<>() -> CSerialObject::Assign()
  655. *
  656. * Revision 1.6  2002/05/03 21:28:08  ucko
  657. * Introduce T(Signed)SeqPos.
  658. *
  659. * Revision 1.5  2002/04/05 21:26:19  grichenk
  660. * Enabled iteration over annotations defined on segments of a
  661. * delta-sequence.
  662. *
  663. * Revision 1.4  2002/02/21 19:27:04  grichenk
  664. * Rearranged includes. Added scope history. Added searching for the
  665. * best seq-id match in data sources and scopes. Updated tests.
  666. *
  667. * Revision 1.3  2002/01/23 21:59:31  grichenk
  668. * Redesigned seq-id handles and mapper
  669. *
  670. * Revision 1.2  2002/01/16 16:25:56  gouriano
  671. * restructured objmgr
  672. *
  673. * Revision 1.1  2002/01/11 19:06:16  gouriano
  674. * restructured objmgr
  675. *
  676. *
  677. * ===========================================================================
  678. */