about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2025-11-20 11:05:57 +0100
committerPjotr Prins2025-11-20 11:05:57 +0100
commit7f1be7fc3cf51cc7c3b37b88b808c44f2fbf1add (patch)
treed85404f454a2af9eb5cb907881da245ea77a7371
parent3165580c4038cbf6bcd5798bbf541557581430e2 (diff)
downloadpangemma-7f1be7fc3cf51cc7c3b37b88b808c44f2fbf1add.tar.gz
Comments HEAD master
-rw-r--r--README.md2
-rw-r--r--doc/code/pangemma.md4
-rw-r--r--guix.scm3
-rw-r--r--src/checkpoint.h8
-rw-r--r--src/debug.cpp2
-rw-r--r--src/gemma.cpp8
-rw-r--r--src/gemma_io.cpp2
-rw-r--r--src/lmm.cpp3
8 files changed, 26 insertions, 6 deletions
diff --git a/README.md b/README.md
index b5dc7f0..2369f4e 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ This repository is used to rewrite and modernize the original GEMMA tool. The id
 GEMMA is the original software toolkit for fast application of linear mixed models (LMMs) and related models to genome-wide association studies (GWAS) and other large-scale data sets. You can find the original code on [github](https://github.com/genetics-statistics/GEMMA). It may even build from this repo for the time being.
 
 NOTE: December 2024 main software development has moved to [PanGEMMA](https://git.genenetwork.org/pangemma/about/)!
-Pangemma is essentially a fork of GEMMA that is meant to scale up for pangenomics. We are also taking the opportunity to revamp the code base. GEMMA itself is in maintenance mode.
+Pangemma is essentially a fork of GEMMA that is meant to scale up for pangenomics. We are also taking the opportunity to revamp the code base. GEMMA itself is in *maintenance* mode.
 
 
 Check out [RELEASE-NOTES.md](./RELEASE-NOTES.md) to see what's new in each release.
diff --git a/doc/code/pangemma.md b/doc/code/pangemma.md
index 013816a..113b82c 100644
--- a/doc/code/pangemma.md
+++ b/doc/code/pangemma.md
@@ -189,7 +189,9 @@ we are talking message passing!
 
 OK, I have a confession to make. Reading Lisp code does not come that natural to me. I find writing Lisp easier than reading Lisp(!) Maybe it is because I have been reading Algol-type languages all my life, or maybe because Ruby is just a better fit to my brain. Where Lisp is definitely the greater language, I just find it harder to parse. Even my own code! I met Matz once and he told me that Ruby was known as Matz's own Lisp. So, there we are. I need the Ruby syntax oddities as little helpers to make my brain disentangle code.
 
-Ruby's REPL, however, is not that useful.
+## And again: why guile and not Ruby?
+
+Ruby's REPL is -- unfortunately -- not that useful.
 
 ## The art of message passing
 
diff --git a/guix.scm b/guix.scm
index a99d66c..1dff8b4 100644
--- a/guix.scm
+++ b/guix.scm
@@ -6,6 +6,9 @@
 ;; To get a development container (e.g., run in emacs shell).
 ;;
 ;;   guix shell -C -D -F -v 3 -L . pangemma-shell-git  # pangemma-shell-git
+;;
+;;   see premake5.lua header for examples.
+;;
 ;;   guix shell -C -D -F -v 3 -L . gemma-git           # for specific packages
 ;;
 
diff --git a/src/checkpoint.h b/src/checkpoint.h
index c2457d9..ae46361 100644
--- a/src/checkpoint.h
+++ b/src/checkpoint.h
@@ -26,6 +26,14 @@ using namespace std;
 
 extern string checkpoint_name;
 
+/*
+    Checkpoint functions display a message in debug mode when
+    reached. If the (unique) msg (tag) is equal to the global
+    checkpoint_name the program will stop. The idea is that we can
+    stop computation at any checkpoint. Later we can write the code to
+    restart at a checkpoint.
+ */
+
 void checkpoint_run(string msg, string filename, string srcfilename, int line, string funcname);
 
 #define checkpoint(msg, fname)						\
diff --git a/src/debug.cpp b/src/debug.cpp
index 0aa4bfc..b26e173 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -139,6 +139,7 @@ inline int fedisableexcept(unsigned int excepts)
 
 #endif
 
+/*
 void enable_segfpe() {
   if (!is_fpe_check_mode() || is_legacy_mode()) return;
   #ifdef __GNUC__
@@ -159,6 +160,7 @@ void disable_segfpe() {
     #endif
   #endif
 }
+*/
 
 void write(const char *s, const char *msg) {
   if (!is_debug_data_mode() && !is_debug_dump_mode()) return;
diff --git a/src/gemma.cpp b/src/gemma.cpp
index 6c2b3f4..63f952e 100644
--- a/src/gemma.cpp
+++ b/src/gemma.cpp
@@ -84,7 +84,7 @@ void gemma_gsl_error_handler (const char * reason,
 void GEMMA::PrintHeader(void) {
 
   cout <<
-    "GEMMA forked executable --- part of PanGEMMA " << version << " (" << date << ") by Xiang Zhou, Pjotr Prins and team (C) 2012-" << year << endl;
+    "Pangemma --- GEMMA 0.98.5 compatible executable " << version << " (" << date << ") by Xiang Zhou, Pjotr Prins and team (C) 2012-" << year << endl;
   return;
 }
 
@@ -1653,7 +1653,7 @@ void GEMMA::BatchRun(PARAM &cPar) {
   clock_t time_begin, time_start;
   time_begin = clock();
 
-  if (is_check_mode()) enable_segfpe(); // fast NaN checking by default
+  // if (is_check_mode()) enable_segfpe(); // fast NaN checking by default
 
   // Read Files.
   cout << "Reading Files ... " << endl;
@@ -1943,7 +1943,7 @@ void GEMMA::BatchRun(PARAM &cPar) {
     VARCOV cVarcov;
     cVarcov.CopyFromParam(cPar);
 
-    if (is_check_mode()) disable_segfpe(); // disable fast NaN checking for now
+    // if (is_check_mode()) disable_segfpe(); // disable fast NaN checking for now
 
     if (!cPar.file_bfile.empty()) {
       cVarcov.AnalyzePlink();
@@ -2058,7 +2058,7 @@ void GEMMA::BatchRun(PARAM &cPar) {
     VARCOV cVarcov;
     cVarcov.CopyFromParam(cPar);
 
-    if (is_check_mode()) disable_segfpe(); // fast NaN checking for now
+    // if (is_check_mode()) disable_segfpe(); // fast NaN checking for now
 
     if (!cPar.file_bfile.empty()) {
       cVarcov.AnalyzePlink();
diff --git a/src/gemma_io.cpp b/src/gemma_io.cpp
index f5a79a2..76f8a35 100644
--- a/src/gemma_io.cpp
+++ b/src/gemma_io.cpp
@@ -1431,6 +1431,7 @@ bool BimbamKin(const string file_geno, const set<string> ksnps,
   auto infilen = file_geno.c_str();
   igzstream infile(infilen, igzstream::in);
   enforce_msg(infilen, "error reading genotype file");
+  checkpoint("read-geno-file",file_geno);
 
   size_t n_miss;
   double geno_mean, geno_var;
@@ -1758,6 +1759,7 @@ bool ReadFile_geno(const string file_geno, vector<int> &indicator_idv,
     cout << "error reading genotype file:" << file_geno << endl;
     return false;
   }
+  checkpoint("read-geno-file",file_geno);
 
   string line;
   char *ch_ptr;
diff --git a/src/lmm.cpp b/src/lmm.cpp
index 85e92fe..ccf880a 100644
--- a/src/lmm.cpp
+++ b/src/lmm.cpp
@@ -44,6 +44,7 @@
 #include "gzstream.h"
 #include "gemma.h"
 #include "gemma_io.h"
+#include "checkpoint.h"
 #include "fastblas.h"
 #include "lapack.h"
 #include "lmm.h"
@@ -1663,6 +1664,7 @@ void LMM::AnalyzeBimbam(const gsl_matrix *U, const gsl_vector *eval,
                         const set<string> gwasnps) {
   debug_msg(file_geno);
   auto infilen = file_geno.c_str();
+  checkpoint("start-read-geno-file",file_geno);
 
   igzstream infile(infilen, igzstream::in);
   enforce_msg(infile, "error reading genotype file");
@@ -2291,6 +2293,7 @@ void LMM::AnalyzeBimbamGXE(const gsl_matrix *U, const gsl_vector *eval,
     cout << "error reading genotype file:" << file_geno << endl;
     return;
   }
+  checkpoint("start-read-geno-file",file_geno);
 
   clock_t time_start = clock();