52 throw IOException(
"DarwinVarSingle::write: fail to open stream.");
54 (out <<
"@DARwin 5.0 - SINGLE").endLine();
60 vector<string> header;
61 header.push_back(
"Unit");
70 size_t var_nbr = header.size() - 1;
72 (out << ind_nbr <<
"\t" << var_nbr).endLine();
79 for (
size_t j = 0; j < ind_nbr_ig; j++)
83 for (
size_t k = 0; k < geno.
size(); k++)
virtual void write(std::ostream &os, const DataSet &data_set) const =0
Write a DataSet on ostream.
virtual const std::string & getId() const =0
Get the identitier of the allele.
std::vector< size_t > getNumberOfAlleles() const
Get the number of alleles at each locus.
void write(std::ostream &os, const DataSet &data_set) const
Write a DataSet on ostream.
DarwinVarSingle(size_t missingData=999)
size_t getNumberOfGroups() const
Get the number of Groups.
size_t getNumberOfIndividualsInGroup(size_t group_position) const
Get the number of Individuals in a Group.
const LocusInfo & getLocusInfoAtPosition(size_t locus_position) const
Get a LocusInfo by its position.
size_t getNumberOfLoci() const
Get the number of loci.
const AnalyzedLoci * getAnalyzedLoci() const
Get the AnalyzedLoci if there is one.
const Individual * getIndividualAtPositionFromGroup(size_t group_position, size_t individual_position) const
Get an Individual from a Group.
const MultilocusGenotype & getGenotype() const
Get the genotype.
size_t getNumberOfAlleles() const
Get the number of alleles at this locus.
const AlleleInfo & getAlleleInfoByKey(size_t key) const
Retrieve an AlleleInfo object of the LocusInfo.
const std::string & getName() const
Get the name of the locus.
The MonolocusGenotype virtual class.
virtual std::vector< size_t > getAlleleIndex() const =0
Get the alleles' index.
The MultilocusGenotype class.
const MonolocusGenotype & getMonolocusGenotype(size_t locus_position) const
Get a MonolocusGenotype.
bool isMonolocusGenotypeMissing(size_t locus_position) const
Tell if a MonolocusGenotype is a missing data.
size_t size() const
Count the number of loci.