NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Enumerations | Functions

Detailed Description

This module provides various operators to work with the following alphabets:
DNA 4-letter DNA alphabet A,C,G,T
DNA_N 5-letter DNA + N alphabet A,C,G,T,N
DNA_IUPAC 16-letter DNA IUPAC alphabet =,A,C,M,G,R,S,V,T,W,Y,H,K,D,B,N
PROTEIN 24-letter Protein alphabet A,C,D,E,F,G,H,I,K,L,M,N,O,P,Q,R,S,T,V,W,Y,B,Z,X
RNA 4-letter RNA alphabet A,C,G,U
RNA_N 5-letter RNA + N alphabet A,C,G,U,N

Classes

struct  nvbio::AlphabetTraits< ALPHABET >
 
struct  nvbio::AlphabetTraits< DNA >
 
struct  nvbio::AlphabetTraits< DNA_N >
 
struct  nvbio::AlphabetTraits< DNA_IUPAC >
 
struct  nvbio::AlphabetTraits< PROTEIN >
 
struct  nvbio::AlphabetTraits< RNA >
 
struct  nvbio::AlphabetTraits< RNA_N >
 
struct  nvbio::AlphabetTraits< ASCII >
 
struct  nvbio::to_char_functor< ALPHABET >
 
struct  nvbio::from_char_functor< ALPHABET >
 

Enumerations

enum  nvbio::Alphabet {
  nvbio::DNA = 0u, nvbio::DNA_N = 1u, nvbio::DNA_IUPAC = 2u, nvbio::PROTEIN = 3u,
  nvbio::RNA = 4u, nvbio::RNA_N = 5u, nvbio::ASCII = 6u
}
 

Functions

NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::bits_per_symbol (const Alphabet alphabet)
 
template<Alphabet ALPHABET>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE char 
nvbio::to_char (const uint8 c)
 
template<Alphabet ALPHABET>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint8 
nvbio::from_char (const char c)
 
template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::to_string (const SymbolIterator begin, const uint32 n, char *string)
 
template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::to_string (const SymbolIterator begin, const SymbolIterator end, char *string)
 
template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::from_string (const char *begin, const char *end, SymbolIterator symbols)
 
template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::from_string (const char *begin, SymbolIterator symbols)
 
template<Alphabet ALPHABET, typename Iterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE
transform_iterator< Iterator,
to_char_functor< ALPHABET > > 
nvbio::to_string (Iterator it)
 
template<Alphabet ALPHABET, typename Iterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE
transform_iterator< Iterator,
from_char_functor< ALPHABET > > 
nvbio::from_string (Iterator it)
 

Enumeration Type Documentation

The supported sequence alphabet types

Enumerator
DNA 

4-letter DNA alphabet { A,C,G,T }

DNA_N 

5-letter DNA + N alphabet { A,C,G,T,N }

DNA_IUPAC 

16-letter DNA IUPAC alphabet { =,A,C,M,G,R,S,V,T,W,Y,H,K,D,B,N }

PROTEIN 

24-letter Protein alphabet { A,C,D,E,F,G,H,I,K,L,M,N,O,P,Q,R,S,T,V,W,Y,B,Z,X }

RNA 

4-letter RNA alphabet { A,C,G,U }

RNA_N 

5-letter RNA + N alphabet { A,C,G,U,N }

ASCII 

standard ASCII alphabet

Definition at line 68 of file alphabet.h.

Function Documentation

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::bits_per_symbol ( const Alphabet  alphabet)

return the number of bits per symbol for a given alphabet

Definition at line 212 of file alphabet.h.

template<Alphabet ALPHABET>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint8 nvbio::from_char ( const char  c)

convert a given symbol to its ASCII character

Definition at line 145 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::from_string ( const char *  begin,
const char *  end,
SymbolIterator  symbols 
)

convert from an ASCII string to the given alphabet

Definition at line 196 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::from_string ( const char *  begin,
SymbolIterator  symbols 
)

convert from an ASCII string to the given alphabet

Definition at line 208 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename Iterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE transform_iterator< Iterator, from_char_functor<ALPHABET> > nvbio::from_string ( Iterator  it)

convert an ASCII string iterator to a given alphabet string iterator

Definition at line 306 of file alphabet.h.

template<Alphabet ALPHABET>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE char nvbio::to_char ( const uint8  c)

convert a given symbol to its ASCII character

Definition at line 122 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::to_string ( const SymbolIterator  begin,
const uint32  n,
char *  string 
)

convert from the given alphabet to an ASCII string

Definition at line 168 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename SymbolIterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::to_string ( const SymbolIterator  begin,
const SymbolIterator  end,
char *  string 
)

convert from the given alphabet to an ASCII string

Definition at line 182 of file alphabet_inl.h.

template<Alphabet ALPHABET, typename Iterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE transform_iterator< Iterator, to_char_functor<ALPHABET> > nvbio::to_string ( Iterator  it)

convert a string iterator from a given alphabet to an ASCII string iterator

Definition at line 296 of file alphabet.h.