SHORE API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
shore::nuc Class Reference

Base symbol conversions. More...

Public Types

enum  base {
  NONE =0, ADENINE =1, CYTOSINE =2, AMINO =3,
  THYMINE =4, WEAK =5, PYRIMIDINE =6, NOT_GUANINE =7,
  GUANINE =8, PURINE =9, STRONG =10, NOT_THYMINE =11,
  KETO =12, NOT_CYTOSINE =13, NOT_ADENINE =14, ANY =15
}
 Nucleotide enum (bitmask).
 
enum  packed_base {
  PCK_ADENINE =0, PCK_CYTOSINE =1, PCK_GUANINE =2, PCK_THYMINE =3,
  PCK_ANY =4, PCK_NONE =5, PCK_PURINE =6, PCK_PYRIMIDINE =7,
  PCK_KETO =8, PCK_AMINO =9, PCK_WEAK =10, PCK_STRONG =11,
  PCK_NOT_THYMINE =12, PCK_NOT_GUANINE =13, PCK_NOT_CYTOSINE =14, PCK_NOT_ADENINE =15
}
 Nucleotide enum using fewer bits for frequent symbols.
 

Static Public Member Functions

static char enc (const base b)
 Gets the IUPAC base symbol.
 
static std::string s_enc (const base b)
 Gets the nucleotide name.
 
static char rna_enc (const base b)
 Gets the IUPAC base symbol.
 
static std::string rna_s_enc (const base b)
 Gets the nucleotide name.
 
static base comp (const base b)
 Gets the complementary base (circular shift on the bitmask).
 
static base km_class (const base b)
 Change base, but stay in the keto or amino class.
 
static base ry_class (const base b)
 Change base, but stay in the pyrimdine or purine class.
 
static base tr (const base b, const base replacewhat, const base replacewith)
 Substitute a base by another. More...
 
static base dec (const unsigned char abbr)
 Gets the base id corresponding to the given IUPAC symbol. More...
 
static base s_dec (const std::string &name)
 Gets the base id corresponding to the given nucleotide name.
 
static int amb (const base b)
 Get the level of ambiguity for a base id.
 
static int gc (const base b)
 Single base GC content. More...
 
static packed_base pack (const base b)
 
static base unpack (const packed_base b)
 
template<typename Iter >
static bool is_nucleic_acid (Iter beg, Iter end, typename boost::enable_if< boost::is_same< typename std::iterator_traits< Iter >::value_type, char > >::type *dummy=0)
 Test if a character sequence represents a nucleotide sequence.
 
template<typename Iter >
static bool is_plain_nucleic_acid (Iter beg, Iter end, typename boost::enable_if< boost::is_same< typename std::iterator_traits< Iter >::value_type, char > >::type *dummy=0)
 Test if a character sequence represents a nucleotide sequence without ambiguous IUPAC symbols.
 
template<typename Iter >
static bool is_rc_palindrome (Iter b, Iter e, typename boost::enable_if< boost::is_same< typename std::iterator_traits< Iter >::value_type, base > >::type *dummy=0)
 Test if the sequence in the range is a bio palindrome.
 
template<typename Iter >
static bool is_rc_palindrome (Iter b, Iter e, typename boost::enable_if< boost::is_same< typename std::iterator_traits< Iter >::value_type, packed_base > >::type *dummy=0)
 Test if the sequence in the range is a bio palindrome.
 
template<typename Iter >
static bool is_rc_palindrome (Iter b, Iter e, typename boost::enable_if< boost::is_same< typename std::iterator_traits< Iter >::value_type, char > >::type *dummy=0)
 Test if the sequence in the range is a bio palindrome.
 
static void rcomp (std::string &seq)
 Reverse complements a sequence (in place).
 
template<typename Iter >
static void to_string (Iter beg, Iter end, std::string &res)
 
template<typename Iter >
static std::string to_string (Iter beg, Iter end)
 
template<typename Iter >
static void unpack_to_string (Iter beg, Iter end, std::string &res)
 
template<typename Iter >
static Iter unpack_to_string (Iter beg, Iter end, std::string &res, size_t nmax)
 
template<typename Iter >
static std::string unpack_to_string (Iter beg, Iter end)
 

Detailed Description

Base symbol conversions.

Member Function Documentation

static base shore::nuc::dec ( const unsigned char  abbr)
inlinestatic

Gets the base id corresponding to the given IUPAC symbol.

Upper and lower case symbols supported; 'U' is treated as 'T'. Invalid symbols or gaps convert to NONE.

static int shore::nuc::gc ( const base  b)
inlinestatic

Single base GC content.

Returns
0 -> 0.0, 2 -> 1/3, 3 -> 1/2, 4 -> 2/3, 6 -> 1.0
static base shore::nuc::tr ( const base  b,
const base  replacewhat,
const base  replacewith 
)
inlinestatic

Substitute a base by another.

Only meaningful for ambiguous symbols.


The documentation for this class was generated from the following file: