Skip to content
Permalink
4e83412678
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
106 lines (88 sloc) 2.79 KB
/*
* UserDataSet.h
*
* Created on: March 22, 2017
* Author: Daniel
*/
#ifndef INDIVIDUAL_DATA_SET_H_
#define INDIVIDUAL_DATA_SET_H_
#include "GivenKinship.h"
#include <armadillo>
#include <list>
#include <functional>
#include "IndividualData.h"
#include "Option.h"
#include "SnpKinship.h"
//! A class to keep track of and reconcile IndividualData objects.
class IndividualDataSet
{
public:
void addingPedData();
void addPedData(std::string id, int pedId, std::vector<double>& pedData);
void addingPhenData();
void addPhenData(std::string id, std::vector<double>& phenData);
void addingQCovData();
void addQCovData(std::string id, std::vector<double>& qCovData);
void addingCCovData();
void addCCovData(std::string id, std::vector<double>& cCovData);
void addingChrData();
void setChrData(std::vector<int>& chrNew);
void settingGenoData();
void setGenoData(arma::mat& genoNew, std::vector<int> numMissingValues);
void setOption(Option &optionNew);
void reconcile();
int getNumSubjects();
bool getCovAdded();
arma::mat& getGeno();
std::vector<int>& getChr();
arma::mat& getAN();
arma::mat& getGrm(int idx);
arma::mat& getCov(int idx);
arma::mat& getPhen(int idx);
arma::mat& getGrmWithoutSplit(int idx);
arma::mat& getCovWithoutSplit(int idx);
arma::mat& getPhenWithoutSplit(int idx);
arma::mat& getPed();
std::vector< std::vector<std::string> >& getSplitPartIds();
std::list< std::reference_wrapper<IndividualData> >& getIndividualList();
std::map<std::string, IndividualData>& getIndividualMap();
private:
bool pregivenGrmAdded = false;
bool pedAdded = false;
int numPedCols = -1;
bool phenAdded = false;
int numPhenCols = -1;
bool qCovAdded = false;
int numQCovCols = -1;
bool cCovAdded = false;
int numCCovCols = -1;
bool chrAdded = false;
int numChrCols = -1;
bool genoAdded = false;
Option option;
SnpKinship snpKinship;
arma::mat grmInit;
arma::mat ped;
std::vector<arma::mat> phenSplit;
std::vector<arma::mat> phenWithoutSplit;
std::vector<arma::mat> covSplit;
std::vector<arma::mat> covWithoutSplit;
std::vector<arma::mat> grmSplit;
std::vector<arma::mat> grmWithoutSplit;
arma::mat phenFull;
arma::mat covFull;
arma::mat grmFull;
std::vector<int> chr;
arma::mat genoInit;
arma::mat geno;
std::map<std::string, IndividualData> individualDataIdMap;
std::list< std::reference_wrapper<IndividualData> > individualDataList;
std::vector< std::vector<std::string> > splitPartIds;
void addingPregivenGrm();
void addPregivenGrm(arma::mat& newGrm, std::vector<std::string>& grmIds);
void addIndividualIfNotAdded(std::string &id);
void createGeno();
void createMatrices(std::string type, std::vector<std::string>& idList, int splitId);
void createPed();
};
#endif /* INDIVIDUAL_DATA_SET_H_ */