NCBI C++ ToolKit
named_collection_score_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef __NAMED_ALIGNMENT_COLLECTION_SCORE_IMPL__HPP
2 #define __NAMED_ALIGNMENT_COLLECTION_SCORE_IMPL__HPP
3 
4 
5 /*
6  * ===========================================================================
7  *
8  * PUBLIC DOMAIN NOTICE
9  * National Center for Biotechnology Information
10  *
11  * This software/database is a "United States Government Work" under the
12  * terms of the United States Copyright Act. It was written as part of
13  * the author's official duties as a United States Government employee and
14  * thus cannot be copyrighted. This software/database is freely available
15  * to the public for use. The National Library of Medicine and the U.S.
16  * Government have not placed any restriction on its use or reproduction.
17  *
18  * Although all reasonable efforts have been taken to ensure the accuracy
19  * and reliability of the software and data, the NLM and the U.S.
20  * Government do not and cannot warrant the performance or results that
21  * may be obtained by using this software or data. The NLM and the U.S.
22  * Government disclaim all warranties, express or implied, including
23  * warranties of performance, merchantability or fitness for any particular
24  * purpose.
25  *
26  * Please cite the author in any work or product based on this material.
27  *
28  * ===========================================================================
29  *
30  * Author: Alex Kotliarov
31  *
32  * File Description:
33  */
34 
35 #include <corelib/ncbiobj.hpp>
36 
37 #include <objmgr/scope.hpp>
38 
41 
43 
46 
48 
50 {
52  static pair<double, bool> MakeScore(CBioseq_Handle const& query_handle, vector<CSeq_align const*>::const_iterator, vector<CSeq_align const*>::const_iterator);
53 public:
54  string GetName() const;
55  vector<CScoreValue> Get(CScope& scope, CSeq_align_set const& coll) const;
56  void Set(CScope& scope, CSeq_align_set & coll) const;
57 
58  static const char* Name;
60 
62 };
63 
65 {
67  static pair<double, bool> MakeScore(CBioseq_Handle const& query_handle, vector<CSeq_align const*>::const_iterator, vector<CSeq_align const*>::const_iterator);
68 public:
69  string GetName() const;
70  vector<CScoreValue> Get(CScope& scope, CSeq_align_set const& coll) const;
71  void Set(CScope& scope, CSeq_align_set & coll) const;
72 
73  static const char* Name;
75 
77 };
78 
79 // Adapters that provide ability to compute multiple scores in order to
80 // reuse common tasks.
82 {
83  typedef pair<double, bool> (*F)(CBioseq_Handle const&, vector<CSeq_align const*>::const_iterator, vector<CSeq_align const*>::const_iterator);
84 
85  vector<pair<string, F> > m_Calculators;
86 
88  explicit CSubjectsSequenceCoverage(vector<pair<string, F> > const& calculators)
89  : m_Calculators(calculators)
90  {
91  }
92 
93  static pair<double, bool> MakeScore(CBioseq_Handle const& query_handle, vector<CSeq_align const*>::const_iterator, vector<CSeq_align const*>::const_iterator);
94 
95 public:
96  string GetName() const;
97  vector<CScoreValue> Get(CScope& scope, CSeq_align_set const& coll) const;
98  void Set(CScope& scope, CSeq_align_set & coll) const;
99 
100  static const char* Name;
101  static CIRef<INamedAlignmentCollectionScore> Create(vector<string> score_names);
102 };
103 
104 
107 
108 #endif // __NAMED_ALIGNMENT_COLLECTION_SCORE_IMPL__HPP
CBioseq_Handle –.
CScope –.
Definition: scope.hpp:92
vector< CScoreValue > Get(CScope &scope, CSeq_align_set const &coll) const
static pair< double, bool > MakeScore(CBioseq_Handle const &query_handle, vector< CSeq_align const * >::const_iterator, vector< CSeq_align const * >::const_iterator)
static CIRef< INamedAlignmentCollectionScore > Create()
void Set(CScope &scope, CSeq_align_set &coll) const
static CIRef< INamedAlignmentCollectionScore > Create()
void Set(CScope &scope, CSeq_align_set &coll) const
static pair< double, bool > MakeScore(CBioseq_Handle const &query_handle, vector< CSeq_align const * >::const_iterator, vector< CSeq_align const * >::const_iterator)
vector< CScoreValue > Get(CScope &scope, CSeq_align_set const &coll) const
static pair< double, bool > MakeScore(CBioseq_Handle const &query_handle, vector< CSeq_align const * >::const_iterator, vector< CSeq_align const * >::const_iterator)
vector< CScoreValue > Get(CScope &scope, CSeq_align_set const &coll) const
pair< double, bool >(* F)(CBioseq_Handle const &, vector< CSeq_align const * >::const_iterator, vector< CSeq_align const * >::const_iterator)
static CIRef< INamedAlignmentCollectionScore > Create(vector< string > score_names)
void Set(CScope &scope, CSeq_align_set &coll) const
CSubjectsSequenceCoverage(vector< pair< string, F > > const &calculators)
vector< pair< string, F > > m_Calculators
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Sep 20 14:57:44 2024 by modify_doxy.py rev. 669887