diff options
Diffstat (limited to 'src/lmm.h')
-rw-r--r-- | src/lmm.h | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -1,6 +1,8 @@ /* Genome-wide Efficient Mixed Model Association (GEMMA) - Copyright (C) 2011-2017, Xiang Zhou + Copyright © 2011-2017, Xiang Zhou + Copyright © 2017, Peter Carbonetto + Copyright © 2017, Pjotr Prins This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,10 +25,12 @@ #include "gsl/gsl_vector.h" #include "io.h" #include "param.h" +#include <functional> +#include <tuple> using namespace std; -#define LMM_BATCH_SIZE 10000 // used for batch processing +#define LMM_BATCH_SIZE 20000 // used for batch processing class FUNC_PARAM { @@ -40,6 +44,8 @@ public: size_t e_mode; }; +typedef std::tuple<string,std::vector<double> > SnpNameValues; + class LMM { public: @@ -53,8 +59,6 @@ public: string path_out; string file_gene; - // WJA added - string file_oxford; // LMM related parameters double l_min; @@ -91,17 +95,19 @@ public: void AnalyzeGene(const gsl_matrix *U, const gsl_vector *eval, const gsl_matrix *UtW, const gsl_vector *Utx, const gsl_matrix *W, const gsl_vector *x); - void AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval, - const gsl_matrix *UtW, const gsl_vector *Uty, - const gsl_matrix *W, const gsl_vector *y); - // WJA added. - void Analyzebgen(const gsl_matrix *U, const gsl_vector *eval, - const gsl_matrix *UtW, const gsl_vector *Uty, - const gsl_matrix *W, const gsl_vector *y); + void Analyze(std::function< SnpNameValues(size_t) >& fetch_snp, + const gsl_matrix *U, const gsl_vector *eval, + const gsl_matrix *UtW, const gsl_vector *Uty, + const gsl_matrix *W, const gsl_vector *y, + const set<string> gwasnps); void AnalyzeBimbam(const gsl_matrix *U, const gsl_vector *eval, const gsl_matrix *UtW, const gsl_vector *Uty, const gsl_matrix *W, const gsl_vector *y, const set<string> gwasnps); + void AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval, + const gsl_matrix *UtW, const gsl_vector *Uty, + const gsl_matrix *W, const gsl_vector *y, + const set<string> gwasnps); void AnalyzePlinkGXE(const gsl_matrix *U, const gsl_vector *eval, const gsl_matrix *UtW, const gsl_vector *Uty, const gsl_matrix *W, const gsl_vector *y, |