utils.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:33k
- /*
- * ===========================================================================
- * PRODUCTION $Log: utils.cpp,v $
- * PRODUCTION Revision 1000.0 2004/06/01 21:21:32 gouriano
- * PRODUCTION PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.7
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: utils.cpp,v 1000.0 2004/06/01 21:21:32 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: Mike DiCuccio
- *
- * File Description:
- * General utility classes for GUI projects.
- */
- #include <ncbi_pch.hpp>
- #include <gui/objutils/utils.hpp>
- #include <gui/objutils/label.hpp>
- #include <gui/objutils/prot_product.hpp>
- #include <gui/objutils/alignment.hpp>
- #include <gui/objutils/graph.hpp>
- #include <gui/objutils/alignment_smear_layout.hpp>
- #include <gui/objutils/mate_pair.hpp>
- #include <gui/objutils/prot_product.hpp>
- #include <gui/objutils/graph.hpp>
- #include <algorithm>
- #include <objects/seqloc/Seq_loc.hpp>
- #include <objects/seqloc/Seq_interval.hpp>
- #include <objects/seq/Bioseq.hpp>
- #include <objects/seq/Seq_inst.hpp>
- #include <objects/seqset/Seq_entry.hpp>
- #include <objects/seqalign/Score.hpp>
- #include <objects/seqloc/Seq_loc.hpp>
- #include <objects/seqloc/Seq_loc_mix.hpp>
- #include <objects/seqloc/Seq_point.hpp>
- #include <objects/seqloc/Seq_interval.hpp>
- #include <objects/seqloc/Packed_seqint.hpp>
- #include <objects/seqloc/Packed_seqpnt.hpp>
- #include <objects/seqloc/Seq_bond.hpp>
- #include <objects/general/Int_fuzz.hpp>
- #include <objects/general/Dbtag.hpp>
- #include <objects/general/Object_id.hpp>
- #include <objmgr/align_ci.hpp>
- #include <objmgr/annot_ci.hpp>
- #include <objmgr/graph_ci.hpp>
- #include <objmgr/feat_ci.hpp>
- #include <objmgr/scope.hpp>
- #include <objmgr/util/feature.hpp>
- #include <objmgr/util/sequence.hpp>
- #include <objtools/alnmgr/alnmix.hpp>
- #include <serial/iterator.hpp>
- BEGIN_NCBI_SCOPE
- USING_SCOPE(objects);
- //
- // functor for sorting features based on their length
- //
- struct SFeatLengthPredicate
- {
- bool operator()(const CMappedFeat& feat0,
- const CMappedFeat& feat1) const
- {
- TSeqRange r0 = feat0.GetLocation().GetTotalRange();
- TSeqRange r1 = feat1.GetLocation().GetTotalRange();
- return (r0.GetLength() < r1.GetLength());
- }
- };
- //
- // functor for sorting features based on the NCBI feature sort order
- //
- struct SFeatSortPredicate
- {
- bool operator()(const CMappedFeat& feat0,
- const CMappedFeat& feat1) const
- {
- const CSeq_feat& f0 = feat0.GetOriginalFeature();
- const CSeq_feat& f1 = feat1.GetOriginalFeature();
- return (f0.Compare(f1, feat0.GetLocation(), feat1.GetLocation()) < 0);
- }
- };
- //
- // retrieve an annot selector
- //
- SAnnotSelector CSeqUtils::GetAnnotSelector(void)
- {
- SAnnotSelector sel;
- sel
- // consider overlaps by total range...
- .SetOverlapTotalRange()
- // resolve all segments...
- .SetResolveAll()
- // make sure we see all named annots (except SNPs)
- .ExcludeNamedAnnots("SNP")
- // stop at the first set of whatever
- .SetAdaptiveDepth(true)
- // stop at the first set of whatever
- .SetSegmentSelectFirst();
- return sel;
- }
- //
- // retrieve an annot selector for our selected annotations
- //
- SAnnotSelector CSeqUtils::GetAnnotSelector(SAnnotSelector::TAnnotType c)
- {
- SAnnotSelector sel = GetAnnotSelector();
- sel
- // limit by our annotation type
- .SetAnnotType(c);
- return sel;
- }
- //
- // retrieve an annot selector for our selected annotations
- //
- SAnnotSelector CSeqUtils::GetAnnotSelector(SAnnotSelector::TFeatType feat)
- {
- SAnnotSelector sel = GetAnnotSelector(CSeq_annot::TData::e_Ftable);
- sel
- // retrieve feature type and subtype of interest
- .SetFeatType(feat);
- return sel;
- }
- SAnnotSelector CSeqUtils::GetAnnotSelector(SAnnotSelector::TFeatSubtype sub)
- {
- SAnnotSelector sel = GetAnnotSelector(CSeq_annot::TData::e_Ftable);
- sel
- // retrieve feature type and subtype of interest
- .SetFeatSubtype(sub);
- return sel;
- }
- //
- // GetLandmarkFeatures()
- // This returns a list of landmark features for a given sequence. The current
- // implementation is a bit hackish; this function is mostly a hook and will be
- // replaced in ID2 by a retrieval for a specific named annotation that
- // contains precalculated landmark features
- //
- void CSeqUtils::GetLandmarkFeatures(const CBioseq_Handle& handle,
- const TSeqRange& range,
- size_t max_feats,
- CLayoutFeat::TFeatList& feats)
- {
- // begin with all gene features
- SAnnotSelector sel = GetAnnotSelector(CSeqFeatData::e_Gene);
- //SetResolveDepth(handle, range, sel);
- // retrieve all of our genes
- CFeat_CI iter(handle, range.GetFrom(), range.GetTo(), sel);
- if (iter.GetSize() < max_feats) {
- // retrieve them all
- for ( ; iter; ++iter) {
- CRef<CLayoutFeat> ref(new CLayoutFeat(*iter));
- feats.push_back(ref);
- }
- } else {
- // we do some screening - separate hypothetical and actual
- vector<CMappedFeat> hyp_feats;
- vector<CMappedFeat> act_feats;
- // preallocate a rough approximation of the right amount of space
- hyp_feats.reserve(iter.GetSize() / 2);
- act_feats.reserve(iter.GetSize() / 2);
- string str;
- // sift through our features, separating hypothetical from
- // real
- for ( ; iter; ++iter) {
- str.erase();
- feature::GetLabel(iter->GetOriginalFeature(),
- &str, feature::eContent);
- // hypothetical is defined as having a gene name like
- // 'LOC123456'
- if (str.find("LOC") == 0 &&
- str.find_first_not_of("0123456789", 3) == string::npos) {
- hyp_feats.push_back(*iter);
- } else {
- act_feats.push_back(*iter);
- }
- }
- if (act_feats.size() < max_feats) {
- // we need to add some hypothetical genes to the pool
- std::sort(hyp_feats.begin(), hyp_feats.end(),
- SFeatLengthPredicate());
- act_feats.insert(act_feats.end(),
- hyp_feats.end() - (max_feats - act_feats.size()),
- hyp_feats.end());
- std::sort(act_feats.begin(), act_feats.end(),
- SFeatSortPredicate());
- } else if (act_feats.size() > max_feats) {
- // we have too many genes, so eliminate the short ones
- std::sort(act_feats.begin(), act_feats.end(),
- SFeatLengthPredicate());
- act_feats.erase(act_feats.begin(),
- act_feats.begin() + (act_feats.size() - max_feats));
- std::sort(act_feats.begin(), act_feats.end(),
- SFeatSortPredicate());
- }
- //
- // now we've got enough genes
- //
- ITERATE (vector<CMappedFeat>, iter, act_feats) {
- CRef<CLayoutFeat> ref(new CLayoutFeat(*iter));
- feats.push_back(ref);
- }
- }
- }
- //
- // GetFeatures()
- // this retrieves and cross-links a set of features from the document
- // representing the basic molecular biology pathway. This will detail the
- // relationship between genes <-> rnas <-> coding regions <-> proteins, where
- // known.
- //
- void CSeqUtils::GetFeatures(const CBioseq_Handle& handle,
- const TSeqRange& range,
- CSeqFeatData::E_Choice feat_type,
- CLayoutFeat::TFeatList& feats,
- TFeatureFlags flags)
- {
- SAnnotSelector selector = GetAnnotSelector(feat_type);
- GetFeatures(handle, range, selector, feats, flags);
- }
- void CSeqUtils::GetFeatures(const CBioseq_Handle& handle,
- const TSeqRange& range,
- SAnnotSelector sel,
- CLayoutFeat::TFeatList& feats,
- TFeatureFlags flags)
- {
- feats.clear();
- if ( !handle ) {
- return;
- }
- CFeat_CI feature_iter(handle, range.GetFrom(), range.GetTo(), sel);
- feats.clear();
- feats.reserve(feature_iter.GetSize());
- for (; feature_iter ; ++feature_iter) {
- const CMappedFeat& feat = *feature_iter;
- CRef<CLayoutFeat> fref(new CLayoutFeat(feat));
- feats.push_back(fref);
- }
- if (flags & fFeature_LinkFeatures) {
- LinkFeatures(feats);
- }
- }
- //
- // LinkFeatures()
- // This builds explicit links between features, creating a hierarchical tree of
- // features.
- //
- void CSeqUtils::LinkFeatures(CLayoutFeat::TFeatList& feats)
- {
- CLayoutFeat::TFeatList out_feats;
- out_feats.reserve(feats.size());
- NON_CONST_ITERATE (CLayoutFeat::TFeatList, iter, feats) {
- CLayoutFeat& feat = **iter;
- string label;
- feature::GetLabel(feat.GetFeature(), &label, feature::eBoth);
- CSeqFeatData::ESubtype parent_type = CSeqFeatData::eSubtype_bad;
- switch (feat.GetFeature().GetData().GetSubtype()) {
- case CSeqFeatData::eSubtype_cdregion:
- if (dynamic_cast<const CLayoutProtProd*> (&feat)) {
- // search for preceding CDS for this protein product
- parent_type = CSeqFeatData::eSubtype_cdregion;
- } else {
- // search for preceding mRNA
- parent_type = CSeqFeatData::eSubtype_mRNA;
- }
- break;
- case CSeqFeatData::eSubtype_gene:
- // don't link
- out_feats.push_back(*iter);
- continue;
- case CSeqFeatData::eSubtype_mRNA:
- parent_type = CSeqFeatData::eSubtype_gene;
- break;
- default:
- // don't link
- out_feats.push_back(*iter);
- continue;
- }
- //
- // find the suitable pool of features we can look at
- //
- bool linked = false;
- CLayoutFeat::TFeatList::reverse_iterator start(iter);
- CLayoutFeat::TFeatList::reverse_iterator end (feats.begin());
- for ( ; start != end; ++start) {
- CLayoutFeat& curr = **start;
- // only link features if they live in the same annotation
- if (curr.GetMappedFeature().GetAnnot().IsNamed() &&
- feat.GetMappedFeature().GetAnnot().IsNamed() &&
- curr.GetMappedFeature().GetAnnot().GetName() !=
- feat.GetMappedFeature().GetAnnot().GetName()) {
- continue;
- }
- // make sure we're looking at the right parent type
- CSeqFeatData::ESubtype type =
- curr.GetFeature().GetData().GetSubtype();
- if (type != parent_type) {
- continue;
- }
- // an mRNA can have only one child bound to it
- if (type == CSeqFeatData::eSubtype_mRNA &&
- curr.GetChildren().size() >= 1) {
- continue;
- }
- // only link features if their locations are swallowable
- sequence::ECompare comp =
- sequence::Compare(curr.GetLocation(), feat.GetLocation());
- if (comp != sequence::eContains && comp != sequence::eSame) {
- continue;
- }
- feat.SetParent(&curr);
- curr.SetChildren().push_back(*iter);
- linked = true;
- break;
- }
- if ( !linked ) {
- out_feats.push_back(*iter);
- }
- }
- out_feats.swap(feats);
- }
- //
- // GetAlignments()
- // this retrieves the of alignments in a document by annotation
- // as a set of smears.
- //
- void CSeqUtils::GetAlignmentSmears(const CBioseq_Handle& handle,
- const TSeqRange& range,
- TSeqPos window,
- CLayoutEngine::TObjects& aligns)
- {
- aligns.clear();
- if ( !handle ) {
- return;
- }
- SAnnotSelector sel_annot;
- CAnnot_CI annot_iter(handle, range.GetFrom(), range.GetTo(), sel_annot);
-
- for (int an_i = 0; annot_iter; ++annot_iter, ++an_i) {
-
- // TODO: remember the annotation's name. That is the smear's label.
- if (annot_iter->IsNamed()) {
- // cout << an_i << " Named: " << annot_iter->GetName() << endl;
- } else {
- // cout << an_i << " Unnamed: " << endl;
- }
-
- const CSeq_annot& seq_annot = annot_iter->GetSeq_annot();
- if ( ! seq_annot.GetData().IsAlign()) {
- continue;
- }
-
-
- CRef<CLayoutObject> ref;
- if (CAlignmentSmear::SeparateStrands(seq_annot)) {
- ref.Reset(new CLayoutAlignSmear(handle,
- range.GetFrom(), range.GetTo(),
- window,
- CAlignmentSmear::eSmearStrand_Pos,
- seq_annot));
- if (ref) {
- aligns.push_back(ref);
- }
- ref.Reset(new CLayoutAlignSmear(handle,
- range.GetFrom(), range.GetTo(),
- window,
- CAlignmentSmear::eSmearStrand_Neg,
- seq_annot));
- if (ref) {
- aligns.push_back(ref);
- }
- } else {
- ref.Reset(new CLayoutAlignSmear(handle,
- range.GetFrom(), range.GetTo(),
- window,
- CAlignmentSmear::eSmearStrand_Both,
- seq_annot));
- if (ref) {
- aligns.push_back(ref);
- }
- }
- }
- }
- static bool
- s_CheckTraceMateAlign(const CSeq_align& align,
- int& ti,
- int& mate_ti,
- int expect_mate_ti = 0)
- {
- //
- // specific requirements for mate pair alignments:
- //
- // must be a pairwise dense-seg
- if ( !align.GetSegs().IsDenseg() ||
- align.GetSegs().GetDenseg().GetIds().size() != 2) {
- return false;
- }
- // check the IDs for a trace ID
- ti = 0;
- ITERATE (CDense_seg::TIds, iter,
- align.GetSegs().GetDenseg().GetIds()) {
- const CSeq_id& id = **iter;
- if (id.IsGeneral() &&
- (id.GetGeneral().GetDb() == "ti" ||
- id.GetGeneral().GetDb() == "TRACE")) {
- ti = id.GetGeneral().GetTag().GetId();
- break;
- }
- }
- if (ti == 0) {
- return false;
- }
- // must have a score field named 'matepair_ti'
- mate_ti = 0;
- if ( !align.GetNamedScore("matepair ti", mate_ti)) {
- if ( !align.GetNamedScore("bad matepair ti", mate_ti)) {
- return false;
- }
- }
- if (expect_mate_ti && mate_ti != expect_mate_ti) {
- return false;
- }
- return true;
- }
- //
- // GetAlignments()
- // this retrieves a set of alignments from the document
- //
- void CSeqUtils::GetAlignments(const CBioseq_Handle& handle,
- const TSeqRange& range,
- CLayoutEngine::TObjects& aligns,
- TAlignFlags flags)
- {
- aligns.clear();
- if ( !handle ) {
- return;
- }
- SAnnotSelector selector = GetAnnotSelector(CSeq_annot::TData::e_Align);
- CAlign_CI align_iter(handle, range.GetFrom(), range.GetTo(), selector);
- typedef pair<CRef<CLayoutPWAlign> , int> TMatedAlign;
- typedef map<int, TMatedAlign> TMatedAlignments;
- TMatedAlignments mated_aligns;
- for (; align_iter ; ++align_iter) {
- const CSeq_align& align = *align_iter;
- try {
- // generate an alignment manager for this alignment
- CRef<CAlnVec> aln_mgr;
- if (align.GetSegs().IsDenseg()) {
- aln_mgr.Reset(new CAlnVec(align.GetSegs().GetDenseg(),
- handle.GetScope()));
- } else {
- CAlnMix mix(handle.GetScope());
- mix.Add(align);
- mix.Merge(CAlnMix::fGen2EST |
- CAlnMix::fTryOtherMethodOnFail |
- CAlnMix::fGapJoin);
- aln_mgr.Reset(new CAlnVec(mix.GetDenseg(), handle.GetScope()));
- }
- // anchor on the referent sequence
- CAlnVec::TNumrow row = 0;
- CAlnVec::TNumrow anchor = 0;
- for (row = 0; row != aln_mgr->GetNumRows(); ++row) {
- if ( handle.IsSynonym(aln_mgr->GetSeqId(row)) ) {
- aln_mgr->SetAnchor(row);
- anchor = row;
- break;
- }
- }
- //
- // check to see if this is a mate pair alignment
- //
- int ti = 0;
- int mate_ti = 0;
- if ( s_CheckTraceMateAlign(align, ti, mate_ti) ) {
- CRef<CLayoutPWAlign> pwal
- (new CLayoutPWAlign(*aln_mgr, align));
- if (flags & fAlign_LinkMatePairs) {
- // we will process mate mair alignments in a separate pass
- // after we complete all other alignments
- TMatedAlign mp(pwal, mate_ti);
- mated_aligns[ti] = mp;
- } else {
- CLayoutMatePair::TAlignList als;
- als.push_back(pwal);
- CRef<CLayoutObject> obj(new CLayoutMatePair(als));
- aligns.push_back(obj);
- }
- } else {
- // "normal" alignment
- CRef<CLayoutObject> ref;
- if (aln_mgr->GetNumRows() == 2) {
- ref.Reset(new CLayoutPWAlign(*aln_mgr, align));
- } else {
- ref.Reset(new CLayoutAlign(*aln_mgr, align));
- }
- aligns.push_back(ref);
- }
- }
- catch (CException& e) {
- // errors ignored
- _TRACE("error in GetAlignments(): " << e.GetMsg());
- }
- }
- //
- // final pass - connect our mate pair alignments, if we can
- //
- NON_CONST_ITERATE (TMatedAlignments, iter, mated_aligns) {
- if ( !iter->second.first ) {
- continue;
- }
- CLayoutPWAlign& first_mate = *iter->second.first;
- const CSeq_align& align = first_mate.GetAlignment();
- int ti = iter->first;
- int mate_ti = iter->second.second;
- //
- // verify that we have a mated alignment for this trace alignment
- //
- CRef<CLayoutPWAlign> second_mate;
- TMatedAlignments::iterator mate_iter = mated_aligns.find(mate_ti);
- if (mate_iter == mated_aligns.end()) {
- //
- // NOT FOUND
- // try iterating
- //
- CSeq_id id("gnl|ti|" + NStr::IntToString(mate_ti));
- CBioseq_Handle h =
- handle.GetScope().GetBioseqHandle(id);
- CAlign_CI second_mate_iter(h, 0, h.GetBioseqLength(),
- selector);
- for ( ; second_mate_iter; ++second_mate_iter) {
- int temp = 0;
- if ( !s_CheckTraceMateAlign(*second_mate_iter, temp,
- mate_ti, ti) ) {
- continue;
- }
- CRef<CAlnVec> aln_mgr(new CAlnVec(align.GetSegs().GetDenseg(),
- handle.GetScope()));
- // anchor on the referent sequence
- CAlnVec::TNumrow row = 0;
- CAlnVec::TNumrow anchor = 0;
- for (row = 0; row != aln_mgr->GetNumRows(); ++row) {
- if ( handle.IsSynonym(aln_mgr->GetSeqId(row)) ) {
- aln_mgr->SetAnchor(row);
- anchor = row;
- break;
- }
- }
- second_mate.Reset(new CLayoutPWAlign(*aln_mgr, align));
- break;
- }
- if ( !second_mate ) {
- LOG_POST(Error << "failed to find mate pair for ti = " << ti);
- // no mate available, so treat it as a normal alignment
- // we need to trim leading and trailing gaps to get a good
- // placement
- CRef<CLayoutObject> ref
- (new CLayoutPWAlign(first_mate.GetAlignMgr(), align));
- aligns.push_back(ref);
- continue;
- }
- } else if ( !mate_iter->second.first ) {
- // already processed
- continue;
- } else {
- second_mate = mate_iter->second.first;
- mate_iter->second.first.Reset();
- }
- CLayoutMatePair::TAlignList als;
- als.push_back(CRef<CLayoutPWAlign>(&first_mate));
- als.push_back(second_mate);
- CRef<CLayoutObject> obj(new CLayoutMatePair(als));
- aligns.push_back(obj);
- }
- {//if (mated_aligns.size()) {
- vector< CRef<CLayoutObject> > vec;
- vec.reserve(aligns.size());
- std::copy(aligns.begin(), aligns.end(), back_inserter(vec));
- // we need to sort our alignments when done
- std::sort(vec.begin(), vec.end(), SLayoutByPos());
- aligns.clear();
- std::copy(vec.begin(), vec.end(), back_inserter(aligns));
- }
- }
- void CSeqUtils::GetGraphs(const CBioseq_Handle& handle,
- const TSeqRange& range,
- CLayoutEngine::TObjects& graphs)
- {
- graphs.clear();
- if ( !handle ) {
- return;
- }
- SAnnotSelector selector = GetAnnotSelector(CSeq_annot::TData::e_Graph);
-
- CGraph_CI graph_iter(handle, range.GetFrom(), range.GetTo(), selector);
- for (; graph_iter ; ++graph_iter) {
- const CMappedGraph& graph = *graph_iter;
- CRef<CLayoutObject> fref(new CLayoutGraph(graph));
- graphs.push_back(fref);
- }
- }
- //
- // remap a child location to a parent
- //
- CRef<CSeq_loc> CSeqUtils::RemapChildToParent(const CSeq_loc& parent,
- const CSeq_loc& child,
- CScope* scope)
- {
- CSeq_loc dummy_parent;
- dummy_parent.SetWhole(const_cast<CSeq_id&>(sequence::GetId(parent)));
- SRelLoc converter(dummy_parent, child, scope);
- converter.m_ParentLoc = &parent;
- return converter.Resolve(scope);
- }
- bool CSeqUtils::Match(const CSeq_id& id1, const CSeq_id& id2, CScope* scope)
- {
- if (id1.Match(id2)) {
- return true;
- } else if (scope) {
- CBioseq_Handle handle = scope->GetBioseqHandle(id1);
- if (handle) {
- return handle.IsSynonym(id2);
- }
- }
- return false;
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: utils.cpp,v $
- * Revision 1000.0 2004/06/01 21:21:32 gouriano
- * PRODUCTION: IMPORTED [GCC34_MSVC7] Dev-tree R1.7
- *
- * Revision 1.7 2004/05/21 22:27:44 gorelenk
- * Added PCH ncbi_pch.hpp
- *
- * Revision 1.6 2004/05/20 12:31:16 dicuccio
- * Added missing includes
- *
- * Revision 1.5 2004/05/14 16:08:05 dicuccio
- * Added additional #includes for missing layout objects. Restored final sort of
- * seq-aligns
- *
- * Revision 1.4 2004/05/10 18:23:32 dicuccio
- * Reworked mate pair checking routines to use GetNamedScore()
- *
- * Revision 1.3 2004/05/09 23:57:13 dicuccio
- * Added flags controlling retrieval of alignments
- *
- * Revision 1.2 2004/05/07 15:39:22 dicuccio
- * Removed CSeqUtils::GetLabel() - should use CLabel directly
- *
- * Revision 1.1 2004/04/30 11:48:16 dicuccio
- * Initial commit - split out from src/gui/utils
- *
- * Revision 1.67 2004/04/20 19:17:55 dicuccio
- * Minor revision. Amendment to last commit: Reworked GetLabel() to use
- * pluggable label architecture
- *
- * Revision 1.66 2004/04/20 19:17:04 dicuccio
- * Reworked GetAlignments() - added pairwise alignments, revised handing of mate
- * pair alignments
- *
- * Revision 1.65 2004/04/15 13:00:01 lebedev
- * do not use GetObject() in CLayoutObject
- *
- * Revision 1.64 2004/04/12 16:52:27 dicuccio
- * Removed unnecessary debugging output
- *
- * Revision 1.63 2004/04/12 16:51:36 dicuccio
- * Merged GetMatePairs() into GetAlignments()
- *
- * Revision 1.62 2004/04/07 13:06:56 dicuccio
- * Use CSeq_annot_Handle for proper mapping of annotation names. Split
- * GetAnnotSelector() API to request feature type or subtype separately
- *
- * Revision 1.61 2004/04/06 19:28:34 ucko
- * Tweak GetMatePairs to avoid confusing GCC.
- *
- * Revision 1.60 2004/04/06 18:30:05 dicuccio
- * Added GetMatePairs()
- *
- * Revision 1.59 2004/04/02 16:13:16 yazhuk
- * Added Match() function for comparing CSeq_id-s
- *
- * Revision 1.58 2004/03/23 13:40:57 dicuccio
- * Deprecated a bunch of old conversion routines. Moved #include from .hpp to .cpp
- *
- * Revision 1.57 2004/03/22 16:45:48 rsmith
- * add GetAlignmentSmears and comment out obsolete code.
- *
- * Revision 1.56 2004/03/05 17:38:28 dicuccio
- * Avoid using CAlnMix on alignments that are already only one dense-seg.
- * Commented spurious pathway in s_GetSeqLabel()
- *
- * Revision 1.55 2004/03/01 20:10:29 dicuccio
- * Fixed incorrect assignment of parent features
- *
- * Revision 1.54 2004/02/17 17:21:04 dicuccio
- * Added handling of flags to GetFeatures()
- *
- * Revision 1.53 2004/02/13 21:25:04 dicuccio
- * Fixed brain-dead omission of seq-id string
- *
- * Revision 1.52 2004/02/04 19:09:25 dicuccio
- * Cleaned up LinkFeatures()
- *
- * Revision 1.51 2004/02/04 18:05:37 grichenk
- * Added annotation filtering by set of types/subtypes.
- * Renamed *Choice to *Type in SAnnotSelector.
- *
- * Revision 1.50 2004/01/30 17:14:13 dicuccio
- * Moved GetLabel() from CPluginUtils
- *
- * Revision 1.49 2004/01/27 18:47:41 dicuccio
- * Use TSeqRange instead of TRange. Fixed computation of covered range of an
- * alignment. Added work-around for unsorted alignments from CAlign_CI
- *
- * Revision 1.48 2004/01/20 18:19:31 dicuccio
- * Handle alignments more effectively - don't assume they're always dense-segs
- *
- * Revision 1.47 2004/01/05 19:12:52 dicuccio
- * Restrict feature linking to features living in the same annotation. Dropped
- * unnecessary CAlnMix calls.
- *
- * Revision 1.46 2003/12/30 15:04:25 dicuccio
- * Remove SNP removal (still too slow...)
- *
- * Revision 1.45 2003/12/22 19:36:48 dicuccio
- * Turned on SNP retrieval
- *
- * Revision 1.44 2003/11/10 15:48:36 lebedev
- * Typo fixed in GetGraphs (e_Graph instead of e_Align)
- *
- * Revision 1.43 2003/10/28 15:24:06 lebedev
- * GetFeatures method that takes a selector added
- *
- * Revision 1.42 2003/10/22 15:40:57 dicuccio
- * Added API to create a dummy seq-entry to wrap a seq-annot
- *
- * Revision 1.41 2003/10/20 18:04:35 dicuccio
- * Disabled SNP retrieval
- *
- * Revision 1.40 2003/10/14 14:44:12 dicuccio
- * Reimplemented RemapChildToParent() using SRelLoc internally
- *
- * Revision 1.39 2003/10/14 12:20:13 dicuccio
- * Added RemapChildToParent() for remapping locations
- *
- * Revision 1.38 2003/10/10 17:21:02 dicuccio
- * Commented out addition of SNP annot to named annots
- *
- * Revision 1.37 2003/10/10 12:02:51 dicuccio
- * Fix for recent API change in SAnnotSelector
- *
- * Revision 1.36 2003/10/09 12:57:37 dicuccio
- * Mkae sure we always iterate over all annotations, named or otherwise.
- *
- * Revision 1.35 2003/10/08 14:16:39 dicuccio
- * Really use adaptive depth searching for annot selectors...
- *
- * Revision 1.34 2003/10/07 13:44:10 dicuccio
- * CLeaned up preparation of alignments. Alignments are now prepared as sets of
- * separate seq-aligns, not a merged alignment (better data representation)
- *
- * Revision 1.33 2003/10/03 16:02:29 dicuccio
- * Temporary fix: limit feature retrieval to one level of recursion
- *
- * Revision 1.32 2003/09/24 18:29:28 dicuccio
- * Introduced additional prototype for GetAnnotSelector() - takes no params
- *
- * Revision 1.31 2003/09/19 00:28:59 ucko
- * CLayoutAlign: use an unsigned range per CAlnMap::GetSeqRange's new rettype.
- *
- * Revision 1.30 2003/09/17 16:28:45 dicuccio
- * Optimized and standardized use of annotation selectors. Introduced standard
- * formatting function for setting options in annot selectors; removed old depth
- * setting functions in favor of explicitly setting adaptive retrieval
- *
- * Revision 1.29 2003/08/22 15:48:39 dicuccio
- * Added 'USING_SCOPE(objects)'
- *
- * Revision 1.28 2003/08/21 12:04:28 dicuccio
- * Rewored GetLandmarkFeatures() to return a better set of landmark genes
- *
- * Revision 1.27 2003/08/18 14:47:55 dicuccio
- * Changed nales: CFeature -> CLayoutFeat; CAlignment -> CLayoutAlign; CGraph ->
- * CLayoutGraph; CProtProduct -> CLayoutProtProd.
- *
- * Revision 1.26 2003/08/15 19:36:06 dicuccio
- * Added SetResolveDepth() to correctly determine the depth of annotation
- * resolution
- *
- * Revision 1.25 2003/08/12 16:48:16 dicuccio
- * Disable retrieval of SNPs in all circumstances
- *
- * Revision 1.24 2003/07/29 13:41:07 lebedev
- * GetGraphs method added
- *
- * Revision 1.23 2003/07/28 11:51:50 dicuccio
- * Rewrote CTablePanel<> to be more flexible and better contained. Added standard
- * multicolumn list dialog. Deprecated use of COutputDlg.
- *
- * Revision 1.22 2003/07/21 19:35:21 dicuccio
- * Changed storage mechanism - CLayoutObject::GetObject() is now pure virtual.
- * Changed CFeature to wrap a CMappedFeat instead of a CSeq_feat / CSeq_loc pair
- *
- * Revision 1.21 2003/07/18 13:34:53 lebedev
- * Method to retrieve alignments added
- *
- * Revision 1.20 2003/07/08 19:00:05 dicuccio
- * Added better resolution of features fr large records
- *
- * Revision 1.19 2003/06/23 13:23:14 dicuccio
- * Deprecated seq_utils.[h,c]pp - moved functions into gui.utils/utils.hpp
- *
- * Revision 1.18 2003/06/13 12:38:54 dicuccio
- * Fixed bugs in determination of mouse button state
- *
- * Revision 1.17 2003/06/10 13:35:11 dicuccio
- * Added new API for retrieving landmark features. Removed lots of dead code
- *
- * Revision 1.16 2003/06/02 16:06:25 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.15 2003/05/19 18:45:24 dicuccio
- * Fixed bug in feature collection - forgot to pass in desired feature subtype
- *
- * Revision 1.14 2003/05/16 18:20:05 dicuccio
- * Change mechanism of feature iteration - retrieve features from first
- * available location
- *
- * Revision 1.13 2003/05/07 17:28:40 dicuccio
- * Removed operator<< for CFeature. Added missing link to xobjutil
- *
- * Revision 1.12 2003/05/07 13:07:29 dicuccio
- * Code clean-up. Removed dead functions.
- *
- * Revision 1.11 2003/05/07 12:34:15 dicuccio
- * Removed CFeature::GetExtent()
- *
- * Revision 1.10 2003/03/18 21:55:24 grichenk
- * Removed obsolete class CAnnot_CI
- *
- * Revision 1.9 2003/03/11 15:25:12 kuznets
- * iterate -> ITERATE
- *
- * Revision 1.8 2003/02/10 18:10:59 dicuccio
- * Fixed compilation errors relating to change in CFeat_CI API
- *
- * Revision 1.7 2003/01/15 21:15:48 dicuccio
- * Rewored feature retrieval. Added separate (explicit) call to link features
- *
- * Revision 1.6 2003/01/13 13:10:11 dicuccio
- * Namespace clean-up. Retired namespace gui -> converted all to namespace
- * ncbi. Moved all FLUID-generated code into namespace ncbi.
- *
- * Revision 1.5 2003/01/09 14:52:25 dicuccio
- * Use 'const CBioseq_Handle&' instead of 'CBioseq_Handle&'
- *
- * Revision 1.4 2002/12/30 17:57:37 dicuccio
- * Added cast to avoid compiler warning
- *
- * Revision 1.3 2002/12/06 19:12:44 dicuccio
- * Updated to match change in API to ctor of CFeat_CI
- *
- * Revision 1.2 2002/12/06 14:08:18 dicuccio
- * Moved feature sorting predicates into feature.[h,c]pp
- *
- * Revision 1.1 2002/11/29 15:30:38 dicuccio
- * Initial revision - split out from gui/core/view/graphic
- *
- * ===========================================================================
- */