17 throw IOException(
"DarwinVarSingle::write: fail to open stream.");
19 (out <<
"@DARwin 5.0 - SINGLE").endLine();
25 vector<string> header;
26 header.push_back(
"Unit");
35 size_t var_nbr = header.size() - 1;
37 (out << ind_nbr <<
"\t" << var_nbr).endLine();
44 for (
size_t j = 0; j < ind_nbr_ig; ++j)
48 for (
size_t k = 0; k < geno.size(); ++k)
51 if (geno.isMonolocusGenotypeMissing(k))
53 for (
size_t l = 0; l < al.getNumberOfAlleles()[k]; ++l)
60 for (
size_t l = 0; l < al.getNumberOfAlleles()[k]; ++l)
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.
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.
const Individual & getIndividualAtPositionFromGroup(size_t groupPosition, size_t individualPosition) const
Get an Individual from a Group.
const AnalyzedLoci & analyzedLoci() const
Get the AnalyzedLoci if there is one.
size_t getNumberOfIndividualsInGroup(size_t groupPosition) 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 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.
const MonolocusGenotypeInterface & monolocusGenotype(size_t locusPosition) const
Get a MonolocusGenotype.