about summary refs log tree commit diff
path: root/src/lmm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lmm.h')
-rw-r--r--src/lmm.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/lmm.h b/src/lmm.h
index 4d57ab1..9c46fae 100644
--- a/src/lmm.h
+++ b/src/lmm.h
@@ -23,10 +23,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 +42,8 @@ public:
   size_t e_mode;
 };
 
+typedef std::tuple<string,std::vector<double> > SnpNameValues;
+
 class LMM {
 
 public:
@@ -53,8 +57,6 @@ public:
   string path_out;
 
   string file_gene;
-  // WJA added
-  string file_oxford;
 
   // LMM related parameters
   double l_min;
@@ -91,17 +93,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,