Files
DEC/DEC_GUI/DEC-0.0/individual/genome/AbstractGenome.h
2024-10-03 18:43:04 +07:00

57 lines
1.9 KiB
C++

#pragma once
#include "Chromosome.h"
#include "strategies/ChromosomeRearrangementStrategy.h"
#include <vector>
#include <iostream>
/*
*/
class ChromosomeRearrangementStrategy; // forward declaration
class Genotype;
class HaploidGenotype {
friend class Genotype;
friend class ChromosomeRearrangementStrategy;
friend std::ostream& operator << (std::ostream& os, const Genotype& g);
friend class Processor;
protected:
std::vector<Chromosome> chromosomes;
public:
const Chromosome& getChromosome(unsigned int i) const { return this->chromosomes.at(i);}
public:
HaploidGenotype(const std::vector<Chromosome>& _chrom) : chromosomes(_chrom){};
};
class Genotype {
friend class ChromosomeRearrangementStrategy;
friend std::ostream& operator<< (std::ostream& os, const Genotype& g);
friend class Processor;
protected:
HaploidGenotype fatherGenome;
HaploidGenotype motherGenome;
public:
Genotype(const std::vector<Chromosome>& _fGenome, const std::vector<Chromosome>& _mGenome) : fatherGenome(HaploidGenotype(_fGenome)), motherGenome(HaploidGenotype(_mGenome)) {};
Genotype(const HaploidGenotype& _fGenome, const HaploidGenotype& _mGenome) : fatherGenome(_fGenome), motherGenome(_mGenome) {};
Genotype(const Genotype& _fDiplGenome, const Genotype& _mDiplGenome);
HaploidGenotype recombinantHaploidGenotype(ChromosomeRearrangementStrategy*) const;
const HaploidGenotype& getFatherGenome() const { return this->fatherGenome;}
const HaploidGenotype& getMotherGenome() const { return this->motherGenome;}
std::string toSimpleString() const;
std::string toSimpleFasta(bool onlyMother = true) const;
std::string toMaxModuleAB() const;
std::string getRawGene(unsigned int fatherMother, unsigned int chromoNum, unsigned int geneNum) const;
void doRawMutationSequence(unsigned int fatherMother, unsigned int chromoNum, unsigned int geneNum, std::string newSeq);
};
//!!!!!!!!!!
class PolyploidGenotype {
};