Skip to content

Commit

Permalink
added helpers files & fixed looping issue in dbslmmfit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
fboehm committed Apr 20, 2022
1 parent 6ce4e7e commit 1dece55
Show file tree
Hide file tree
Showing 5 changed files with 289 additions and 235 deletions.
4 changes: 2 additions & 2 deletions scr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ARMALIB = /net/mulan/home/yasheng/Cpp/arma/lib
# Put C++ complier
CXX = g++
#CXX = clang++-11
CPP_FILES = main_dbslmm.cpp dtpr.cpp dbslmm.cpp dbslmmfit.cpp calc_asymptotic_variance.cpp subset_to_test_and_training.cpp
HPP_FILES = dtpr.hpp dbslmm.hpp dbslmmfit.hpp calc_asymptotic_variance.hpp subset_to_test_and_training.hpp
CPP_FILES = main_dbslmm.cpp dtpr.cpp dbslmm.cpp dbslmmfit.cpp calc_asymptotic_variance.cpp subset_to_test_and_training.cpp helpers.cpp
HPP_FILES = dtpr.hpp dbslmm.hpp dbslmmfit.hpp calc_asymptotic_variance.hpp subset_to_test_and_training.hpp helpers.hpp



Expand Down
9 changes: 6 additions & 3 deletions scr/dbslmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,16 @@ void DBSLMM::BatchRun(PARAM &cPar) {
std::vector <std::string> base_nums = readTestBim(cPar.dat_str + ".bim");
//
vector<POS> test_inter_s = makePosObjectForTestBim(base_nums, inter_s);

cout << "test_inter_s[1].snp: " << test_inter_s[1].snp << endl;
cout << "test_inter_s[1].pos: " << test_inter_s[1].pos << endl;
cout << "test_inter_s[1].ps: " << test_inter_s[1].ps << endl;
vector <INFO> info_s;
vector <INFO> test_info_s;

int num_block_s = cSP.addBlock(inter_s, block_dat, info_s); //addBlock is defined in scr/dtpr.cpp & populates info_s
int test_num_block_s = cSP.addBlock(test_inter_s, block_dat, test_info_s); //addBlock is defined in scr/dtpr.cpp & populates info_s

cout << "test_num_block_s: " << test_num_block_s << endl;
cout << "test_info_s[1].pos: " << test_info_s[1].pos << endl;

// output samll effect badsnps
string badsnps_str = cPar.eff + ".badsnps";
Expand Down Expand Up @@ -341,7 +344,7 @@ void DBSLMM::BatchRun(PARAM &cPar) {
eff_s,
eff_l,
test_indicator,
cPar.dat_str,
cPar.dat_str, //no file ending, like ".bed" or ".bim"
test_info_s,
test_info_l);
double time_fitting = cIO.getWalltime() - t_fitting;
Expand Down
Loading

0 comments on commit 1dece55

Please sign in to comment.