You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (top_level_binary_length % binary_row_length != 0)
10199
-
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the top-level binary metadata does not comprise an integral number of rows (binary_row_length == " << binary_row_length << ", top_level_binary_length == " << top_level_binary_length << "); this file cannot be read." << EidosTerminate();
10200
-
10201
-
// pass information on the binary mutation metadata table back to the caller
if (mutation_table_row_count != p_mut_metadata_table.row_count)
10207
-
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the top-level binary metadata's specified row count ( " << mutation_table_row_count << ") does not match the number of rows of data present (" << p_mut_metadata_table.row_count << "); this file cannot be read." << EidosTerminate();
// The "chromosomes" key is optional, but if provided, it has to make sense
10310
10286
if (top_level_json["SLiM"].contains("chromosomes"))
10311
10287
{
10312
-
chomosomes_key_present = true;
10313
-
10314
10288
// We validate the whole "chromosomes" key against the whole model, to make sure everything is as expected
10315
10289
auto &chromosomes_metadata = top_level_json["SLiM"]["chromosomes"];
10316
10290
10317
10291
if (!chromosomes_metadata.is_array())
10292
+
{
10318
10293
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the 'chromosomes' metadata key must be an array." << std::endl;
10294
+
goto noChromosomesKey;
10295
+
}
10296
+
10319
10297
if (chromosomes_metadata.size() != Chromosomes().size())
10320
-
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the number of entries in the 'chromosomes' metadata key does not match the number of chromosomes in the model." << std::endl;
10298
+
{
10299
+
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the number of entries in the 'chromosomes' metadata key (" << chromosomes_metadata.size() << ") does not match the number of chromosomes in the model (" << Chromosomes().size() << "). (The 'chromosomes' metadata key will be ignored.)" << std::endl;
10300
+
goto noChromosomesKey;
10301
+
}
10302
+
10303
+
chomosomes_key_present = true;
10321
10304
10322
10305
for (std::size_t chromosomes_index = 0; chromosomes_index < Chromosomes().size(); ++chromosomes_index)
if (one_chromosome_type != chromosome->TypeString())
10343
10326
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the type for the entry at index " << chromosomes_index << " in the 'chromosomes' metadata key does not match the corresponding chromosome in the model." << std::endl;
10344
10327
}
10328
+
10329
+
noChromosomesKey:
10330
+
;
10345
10331
}
10346
10332
10347
10333
// The new "traits" key is required, and we need to check its contents
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the 'traits' metadata key must be an array." << std::endl;
10352
10338
if (traits_metadata.size() != Traits().size())
10353
-
SLIM_ERRSTREAM << "#WARNING (Species::ReadTreeSequenceMetadata): the number of entries in the 'traits' metadata key does not match the number of traits in the model." << std::endl;
10339
+
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the number of entries in the 'traits' metadata key (" << traits_metadata.size() << ") does not match the number of traits in the model (" << Traits().size() << ")." << EidosTerminate();
10354
10340
10355
10341
for (size_t traits_index = 0; traits_index < Traits().size(); ++traits_index)
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the chromosome index provided in the 'this_chromosome' key (" << this_chromosome_index << ") does not match the index (" << (unsigned int)(chromosome->Index()) << ") of the corresponding chromosome in the model." << EidosTerminate();
10525
10511
}
10512
+
10513
+
// Now that we know we're in sync with the file contents (same number of traits, etc.), check the mutation metadata table
if (top_level_binary_length % binary_row_length != 0)
10524
+
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the top-level binary metadata does not comprise an integral number of rows (binary_row_length == " << binary_row_length << ", top_level_binary_length == " << top_level_binary_length << "); this file cannot be read. (Was all mutation metadata generated with the correct schema?)" << EidosTerminate();
10525
+
10526
+
// pass information on the binary mutation metadata table back to the caller
if (mutation_table_row_count != p_mut_metadata_table.row_count)
10532
+
EIDOS_TERMINATION << "ERROR (Species::ReadTreeSequenceMetadata): the top-level binary metadata's specified row count ( " << mutation_table_row_count << ") does not match the number of rows of data present (" << p_mut_metadata_table.row_count << "); this file cannot be read. (Do you need to run pyslim.add_mutation_metadata()?)" << EidosTerminate();
0 commit comments