seq_annot_info.cpp

来自「ncbi源码」· C++ 代码 · 共 535 行 · 第 1/2 页

CPP
535
字号
void CSeq_annot_Info::x_UpdateAnnotIndexContents(CTSE_Info& tse){    m_ObjectInfos.SetName(GetName());    const CSeq_annot::C_Data& data = m_Object->GetData();    switch ( data.Which() ) {    case CSeq_annot::C_Data::e_Ftable:        x_MapAnnotObjects(tse, data.GetFtable());        break;    case CSeq_annot::C_Data::e_Align:        x_MapAnnotObjects(tse, data.GetAlign());        break;    case CSeq_annot::C_Data::e_Graph:        x_MapAnnotObjects(tse, data.GetGraph());        break;    default:        break;    }    if ( m_SNP_Info ) {        m_SNP_Info->x_UpdateAnnotIndex(tse);    }    TParent::x_UpdateAnnotIndexContents(tse);}voidCSeq_annot_Info::x_MapAnnotObjects(CTSE_Info& tse,                                   const CSeq_annot::C_Data::TFtable& objs){    m_ObjectInfos.Reserve(objs.size(), 1.1);    CTSE_Info::TAnnotObjs& index = tse.x_SetAnnotObjs(GetName());    SAnnotObject_Key key;    SAnnotObject_Index annotRef;    vector<CHandleRangeMap> hrmaps;    ITERATE ( CSeq_annot::C_Data::TFtable, fit, objs ) {        const CSeq_feat& feat = **fit;        CAnnotObject_Info* info =            m_ObjectInfos.AddInfo(CAnnotObject_Info(feat, *this));        key.m_AnnotObject_Info = annotRef.m_AnnotObject_Info = info;        info->GetMaps(hrmaps);        annotRef.m_AnnotLocationIndex = 0;        ITERATE ( vector<CHandleRangeMap>, hrmit, hrmaps ) {            ITERATE ( CHandleRangeMap, hrit, *hrmit ) {                key.m_Handle = hrit->first;                const CHandleRange& hr = hrit->second;                key.m_Range = hr.GetOverlappingRange();                if ( hr.HasGaps() ) {                    annotRef.m_HandleRange.Reset(new CObjectFor<CHandleRange>);                    annotRef.m_HandleRange->GetData() = hr;                }                else {                    annotRef.m_HandleRange.Reset();                }                                tse.x_MapAnnotObject(index, key, annotRef, m_ObjectInfos);            }            ++annotRef.m_AnnotLocationIndex;        }    }}void CSeq_annot_Info::x_MapAnnotObjects(CTSE_Info& tse,                                        const CSeq_annot::C_Data::TGraph& objs){    m_ObjectInfos.Reserve(objs.size());    CTSE_Info::TAnnotObjs& index = tse.x_SetAnnotObjs(GetName());    SAnnotObject_Key key;    SAnnotObject_Index annotRef;    vector<CHandleRangeMap> hrmaps;    ITERATE ( CSeq_annot::C_Data::TGraph, git, objs ) {        const CSeq_graph& graph = **git;        CAnnotObject_Info* info =            m_ObjectInfos.AddInfo(CAnnotObject_Info(graph, *this));        key.m_AnnotObject_Info = annotRef.m_AnnotObject_Info = info;        info->GetMaps(hrmaps);        annotRef.m_AnnotLocationIndex = 0;        ITERATE ( vector<CHandleRangeMap>, hrmit, hrmaps ) {            ITERATE ( CHandleRangeMap, hrit, *hrmit ) {                key.m_Handle = hrit->first;                const CHandleRange& hr = hrit->second;                key.m_Range = hr.GetOverlappingRange();                if ( hr.HasGaps() ) {                    annotRef.m_HandleRange.Reset(new CObjectFor<CHandleRange>);                    annotRef.m_HandleRange->GetData() = hr;                }                else {                    annotRef.m_HandleRange.Reset();                }                tse.x_MapAnnotObject(index, key, annotRef, m_ObjectInfos);            }            ++annotRef.m_AnnotLocationIndex;        }    }}void CSeq_annot_Info::x_MapAnnotObjects(CTSE_Info& tse,                                        const CSeq_annot::C_Data::TAlign& objs){    m_ObjectInfos.Reserve(objs.size());    CTSE_Info::TAnnotObjs& index = tse.x_SetAnnotObjs(GetName());    SAnnotObject_Key key;    SAnnotObject_Index annotRef;    vector<CHandleRangeMap> hrmaps;    ITERATE ( CSeq_annot::C_Data::TAlign, ait, objs ) {        const CSeq_align& align = **ait;        CAnnotObject_Info* info =            m_ObjectInfos.AddInfo(CAnnotObject_Info(align, *this));        key.m_AnnotObject_Info = annotRef.m_AnnotObject_Info = info;        info->GetMaps(hrmaps);        annotRef.m_AnnotLocationIndex = 0;        ITERATE ( vector<CHandleRangeMap>, hrmit, hrmaps ) {            ITERATE ( CHandleRangeMap, hrit, *hrmit ) {                key.m_Handle = hrit->first;                const CHandleRange& hr = hrit->second;                key.m_Range = hr.GetOverlappingRange();                if ( hr.HasGaps() ) {                    annotRef.m_HandleRange.Reset(new CObjectFor<CHandleRange>);                    annotRef.m_HandleRange->GetData() = hr;                }                else {                    annotRef.m_HandleRange.Reset();                }                tse.x_MapAnnotObject(index, key, annotRef, m_ObjectInfos);            }            ++annotRef.m_AnnotLocationIndex;        }    }}void CSeq_annot_Info::x_UnmapAnnotObjects(CTSE_Info& tse){    if ( m_SNP_Info ) {        m_SNP_Info->x_UnmapAnnotObjects(tse);    }    tse.x_UnmapAnnotObjects(m_ObjectInfos);}void CSeq_annot_Info::x_DropAnnotObjects(CTSE_Info& tse){    if ( m_SNP_Info ) {        m_SNP_Info->x_DropAnnotObjects(tse);    }    m_ObjectInfos.Clear();}END_SCOPE(objects)END_NCBI_SCOPE/* * =========================================================================== * $Log: seq_annot_info.cpp,v $ * Revision 1000.4  2004/06/01 19:23:51  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.16 * * Revision 1.16  2004/05/21 21:42:13  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.15  2004/03/26 19:42:04  vasilche * Fixed premature deletion of SNP annot info object. * Removed obsolete references to chunk info. * * Revision 1.14  2004/03/24 18:30:30  vasilche * Fixed edit API. * Every *_Info object has its own shallow copy of original object. * * Revision 1.13  2004/03/16 15:47:28  vasilche * Added CBioseq_set_Handle and set of EditHandles * * Revision 1.12  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.11  2003/11/26 17:56:00  vasilche * Implemented ID2 split in ID1 cache. * Fixed loading of splitted annotations. * * Revision 1.10  2003/11/19 22:18:03  grichenk * All exceptions are now CException-derived. Catch "exception" rather * than "runtime_error". * * Revision 1.9  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.8  2003/09/30 16:22:03  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. * CScope is allowed to be destroyed before other objects using this scope are * deleted (feature iterators, bioseq handles etc). * Optimized lookup for matching Seq-ids in CSeq_id_Mapper. * Added 'adaptive' option to objmgr_demo application. * * Revision 1.7  2003/08/27 14:29:52  vasilche * Reduce object allocations in feature iterator. * * Revision 1.6  2003/07/18 19:41:46  vasilche * Removed unused variable. * * Revision 1.5  2003/07/17 22:51:31  vasilche * Fixed unused variables warnings. * * Revision 1.4  2003/07/17 20:07:56  vasilche * Reduced memory usage by feature indexes. * SNP data is loaded separately through PUBSEQ_OS. * String compression for SNP data. * * Revision 1.3  2003/07/09 17:54:29  dicuccio * Fixed uninitialized variables in CDataSource and CSeq_annot_Info * * Revision 1.2  2003/06/02 16:06:38  dicuccio * Rearranged src/objects/ subtree.  This includes the following shifts: *     - src/objects/asn2asn --> arc/app/asn2asn *     - src/objects/testmedline --> src/objects/ncbimime/test *     - src/objects/objmgr --> src/objmgr *     - src/objects/util --> src/objmgr/util *     - src/objects/alnmgr --> src/objtools/alnmgr *     - src/objects/flat --> src/objtools/flat *     - src/objects/validator --> src/objtools/validator *     - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.1  2003/04/24 16:12:38  vasilche * Object manager internal structures are splitted more straightforward. * Removed excessive header dependencies. * * * =========================================================================== */

⌨️ 快捷键说明

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