aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2025-12-01 11:23:04 +0100
committerPjotr Prins2025-12-01 11:23:04 +0100
commit32a5367f0a0a00bec7e610b74abc899521a75fa5 (patch)
treee0e74b3499d1ec270e95f2fc7142d0ede1a30675
parent02149fb38d05b14f74caa458741b1512bbf6a8d5 (diff)
downloadpangemma-32a5367f0a0a00bec7e610b74abc899521a75fa5.tar.gz
Almost ready to run GWA
-rw-r--r--src/gemma.cpp3
-rw-r--r--src/gemma.h1
-rw-r--r--src/param.cpp11
-rw-r--r--src/param.h1
4 files changed, 12 insertions, 4 deletions
diff --git a/src/gemma.cpp b/src/gemma.cpp
index 0145563..69e338a 100644
--- a/src/gemma.cpp
+++ b/src/gemma.cpp
@@ -1911,7 +1911,8 @@ void GEMMA::BatchRun(PARAM &cPar) {
}
// Generate Kinship matrix (optionally using LOCO)
- if (cPar.a_mode == M_KIN || cPar.a_mode == M_KIN2) {
+ // if (cPar.a_mode == M_KIN || cPar.a_mode == M_KIN2) {
+ if (is_kinship_compute(cPar.a_mode)) {
cout << "Calculating Relatedness Matrix ... " << endl;
if (cPar.is_mdb) {
diff --git a/src/gemma.h b/src/gemma.h
index b34a958..fa7c24d 100644
--- a/src/gemma.h
+++ b/src/gemma.h
@@ -64,6 +64,7 @@ public:
void Assign(int argc, char **argv, PARAM &cPar);
void BatchRun(PARAM &cPar);
void WriteLog(int argc, char **argv, PARAM &cPar);
+ inline bool is_kinship_compute(uint a_mode) { return (a_mode == M_KIN || a_mode == M_KIN2); }
};
#endif
diff --git a/src/param.cpp b/src/param.cpp
index a81d18f..45904cd 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -227,8 +227,6 @@ void PARAM::ReadFiles(void) {
indicator_idv.push_back(k);
}
- ns_test = 0; // number of snps to test
-
return;
}
@@ -339,7 +337,14 @@ void PARAM::ReadFiles(void) {
}
// lmdb-type genotype file:
if (is_mdb && !file_geno.empty()) {
- ns_total = indicator_snp.size();
+ if (!file_kin.empty()) { // GWA
+ // Phenotype file before genotype file. Already done this(?!)
+ if (ReadFile_pheno(file_pheno, indicator_pheno, pheno, p_column) == false) {
+ error = true;
+ }
+ ProcessInclusionIndicators();
+ ns_total = indicator_snp.size();
+ }
}
// Read genotype file for multiple PLINK files.
diff --git a/src/param.h b/src/param.h
index 36c9a9f..046f543 100644
--- a/src/param.h
+++ b/src/param.h
@@ -371,6 +371,7 @@ public:
void UpdateSNP(const map<string, double> &mapRS2wA);
inline bool is_loco() { return !loco.empty(); }
+
};
size_t GetabIndex(const size_t a, const size_t b, const size_t n_cvt);