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

Go to the SVN repository for this file.

1 #ifndef ALGO_ALIGN_PROSPLIGN_COMPART__HPP
2 #define ALGO_ALIGN_PROSPLIGN_COMPART__HPP
3 
4 /* $Id: compartments.hpp 92222 2020-12-23 19:04:59Z grichenk $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Boris Kiryutin, Vyacheslav Chetvernin
30  * File Description: Get protein compartments from BLAST hits
31  *
32  */
33 
34 #include <corelib/ncbistl.hpp>
35 #include <corelib/ncbiargs.hpp>
39 
42 
43 BEGIN_SCOPE(prosplign)
44 
46 public:
47  static void SetupArgDescriptions(CArgDescriptions* argdescr);
48 
49  ///with deafalt params
51  ///from application args
52  CCompartOptions(const CArgs& args);
53 
61  enum EMaximizing {
62  eCoverage = 0,
64  eScore
65  };
67  enum ESubjectMol {
70  eAminoAcid
71  };
73 
74  static const double default_CompartmentPenalty;
75  static const double default_MinCompartmentIdty;
76  static const double default_MinSingleCompartmentIdty;
77  static const int default_MaxExtent = 500;
78  static const bool default_ByCoverage = true;
79  static const int default_MaxIntron;
80  static const int default_MaxOverlap;
81  static const EMaximizing default_Maximizing = default_ByCoverage?eCoverage:eIdentity;
82  static const ESubjectMol default_SubjectMol = eGuess;
83  static const char* s_scoreNames[];
84 };
85 
86 struct SCompartment {
87  SCompartment(int from_, int to_, bool strand_, int covered_aa_, double score_, int raw_score_) :
88  from(from_), to(to_), strand(strand_), covered_aa(covered_aa_), score(score_), raw_score(raw_score_) {}
89 
90  int from;
91  int to;
92  bool strand;
94  double score; // bit score
95  int raw_score; //regular blast score
96 
97  bool operator< (const SCompartment& comp) const
98  {
99  if (strand == comp.strand) {
100  return from < comp.from;
101  } else {
102  return strand < comp.strand;
103  }
104  }
105 };
106 
110 
111 typedef list<CRef<CSeq_annot> > TCompartments;
112 typedef vector<SCompartment> TCompartmentStructs;
113 
114 /// Selects compartments. Hits should be for a single query-subject pair.
115 /// Pass precalculated non-bridgeable gaps to prohibit compartment to go over it
116 
118 unique_ptr<CCompartmentAccessor<THit> > CreateCompartmentAccessor(const THitRefs& orig_hitrefs,
119  CCompartOptions compart_options,
120  const vector<pair<THit::TCoord, THit::TCoord> > *gaps = NULL);
121 
124  const vector<pair<THit::TCoord, THit::TCoord> > *gaps = NULL);
125 
126 
128 TCompartmentStructs MakeCompartments(const TCompartments& asn_representation,
129  CCompartOptions compart_options);
130 
131 
132 /// Composition of first two functions
135  CCompartOptions compart_options,
136  const vector<pair<THit::TCoord, THit::TCoord> > *gaps = NULL);
137 
138 /// Composition of all three functions
141  CCompartOptions compart_options);
142 
143 END_SCOPE(prosplign)
145 #endif
CArgDescriptions –.
Definition: ncbiargs.hpp:541
CArgs –.
Definition: ncbiargs.hpp:379
EMaximizing m_Maximizing
static const double default_MinCompartmentIdty
static const int default_MaxIntron
static const double default_MinSingleCompartmentIdty
static const double default_CompartmentPenalty
static const int default_MaxOverlap
double m_CompartmentPenalty
double m_MinCompartmentIdty
ESubjectMol m_SubjectMol
double m_MinSingleCompartmentIdty
CRef –.
Definition: ncbiobj.hpp:618
vector< THitRef > THitRefs
Definition: splign.hpp:295
TCompartments SelectCompartmentsHits(const THitRefs &hitrefs, CCompartOptions compart_options, const vector< pair< THit::TCoord, THit::TCoord > > *gaps=NULL)
Composition of first two functions.
CSplign::THitRef THitRef
TCompartmentStructs MakeCompartments(const TCompartments &asn_representation, CCompartOptions compart_options)
CSplign::THit THit
CSplign::THitRefs THitRefs
vector< SCompartment > TCompartmentStructs
list< CRef< CSeq_annot > > TCompartments
TCompartments FormatAsAsn(CCompartmentAccessor< THit > *comparts_ptr, CCompartOptions compart_options, const vector< pair< THit::TCoord, THit::TCoord > > *gaps=NULL)
unique_ptr< CCompartmentAccessor< THit > > CreateCompartmentAccessor(const THitRefs &orig_hitrefs, CCompartOptions compart_options, const vector< pair< THit::TCoord, THit::TCoord > > *gaps=NULL)
Selects compartments.
USING_SCOPE(objects)
@ eScore
Raw score.
#define NULL
Definition: ncbistd.hpp:225
#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
#define NCBI_XALGOALIGN_EXPORT
Definition: ncbi_export.h:985
Defines command line argument related classes.
The NCBI C++/STL use hints.
bool operator<(const SCompartment &comp) const
SCompartment(int from_, int to_, bool strand_, int covered_aa_, double score_, int raw_score_)
Modified on Fri Sep 20 14:57:31 2024 by modify_doxy.py rev. 669887