Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

matvec::Genome Class Reference

#include <genome.h>

List of all members.


Detailed Description

a genome consists of chromosomes

See also:
Chromosome

Definition at line 37 of file genome.h.

Public Methods

 Genome (void)
 Genome (GeneticDist *D)
 Genome (const Genome &A)
 ~Genome (void)
const Genome & operator= (const Genome &A)
unsigned nchrom (void)
unsigned size (void)
int chrom_id (const Chromosome &chrm) const
void release (void)
void remodel (GeneticDist *D)
void resize (const unsigned nc, const unsigned nl)

Public Attributes

Chromosomechromosome

Protected Methods

void copyfrom (const Genome &A)

Protected Attributes

unsigned numchrom


Constructor & Destructor Documentation

matvec::Genome::Genome void    [inline]
 

Definition at line 44 of file genome.h.

References numchrom.

00044 {numchrom=0; chromosome = 0;}

matvec::Genome::Genome GeneticDist   D
 

Definition at line 39 of file genome.cpp.

References chromosome, numchrom, and remodel().

00040 {
00041    numchrom = 0;
00042    chromosome = 0;
00043    remodel(D);
00044 }

matvec::Genome::Genome const Genome &    A
 

Definition at line 46 of file genome.cpp.

References chromosome, copyfrom(), and numchrom.

00047 {
00048    numchrom = 0;
00049    chromosome = 0;
00050    copyfrom(A);
00051 }

matvec::Genome::~Genome void    [inline]
 

Definition at line 47 of file genome.h.

References release().

00047 {release();};


Member Function Documentation

int matvec::Genome::chrom_id const Chromosome   chrm const
 

Definition at line 114 of file genome.cpp.

References matvec::Locus::allele, chromosome, matvec::Chromosome::id(), matvec::Chromosome::locus, matvec::Chromosome::nloci(), and numchrom.

00115 {
00116    int retval = -1;
00117    Chromosome *C;
00118    unsigned i,j,nl;
00119    for (i=0; i<numchrom; i++) {
00120       C = &(chromosome[i]);
00121       nl = C->nloci();
00122       for (j=0; j<nl; j++) {
00123          if (chrm.locus[j].allele != C->locus[j].allele) break; 
00124       }
00125       if (j==nl) {
00126          retval = C->id();
00127          break;
00128       }
00129    }
00130    return retval;
00131 }

void matvec::Genome::copyfrom const Genome &    A [protected]
 

Definition at line 53 of file genome.cpp.

References chromosome, and numchrom.

Referenced by Genome(), and operator=().

00054 {
00055    if (this == &A) return;
00056    numchrom = A.numchrom;
00057    if (chromosome) {
00058      delete [] chromosome;
00059      chromosome=0;
00060    }
00061    if(numchrom>0){
00062      chromosome = new Chromosome [numchrom];  // each chrom should resize
00063    }
00064    else{
00065      chromosome = 0;
00066    }
00067    for (unsigned i=0; i<numchrom; i++) chromosome[i] = A.chromosome[i];
00068 }

unsigned matvec::Genome::nchrom void    [inline]
 

Definition at line 51 of file genome.h.

References numchrom.

Referenced by matvec::Population::cond_genotype_config(), matvec::Population::genotype_config(), matvec::Population::get_genotype_freq(), matvec::Population::gibbs_iterate(), matvec::Population::ind_gamete(), and matvec::Population::llhood_phenotype().

00051 {return numchrom;}

const Genome & matvec::Genome::operator= const Genome &    A
 

Definition at line 70 of file genome.cpp.

References copyfrom().

00071 {
00072    copyfrom(A);
00073    return *this;
00074 }

void matvec::Genome::release void   
 

Definition at line 109 of file genome.cpp.

References chromosome.

Referenced by ~Genome().

00110 {
00111    if (chromosome) { delete [] chromosome; chromosome = 0; }
00112 }

void matvec::Genome::remodel GeneticDist   D
 

Definition at line 76 of file genome.cpp.

References matvec::GeneticDist::chrom(), chromosome, matvec::GeneticDist::nchrom(), numchrom, and matvec::Chromosome::resize().

Referenced by Genome(), matvec::new_Genome_vec(), and matvec::Individual::remodel().

00077 {
00078    numchrom = D->nchrom();
00079    ChromStruct *Chrom = D->chrom();
00080    if (chromosome) {
00081      delete [] chromosome;
00082      chromosome=0;
00083    }
00084    if (numchrom >0) {
00085      chromosome = new Chromosome [numchrom];  // each chrom should resize
00086    }
00087    else {
00088      chromosome = 0;
00089    }
00090    for (unsigned i=0; i<numchrom; i++) chromosome[i].resize(Chrom[i].nloci());
00091 }

void matvec::Genome::resize const unsigned    nc,
const unsigned    nl
 

Definition at line 93 of file genome.cpp.

References chromosome, numchrom, and matvec::Chromosome::resize().

Referenced by matvec::Population::build_pop_gamete().

00094 {
00095    numchrom = nc;
00096    if (chromosome) {
00097      delete [] chromosome;
00098      chromosome=0;
00099    }
00100    if(numchrom>0){
00101      chromosome = new Chromosome [numchrom];  // each chrom should resize
00102    }
00103    else{
00104      chromosome = 0;
00105    }
00106    for (unsigned i=0; i<numchrom; i++) chromosome[i].resize(nl);
00107 }

unsigned matvec::Genome::size void    [inline]
 

Definition at line 52 of file genome.h.

References numchrom.

Referenced by matvec::Population::display(), and matvec::Population::resize_genotype_counter().

00052 {return numchrom;}


Member Data Documentation

Chromosome* matvec::Genome::chromosome
 

Definition at line 42 of file genome.h.

Referenced by matvec::Population::add_Gv_inv(), matvec::Population::build_connected_groups(), matvec::Population::build_founder_allele_neighbors(), matvec::Population::build_pop_gamete(), chrom_id(), matvec::Population::cond_genotype_config(), copyfrom(), matvec::Population::display(), matvec::Population::finishUpAlleleStateInit(), matvec::Population::full_cdist(), matvec::Individual::gamete(), Genome(), matvec::Population::genotype_config(), matvec::Population::get_genotype_freq(), matvec::Individual::getAllelePenetrance(), matvec::Population::gibbs_iterate(), matvec::Population::ind_gamete(), matvec::Individual::initial_multi_anterior(), matvec::Individual::initial_multi_m_anterior(), matvec::Population::input_data(), matvec::Population::input_markerData(), matvec::Population::ListAlleleFounders(), matvec::Population::llhood_phenotype(), matvec::Individual::maternal_chrom(), matvec::Individual::maternal_chrom_id(), matvec::Model::minfun_peeling(), matvec::Population::multi_m_log_likelihood_peeling(), matvec::Population::partial_cdist(), matvec::Individual::paternal_chrom(), matvec::Individual::paternal_chrom_id(), release(), matvec::Population::relv(), remodel(), resize(), matvec::Individual::save(), matvec::Individual::search_heteroz(), matvec::Individual::set_genotype(), matvec::Individual::set_switch(), matvec::Individual::setFounderHaplotype(), matvec::Population::SimpleGenotypeElimination(), and matvec::Population::update_allele_vectors().

unsigned matvec::Genome::numchrom [protected]
 

Definition at line 39 of file genome.h.

Referenced by chrom_id(), copyfrom(), Genome(), nchrom(), remodel(), resize(), and size().


The documentation for this class was generated from the following files:
Generated on Thu Jun 16 17:14:23 2005 for Matvec by doxygen1.2.16