about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2025-12-03 12:58:18 +0100
committerPjotr Prins2025-12-03 12:58:18 +0100
commita26c84fd897f8ec11e6d35034de91c4da74290bf (patch)
tree3ccb36b8c0d254f84f9eb1eb983388ed3c6f9db7
parent731b7b758cda5edea1666dbbf577b4b65861a55c (diff)
downloadpangemma-a26c84fd897f8ec11e6d35034de91c4da74290bf.tar.gz
Working on output
-rw-r--r--src/lmm.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lmm.cpp b/src/lmm.cpp
index 8a57885..9a1d318 100644
--- a/src/lmm.cpp
+++ b/src/lmm.cpp
@@ -1879,6 +1879,7 @@ void LMM::Analyze(std::function< SnpNameValues(size_t) >& fetch_snp,
 // Results for LMM.
 class SUMSTAT2 {
 public:
+  string marker;
   double beta;         // REML estimator for beta.
   double se;           // SE for beta.
   double lambda_remle; // REML estimator for lambda.
@@ -2003,9 +2004,9 @@ void LMM::mdb_analyze(std::function< SnpNameValues2(size_t) >& fetch_snp,
       time_opt += (clock() - time_start) / (double(CLOCKS_PER_SEC) * 60.0);
 
       // Store summary data.
-      SUMSTAT2 marker = {beta,   se,    lambda_remle, lambda_mle,
+      SUMSTAT2 st = {marker, beta,   se,    lambda_remle, lambda_mle,
                       p_wald, p_lrt, p_score, logl_H1};
-      sumstat2.push_back(marker);
+      sumstat2.push_back(st);
     }
   };
 
@@ -2079,7 +2080,7 @@ void LMM::mdb_analyze(std::function< SnpNameValues2(size_t) >& fetch_snp,
     // copy genotype values for SNP into Xlarge cache
     gsl_vector_view Xlarge_col = gsl_matrix_column(Xlarge, c % msize);
     gsl_vector_safe_memcpy(&Xlarge_col.vector, x);
-    c++; // count SNPs going in
+    c++; // count markers going in
 
     if (c % msize == 0) {
       batch_compute(msize);
@@ -2108,6 +2109,7 @@ void LMM::mdb_analyze(std::function< SnpNameValues2(size_t) >& fetch_snp,
   auto sumstats = [&] (SUMSTAT2 st) {
     outfile << scientific << setprecision(6);
 
+    outfile << st.marker << "\t";
     if (a_mode != M_LMM2) {
       outfile << st.beta << "\t";
       outfile << st.se << "\t";