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

Go to the SVN repository for this file.

1 /*
2 * $Id: Info.hpp 68796 2015-09-02 16:48:42Z kiryutin $
3 *
4 * =========================================================================
5 *
6 * PUBLIC DOMAIN NOTICE
7 * National Center for Biotechnology Information
8 *
9 * This software/database is a "United States Government Work" under the
10 * terms of the United States Copyright Act. It was written as part of
11 * the author's official duties as a United States Government employee and
12 * thus cannot be copyrighted. This software/database is freely available
13 * to the public for use. The National Library of Medicine and the U.S.
14 * Government have not placed any restriction on its use or reproduction.
15 *
16 * Although all reasonable efforts have been taken to ensure the accuracy
17 * and reliability of the software and data, the NLM and the U.S.
18 * Government do not and cannt warrant the performance or results that
19 * may be obtained by using this software or data. The NLM and the U.S.
20 * Government disclaim all warranties, express or implied, including
21 * warranties of performance, merchantability or fitness for any particular
22 * purpose.
23 *
24 * Please cite the author in any work or product based on this material.
25 *
26 * =========================================================================
27 *
28 * Author: Boris Kiryutin
29 *
30 * =========================================================================
31 */
32 
33 
34 #ifndef PROSPLIGN_INFO_HPP
35 #define PROSPLIGN_INFO_HPP
36 
37 #include <corelib/ncbistl.hpp>
38 #include <string>
39 #include <list>
40 #include <iostream>
41 
43 
45 
46 class CProteinAlignText;
47 
48 BEGIN_SCOPE(prosplign)
49 
50 class CNPiece {//AKA 'good hit'
51 public:
52  int beg, end; //represents [beg, end) interval IN ALIGNMENT COORD.
53  int posit, efflen;
54 
55  CNPiece(string::size_type obeg, string::size_type oend, int oposit, int oefflen);
56 };
57 
58 /// Extended output filtering parameters
59 /// deprecated, used in older programs
61 public:
63 
64  int drop;
66 
67  bool Dropof(int efflen, int posit, list<prosplign::CNPiece>::iterator it);
68  void Join(list<prosplign::CNPiece>::iterator it, list<prosplign::CNPiece>::iterator last);
69  bool Perc(list<prosplign::CNPiece>::iterator it, int efflen, int posit, list<prosplign::CNPiece>::iterator last);
70  bool Bad(list<prosplign::CNPiece>::iterator it);
71  bool ForwCheck(list<prosplign::CNPiece>::iterator it1, list<prosplign::CNPiece>::iterator it2);
72  bool BackCheck(list<prosplign::CNPiece>::iterator it1, list<prosplign::CNPiece>::iterator it2);
73 };
74 
76 class CSubstMatrix;
77 
78 list<CNPiece> FindGoodParts(const CProteinAlignText& alignment_text, CProSplignOutputOptionsExt options, const CProSplignScaledScoring& scoring, const CSubstMatrix& matrix);
79 list<CNPiece> ExcludeBadExons(const CNPiece pc, const string& match_all_pos, const string& protein, CProSplignOutputOptionsExt m_options);
80 list<CNPiece> FindGoodParts(const CNPiece pc, const string& match_all_pos, const string& protein, CProSplignOutputOptionsExt m_options);
81 //tries to trim negative score tail, returns true if trimmed, false otherwise
82 //stop at intron. Score frameshift as regular gap
83 bool TrimNegativeTail(CNPiece& pc, const CProteinAlignText& alignment_text, const CProSplignScaledScoring& scoring, const CSubstMatrix& matrix);
84 
85 void RefineAlignment(objects::CScope& scope, objects::CSeq_align& seq_align, const list<CNPiece>& good_parts);
86 void SetScores(objects::CSeq_align& seq_align, objects::CScope& scope, const string& matrix_name = "BLOSUM62");
87 
88 // class CAli;
89 // class CSubstMatrix;
90 
91 // class CInfo
92 // {
93 // public:
94 // CInfo(const CAli& ali, const CSubstMatrix& matrix);
95 // ~CInfo(void);
96 
97 // //returns next nucleotide after given alignment position or ncoor.back() if none
98 // //or seqlen if none (NULL BASED), works for [-1:alig_len-1] range
99 // int NextNucNullBased(int alipos) const {
100 // if(alipos<0) return 0;
101 // return ncoor[alipos];
102 // }
103 
104 // //'good' pieces. many methods imply that
105 // //the pieces begin and and on match (positive?)
106 // //careful with type 'full'
107 // list<CNPiece> m_AliPiece;
108 // void Cut(CProSplignOutputOptionsExt output_options = CProSplignOutputOptions());
109 
110 // private:
111 
112 // //alignment coords -> sequence coords.
113 // //ONE BASED (designed specially for output), for initial gap value is 0
114 // vector<int> ncoor;
115 
116 // string outn, outr, match, outp;
117 
118 // void InitAlign(const CAli& ali, const CSubstMatrix& matrix);
119 // };
120 
121 END_SCOPE(prosplign)
123 
124 #endif //PROSPLIGN_INFO_HPP
list< CNPiece > ExcludeBadExons(const CNPiece pc, const string &match_all_pos, const string &protein, CProSplignOutputOptionsExt m_options)
Definition: Info.cpp:388
void RefineAlignment(objects::CScope &scope, objects::CSeq_align &seq_align, const list< CNPiece > &good_parts)
bool TrimNegativeTail(CNPiece &pc, const CProteinAlignText &alignment_text, const CProSplignScaledScoring &scoring, const CSubstMatrix &matrix)
Definition: Info.cpp:438
list< CNPiece > FindGoodParts(const CProteinAlignText &alignment_text, CProSplignOutputOptionsExt options, const CProSplignScaledScoring &scoring, const CSubstMatrix &matrix)
Definition: Info.cpp:107
void SetScores(objects::CSeq_align &seq_align, objects::CScope &scope, const string &matrix_name="BLOSUM62")
Definition: Info.hpp:50
int posit
Definition: Info.hpp:53
int end
Definition: Info.hpp:52
Extended output filtering parameters deprecated, used in older programs.
Definition: Info.hpp:60
CProSplignOutputOptionsExt(const CProSplignOutputOptions &options)
Definition: Info.cpp:101
bool Perc(list< prosplign::CNPiece >::iterator it, int efflen, int posit, list< prosplign::CNPiece >::iterator last)
Definition: Info.cpp:523
bool ForwCheck(list< prosplign::CNPiece >::iterator it1, list< prosplign::CNPiece >::iterator it2)
Definition: Info.cpp:543
void Join(list< prosplign::CNPiece >::iterator it, list< prosplign::CNPiece >::iterator last)
Definition: Info.cpp:530
bool Bad(list< prosplign::CNPiece >::iterator it)
Definition: Info.cpp:511
bool BackCheck(list< prosplign::CNPiece >::iterator it1, list< prosplign::CNPiece >::iterator it2)
Definition: Info.cpp:559
bool Dropof(int efflen, int posit, list< prosplign::CNPiece >::iterator it)
Definition: Info.cpp:517
Output filtering parameters.
Definition: prosplign.hpp:156
Text representation of ProSplign alignment.
Definition: alntext.hpp:60
Substitution Matrix for Scoring Amino-Acid Alignments.
Definition: nucprot.hpp:123
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:51
#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
The NCBI C++/STL use hints.
Modified on Sat Feb 24 07:49:13 2024 by modify_doxy.py rev. 669887