yat  0.16pre
Classes | Functions
theplu::yat::omic Namespace Reference

Classes and functions related to genomics and proteomics. More...

Classes

struct  AminoAcidEqual
 Functor comparing if two Codons translate to the same amino acid. More...
 
class  BamFile
 
class  BamHeader
 Wrapper around bam_hdr_t struct. More...
 
struct  BamLessEnd
 
struct  BamLessName
 
struct  BamLessPos
 
class  BamPair
 
class  BamPairIterator
 
class  BamPairProxy
 
class  BamRead
 Class holding a bam query. More...
 
class  BamReadFilter
 Filter bam reads. More...
 
class  BamReadIterator
 class to iterate through a InBamFile More...
 
class  BamWriteIterator
 Output iterator for bam file. More...
 
class  BamWriter
 
class  Codon
 
class  DNA
 
struct  DnaComplementer
 Functor that calculates genomic complement. More...
 
class  Fasta
 wrapper class around struct faidx_t in libhts More...
 
class  GenomicPosition
 
class  GFF
 
class  GFF2
 
class  GFF3
 
class  InBamFile
 
class  OutBamFile
 
class  Pileup
 
class  VCF
 

Functions

template<typename InputIterator , typename OutputIterator >
void dna_complement (InputIterator begin, InputIterator end, OutputIterator out)
 
template<typename BidirectionalIterator >
void dna_reverse_complement (BidirectionalIterator begin, BidirectionalIterator end)
 
template<typename BidirectionalIterator , typename OutputIterator >
void dna_reverse_complement_copy (BidirectionalIterator begin, BidirectionalIterator end, OutputIterator out)
 
const unsigned char nt16_table (char)
 
const char nt16_str (uint8_t)
 
template<typename RandomAccessIterator >
double alignment_score (const BamRead &bam, RandomAccessIterator ref, double mismatch, double gap=0.0, double open_gap=0.0)
 
unsigned short chr2int (const std::string &str)
 transform a string to unsigned short chromosome number More...
 
double phred (double p)
 
double phred_inv (double x)
 
bool is_indel (const VCF &)
 
bool is_snv (const VCF &)
 
bool is_dnv (const VCF &)
 
bool is_mnv (const VCF &)
 

Detailed Description

Classes and functions related to genomics and proteomics.

Function Documentation

template<typename RandomAccessIterator >
double theplu::yat::omic::alignment_score ( const BamRead bam,
RandomAccessIterator  ref,
double  mismatch,
double  gap = 0.0,
double  open_gap = 0.0 
)

Calculate alignment score based on bam's cigar and sequence and the reference as in [ref, ref + bam.end()-bam.pos()).

For indels the score is calculated as open_gap + len * gap. For mismatches the score is calculated -mismatch. For matches the score is unity.

For cigar element BAM_CMATCH the sequence and reference is used to differentiate match from mismatch.

Type Requirments:

Since
New in yat 0.13
unsigned short theplu::yat::omic::chr2int ( const std::string &  str)

transform a string to unsigned short chromosome number

If str starts with 'chr' that prefix is stripped away before translating the string to chromosome number. Function translates "X" to 23, "Y" to 24, and "M" or "MT" to 25. For other inputs utility::convert is used to transform the input to an unsigned short.

Returns
chromosome number
Since
New in yat 0.7
template<typename InputIterator , typename OutputIterator >
void theplu::yat::omic::dna_complement ( InputIterator  begin,
InputIterator  end,
OutputIterator  out 
)

bam_pair_analyse performs an operation on bam read pairs as defined by visitor. The function iterates over sorted input range of reads; if read is first read, it is cached for later use; if read is second read and mate is present in cache, visitor operates on pair, i.e., Visitor (mate, read) is called.

Type Requirements:

Note
Input range [first, last ) must be sorted or behaviour is undefined.
Since
New in yat 0.10 Function that transforms a sequence of chars to its genomic complement (see DnaComplementer). Sequence can be transformed in-place, i.e., begin and out can point to the same element.

Type Requirements:

Since
New in yat 0.14
template<typename BidirectionalIterator >
void theplu::yat::omic::dna_reverse_complement ( BidirectionalIterator  begin,
BidirectionalIterator  end 
)

Function that transforms a sequence of chars to its genomic reverse complement, i.e., it transforms the sequence using DnaComplementer and reverse the sequence.

Type Requirements:

  • BidirectionalIterator is Bidirectional Iterator
  • BidirectionalIterator is Writable Iterator
  • value type of BidirectionalIterator is convertible to char
  • char must be convertible to value type of BidirectionalIterator
See also
dna_complement
dna_reverse_complement_copy
Since
New in yat 0.14
template<typename BidirectionalIterator , typename OutputIterator >
void theplu::yat::omic::dna_reverse_complement_copy ( BidirectionalIterator  begin,
BidirectionalIterator  end,
OutputIterator  out 
)

Function that transforms a sequence of chars to its genomic reverse complement, i.e., it transforms the sequence using DnaComplementer and reverse the sequence.

Type Requirements:

Type Requirements:

See also
dna_complement
dna_reverse_complement
Note
If input range and output range overlap, behaviour is undefined.
Since
New in yat 0.14
bool theplu::yat::omic::is_dnv ( const VCF )
Returns
true if at least one variant is a double-nucleotide variant (DNV), i.e., ref is 2bp and at least one alt allele is 2bp.
bool theplu::yat::omic::is_indel ( const VCF )
Returns
true if at least one variant is an indel, i.e., if at least one alt allele is not the same size as ref.
bool theplu::yat::omic::is_mnv ( const VCF )
Returns
true if at least one variant is a multi-nucleotide variant (MNV), i.e., ref is >2bp and at least one alt allele is same length as ref.
bool theplu::yat::omic::is_snv ( const VCF )
Returns
true if at least one variant is a single-nucleotide variant (SNV), i.e., ref is 1bp and at least one alt allele is 1bp.
const char theplu::yat::omic::nt16_str ( uint8_t  )

Convert a 4-bit encoded nucleotide to a character.

This is the same functionality that is provided in HTSLIB's global array seq_nt16_str, but this function works also when building against libbam. In libbam the array was called bam_nt16_rev_table.

This is the inverse of function nt16_table.

Since
New in yat 0.13
const unsigned char theplu::yat::omic::nt16_table ( char  )

Convert nucleotide character to 4-bit encoding. The result is encoded as 1/2/4/8 for A/C/G/T or combinations of these bits.

This is the same functionality that is provided in HTSLIB's global array seq_nt16_table, but this function works also when building against libbam. In libbam the array was called bam_nt16_table.

This is the inverse of function nt16_str.

Since
New in yat 0.13
double theplu::yat::omic::phred ( double  p)

Phred scaled probability is defined as $ \textrm{Phred} = -10 \log_{10} (p) $

Returns
phred scaled probability
Since
New in yat 0.13
See also
phred_inv
double theplu::yat::omic::phred_inv ( double  x)

The inverse of Phred scaling is calculated as $ 10^{-x/10} $

Returns
inverse of Phred scaling
Since
New in yat 0.13
See also
phred

Generated on Sat Oct 13 2018 02:36:32 for yat by  doxygen 1.8.11