NCBI C++ ToolKit
align_project_item_extension.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: align_project_item_extension.cpp 30731 2014-07-17 17:24:59Z katargir $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
38 
40 
41 #include <gui/core/document.hpp>
42 
45 
46 ///////////////////////////////////////////////////////////////////////////////
47 /// CAlignProjectItemExtension
48 
50 {
51  static string sid("align_project_item_extension");
52  return sid;
53 }
54 
56 {
57  static string slabel("Alignment package Project item extension");
58  return slabel;
59 }
60 
61 static const string kBLASTProjectItemTag = "blast_project_item";
62 
63 /// calculate scores, this is done in a separate function that is called before
64 /// inserting the Project Item into a Project because we need a Scope.
65 
67 {
68  if (item.HasTag(kBLASTProjectItemTag)) {
69  if (item.GetItem().IsAnnot()) {
70  typedef CSeq_annot::TData::TAlign TAlign;
71 
72  /// add scores where needed
73  CSeq_annot& annot = item.SetItem().SetAnnot();
74  TAlign& an_align = annot.SetData().SetAlign();
75 
76  CScoreBuilder builder;
77  builder.AddScore(*doc.GetScope(), an_align, CSeq_align::eScore_PercentIdentity);
78  }
80  }
81 }
82 
84 {
85 }
86 
User-defined methods of the data storage class.
USING_SCOPE(objects)
static const string kBLASTProjectItemTag
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual string GetExtensionIdentifier() const
CAlignProjectItemExtension.
virtual void ProjectItemDetached(objects::CProjectItem &item, CGBDocument &doc, IServiceLocator *service_locator)
virtual void ProjectItemAttached(objects::CProjectItem &item, CGBDocument &doc, IServiceLocator *service_locator)
calculate scores, this is done in a separate function that is called before inserting the Project Ite...
CGBDocument.
Definition: document.hpp:113
void RemoveTag(const string &tag)
Definition: ProjectItem.hpp:97
bool HasTag(const string &tag) const
Definition: ProjectItem.hpp:95
void AddScore(CScope &scope, CSeq_align &align, EScoreType score)
deprecated: use CSeq_align::EScoreType directly
@ eScore_PercentIdentity
Definition: Seq_align.hpp:189
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
bool IsAnnot(void) const
Check if variant Annot is selected.
const TItem & GetItem(void) const
Get the Item member data.
void SetItem(TItem &value)
Assign a value to Item data member.
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
list< CRef< CSeq_align > > TAlign
Definition: Seq_annot_.hpp:194
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887