From a26c84fd897f8ec11e6d35034de91c4da74290bf Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 3 Dec 2025 12:58:18 +0100 Subject: Working on output --- src/lmm.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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"; -- cgit 1.4.1