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

Go to the SVN repository for this file.

1 #ifndef ALGO_SEQ__CONSENSUS_SPLICE__HPP
2 #define ALGO_SEQ__CONSENSUS_SPLICE__HPP
3 
4 /* $Id: consensus_splice.hpp 58730 2013-07-02 18:56:07Z astashya $
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  * Authors: Josh Cherry
30  *
31  * File Description: Simple functions for determining whether a pair of
32  * dinucleotides form a consensus splice sequence
33  *
34  */
35 
36 #include <corelib/ncbistd.hpp>
37 
39 
40 
41 /// Consensus splice is GY..AG or AT..AC
42 inline bool IsConsensusSplice(const string& splice5,
43  const string& splice3)
44 {
45  return (NStr::EqualNocase(splice3, "AG") &&
46  (NStr::EqualNocase(splice5, "GT") ||
47  NStr::EqualNocase(splice5, "GC"))) ||
48  (NStr::EqualNocase(splice5, "AT") &&
49  NStr::EqualNocase(splice3, "AC"));
50 }
51 
52 
53 /// Strict consensus splice is GT..AG
54 inline bool IsStrictConsensusSplice(const string& splice5,
55  const string& splice3)
56 {
57  return NStr::EqualNocase(splice5, "GT") &&
58  NStr::EqualNocase(splice3, "AG");
59 }
60 
61 /// GT-{TG,GG,AT,AA} or {GA,TT,AT,GG}-AG or AT-{AT,AA}
62 inline bool IsKnownNonConsensusSplice(const string& splice5,
63  const string& splice3)
64 {
65  return (splice5.size() == 2 && NStr::FindNoCase("GA TT AT GG", splice5) != NPOS && NStr::EqualNocase(splice3, "AG"))
66  || (NStr::EqualNocase(splice5, "GT") && splice3.size() == 2 && NStr::FindNoCase("TG GG AT AA", splice3) != NPOS)
67  || (NStr::EqualNocase(splice5, "AT") && splice3.size() == 2 && NStr::FindNoCase("AT AA", splice3) != NPOS) ;
68 }
69 
71 
72 #endif // ALGO_SEQ__CONSENSUS_SPLICE__HPP
bool IsConsensusSplice(const string &splice5, const string &splice3)
Consensus splice is GY..AG or AT..AC.
bool IsKnownNonConsensusSplice(const string &splice5, const string &splice3)
GT-{TG,GG,AT,AA} or {GA,TT,AT,GG}-AG or AT-{AT,AA}.
bool IsStrictConsensusSplice(const string &splice5, const string &splice3)
Strict consensus splice is GT..AG.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
Definition: ncbistr.cpp:2993
#define NPOS
Definition: ncbistr.hpp:133
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5353
Modified on Mon May 27 04:34:56 2024 by modify_doxy.py rev. 669887