17 throw IOException(
"Genetix::read: fail to open stream.");
21 stringstream(temp) >> loc_nbr;
27 stringstream(temp) >> grp_nbr;
30 for (
unsigned int i = 0; i < loc_nbr; i++)
40 for (
unsigned int j = 0; j < nbr_al; j++)
51 for (
unsigned int i = 0; i < grp_nbr; i++)
61 stringstream tmp(temp);
63 for (
unsigned int j = 0; j < ind_nbr; j++)
66 string ind_name(temp.begin(), temp.begin() + 11);
67 temp = string(temp.begin() + 11, temp.end());
72 for (
unsigned int k = 0; k < loc_nbr; k++)
75 vector<string> tmp_alleles;
76 tmp_alleles.push_back(
string(tmp_string.begin(), tmp_string.begin() + 3));
77 tmp_alleles.push_back(
string(tmp_string.begin() + 3, tmp_string.begin() + 6));
78 if (tmp_alleles[0] !=
string(
"000") && tmp_alleles[1] !=
string(
"000"))
virtual void read(std::istream &is, DataSet &data_set)=0
Read a DataSet on istream.
The BasicAlleleInfo class.
void initAnalyzedLoci(size_t numberOfLoci)
Initialize the AnalyzedLoci for number of loci.
void setGroupName(size_t group_id, const std::string &group_name) const
set the name of a Group.
void setLocusInfo(size_t locus_position, const LocusInfo &locus)
Set a LocusInfo.
void setIndividualMonolocusGenotypeByAlleleIdInGroup(size_t groupPosition, size_t individualPosition, size_t locusPosition, const std::vector< std::string > alleleId)
Set a MonolocusGenotype of an Individual from a group.
void addEmptyIndividualToGroup(size_t groupPosition, const std::string &individual_id)
Add an empty Individual to a Group.
void initIndividualGenotypeInGroup(size_t groupPosition, size_t individualPosition)
Initialize the genotype of an Individual in a Group.
void addEmptyGroup(size_t group_id)
Add an empty Group to the DataSet.
void read(std::istream &is, DataSet &data_set)
Read a DataSet on istream.
void addAlleleInfo(const AlleleInfo &allele)
Add an AlleleInfo to the LocusInfo.
const std::string & nextToken()
std::string removeSurroundingWhiteSpaces(const std::string &s)
std::string toString(T t)