Skip to content

Commit

Permalink
renamed getDlocus function
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemussmann committed Aug 4, 2018
1 parent fecb330 commit 536e1ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
13 changes: 1 addition & 12 deletions fnFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fnFiles::fnFiles(std::string i, std::string p, std::string abcd, int vectorsize)

}

std::unordered_map <std::string,int> fnFiles::getOutgroupLocus(int i)
std::unordered_map <std::string,int> fnFiles::getDLocus(int i)
{
return data["D"][i];
}
Expand Down Expand Up @@ -74,17 +74,6 @@ unsigned int fnFiles::getLength()
}

return now;
/*
if(data["A"].size() == data["B"].size() && data["B"].size() == data["C"].size() && data["C"].size() == data["D"].size())
{
return data["A"].size();
}
else
{
std::cerr << "Vectors holding data for taxa A,B,C, and D are different lengths." << std::endl;
exit(EXIT_FAILURE);
}
*/
}

void fnFiles::readfiles()
Expand Down
6 changes: 1 addition & 5 deletions fnFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class fnFiles {
fnFiles(std::string i, std::string p, std::string a, int vectorsize);
void readfiles();
unsigned int getLength();
std::unordered_map <std::string,int> getOutgroupLocus(int i);
std::unordered_map <std::string,int> getDLocus(int i);
std::unordered_map <std::string,int> getALocus(int i);
std::unordered_map <std::string,int> getBLocus(int i);
std::unordered_map <std::string,int> getCLocus(int i);
Expand All @@ -27,10 +27,6 @@ class fnFiles {
std::unordered_map<std::string,std::vector<std::unordered_map<std::string,int > > > data;
std::unordered_map <std::string,std::string> popmap;
std::unordered_map <std::string,std::string> ABCDmap;
std::vector<std::unordered_map <std::string,int> > A;
std::vector<std::unordered_map <std::string,int> > B;
std::vector<std::unordered_map <std::string,int> > C;
std::vector<std::unordered_map <std::string,int> > D;
std::string iupac(std::string ambig);
};

Expand Down
6 changes: 3 additions & 3 deletions fnStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void fnStats::findAncestral(fnFiles &f)
{
for(unsigned int i=0; i<ancestral.size(); i++)
{
std::unordered_map<std::string,int> l = f.getOutgroupLocus(i); //get locus for outgroup
std::unordered_map<std::string,int> l = f.getDLocus(i); //get locus for outgroup
std::unordered_map<std::string,int>::iterator it = l.begin(); //start iterator
ancestral[i] = it->first; //if only one allele, set it as ancestral state.
}
Expand Down Expand Up @@ -221,7 +221,7 @@ void fnStats::calcDFreqs(fnFiles &f)
for(unsigned int i=0; i<Dfreqs.size(); i++)
{
int total = 0;
std::unordered_map<std::string,int> l = f.getOutgroupLocus(i);
std::unordered_map<std::string,int> l = f.getDLocus(i);
std::unordered_map<std::string,int>::iterator it = l.begin();
while(it != l.end())
{
Expand Down Expand Up @@ -276,7 +276,7 @@ void fnStats::calcFstats(fnFiles &f)
std::unordered_map<std::string,int> al = f.getALocus(i);
std::unordered_map<std::string,int> bl = f.getBLocus(i);
std::unordered_map<std::string,int> cl = f.getCLocus(i);
std::unordered_map<std::string,int> dl = f.getOutgroupLocus(i);
std::unordered_map<std::string,int> dl = f.getDLocus(i);

//initialize iterators
std::unordered_map<std::string,int>::iterator ait = al.begin();
Expand Down

0 comments on commit 536e1ad

Please sign in to comment.