diff options
| author | Pjotr Prins | 2025-12-03 07:44:08 +0100 |
|---|---|---|
| committer | Pjotr Prins | 2025-12-03 07:44:08 +0100 |
| commit | 47580692539267c03ced4315aa9868b7c999a693 (patch) | |
| tree | fba6633429a1fe55332194e1e0fdd70a544a3011 /src | |
| parent | a1e252bfc7fc874fb4c442288b4b33e232d5002e (diff) | |
| download | pangemma-47580692539267c03ced4315aa9868b7c999a693.tar.gz | |
Compiler warnings and some output for K
Diffstat (limited to 'src')
| -rw-r--r-- | src/gemma_io.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gemma_io.cpp b/src/gemma_io.cpp index 959e1f5..08f25ca 100644 --- a/src/gemma_io.cpp +++ b/src/gemma_io.cpp @@ -657,7 +657,7 @@ std::tuple<size_t, size_t, size_t> compute_ratio(size_t ni_total, const gsl_vect size_t n_0 = 0; size_t n_1 = 0; size_t n_2 = 0; - for (int i = 0; i < ni_total; ++i) { // read genotypes + for (size_t i = 0; i < ni_total; ++i) { // read genotypes double geno = gsl_vector_get(gs, i); if (geno >= 0 && geno <= 0.5) { n_0++; @@ -675,7 +675,7 @@ std::tuple<size_t, size_t, size_t> compute_ratio(size_t ni_total, const gsl_vect double compute_maf(size_t ni_total, size_t ni_test, size_t n_miss, const gsl_vector *gs) { double maf = 0.0; - for (int i = 0; i < ni_total; ++i) { // read genotypes + for (size_t i = 0; i < ni_total; ++i) { // read genotypes double geno = gsl_vector_get(gs, i); maf += geno; } @@ -1543,7 +1543,7 @@ gsl_matrix *mdb_calc_kin(const string file_geno, bool is_loco, const int k_mode) MDB_stat stat; mdb_stat(rtxn, geno_mdb, &stat); - cout << "Number of records: " << stat.ms_entries << endl; + // cout << "Number of records: " << stat.ms_entries << endl; num_markers = stat.ms_entries; gsl_matrix *matrix_kin = gsl_matrix_safe_alloc(ni_total,ni_total); @@ -1564,6 +1564,10 @@ gsl_matrix *mdb_calc_kin(const string file_geno, bool is_loco, const int k_mode) size_t ns_test = 0; size_t display_pace = 1000; + cout << "## number of total individuals = " << ni_total << endl; + cout << "## number of analyzed individuals = " << ni_total << endl; + cout << "## number of analyzed SNPs/var = " << num_markers << endl; + auto cursor = lmdb::cursor::open(rtxn, geno_mdb); auto mdb_fetch = MDB_FIRST; @@ -1579,8 +1583,10 @@ gsl_matrix *mdb_calc_kin(const string file_geno, bool is_loco, const int k_mode) if (indicator_snp[t] == 0) continue; */ +#if !defined NDEBUG size_t num_floats = value.size() / sizeof(float); assert(num_floats == ni_total); +#endif const float* gs = reinterpret_cast<const float*>(value.data()); size_t n_miss = 0; double geno_mean = 0.0; |
