Simulating Mating Alliances as a Reproductive Tactic for Populations
 All Classes Functions Variables Friends
Public Member Functions | Friends | List of all members
DNA Class Reference

Public Member Functions

template<class T >
 DNA (Population< T > *pop)
 
 DNA (Population< Humandna > *pop, int tdna)
 
 DNA (DNA const &a)
 
 DNA (DNA const &a, DNA const &b)
 
 DNA (typeDNA *input, int size)
 
 DNA (array_type const &input, int sizeN, int sizeX)
 
 DNA (std::vector< std::vector< typeDNA > > input)
 
DNAoperator= (DNA const &)
 
int get_N () const
 
int get_nbXcell () const
 
int get_nbS () const
 
long poly_sites () const
 
double prop_poly_sites () const
 
double mean_pw_diff () const
 
double theta_waterson () const
 
double theta_hom () const
 
double theta_pi () const
 
int nb_of_haplotypes () const
 
DNA haplotypes () const
 
std::vector< double > hap_frequency () const
 
std::vector< double > site_frequency (int site) const
 
double heterozigosity_hap () const
 
double heterozigosity_sites () const
 
double Neff (double theta, double mu) const
 
double tajima_D () const
 
std::vector< double > site_frequency_DNA (int site) const
 
typeDNA dist_two (int a, int b) const
 
void output_diversity (std::ofstream &) const
 
void output_diversity_with_time (std::ofstream &, int Ntheo, int timeG) const
 
void output_diversity (std::ofstream &fs, int Ntheo) const
 
void output_arlequin (std::string filename) const
 
void output_fasta (std::string filename) const
 

Friends

std::ostream & operator<< (std::ostream &, DNA const &)
 
DNA operator+ (DNA const &, DNA const &)
 

Constructor & Destructor Documentation

template<class T >
DNA::DNA ( Population< T > *  pop)
inlineexplicit

Constructor which creates a DNA instance from a Population instance. It will extract the mtDNA of each individuals and store it in an array.

template<class T >
DNA::DNA ( Population< Humandna > *  pop,
int Nuc)
inlineexplicit

Constructor which creates a DNA instance from a Population < Humandna > instance. For each individual it will extract the DNA from either the X chromosome (Nuc = 0), the Y chromomosome (Nuc = 1) or the autosomes (Nuc = 2).

DNA::DNA ( DNA const &  a)

Copy constructor.

DNA::DNA ( DNA const &  a,
DNA const &  b 
)

Merger of two DNA instance, it concatenates both genetic samples in the same array.

DNA::DNA ( typeDNA *  input,
int  size 
)

Constructor directly from an array of DNA sequences.

Member Function Documentation

typeDNA DNA::dist_two ( int  a,
int  b 
) const

Returns the Hamming distance (number of of different nucleotides) between two sequences.

int DNA::get_nbS ( ) const

Returns the number of polymorphic sites in the whole sample.

int DNA::get_nbXcell ( ) const

Returns the number of cell taken by a sequence in the big array. It is the number of sites per sequence divided by 32.

vector< double > DNA::hap_frequency ( ) const

Returns an array with the frequency of each haplotype found in the sample. The size of this array is the number of haplotypes.

DNA DNA::haplotypes ( ) const

Returns an array containing all the haplotypes found in the sample.

double DNA::heterozigosity_hap ( ) const

Returns the heterozygosity of the sample computed at the level of haplotypes, i.e. the allele diversity.

double DNA::heterozigosity_sites ( ) const

Returns the heterozygosity of the sample computed at the level of sites, i.e. the polymorphic diversity, using Nei's formula.

double DNA::mean_pw_diff ( ) const

Returns the mean pairwise difference of the sample. It is calculated by summing the distance between each pair of sequences and dividing by the number of pair compared.

int DNA::nb_of_haplotypes ( ) const

Returns the number of haplotypes in the sample

double DNA::Neff ( double  theta,
double  mu 
) const

Returns effective population size from an estimation of theta and a mutation rate: theta/(2x Mutation rate).

DNA & DNA::operator= ( DNA const &  a)

Assignment operator.

void DNA::output_arlequin ( std::string  filename) const

Outputs the sample in a file formatted to be piped through the Arlequin program.

void DNA::output_diversity ( std::ofstream &  ) const

Outputs different diversity indices for the sample in a file.

void DNA::output_diversity ( std::ofstream &  fs,
int  Ntheo 
) const

Outputs different diversity indices for the sample in a file, along the real population size (which can be different from the sample one).

void DNA::output_diversity_with_time ( std::ofstream &  ,
int  Ntheo,
int  timeG 
) const

Outputs different diversity indices for the sample in a file, along the real population size (which can be different from the sample one) and the time of sample.

void DNA::output_fasta ( std::string  filename) const

Outputs the sequences in a file in Fasta format, to be used by other sofware.

long DNA::poly_sites ( ) const

Returns the number polymorhpic sites in the sample.

double DNA::prop_poly_sites ( ) const

Returns the proportion of polymorphic sites in the sample, i.e. number of polymorphic sites over total number of sites.

vector< double > DNA::site_frequency ( int  site) const

Returns an array with the frequency of each found nucleotide on the given site. Its size vary with thenumber of present nuclotides.

vector< double > DNA::site_frequency_DNA ( int  site) const

Returns an array with the frequency of each found nucleotide on the given site. Its size is always 4.

double DNA::tajima_D ( ) const

Return Tajima's D.

double DNA::theta_waterson ( ) const

Returns theta Watterson index of diversity, based on the number of polymorphic sites.

double DNA::theta_hom ( ) const

Returns an estimator of theta based on the homozygosity of the sample.

double DNA::theta_pi ( ) const

Returns an estimator of theta based on the mean pairwise difference.


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

SMARTPOP home