Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ multitrait branch:
internally, split baselineOffset into a "from substitutions" component and a "from user" component, and expose those components in .trees metadata, to fix #661
the top-level JSON schema now has two keys, baselineOffsetFromUser and baselineOffsetFromSubstitutions, that provide these two components
SLiM writes both of them, for use on the Python side; when reading a .trees, SLiM uses baselineOffsetFromUser and ignores baselineOffsetFromSubstitutions (calculating that itself)
shift to putting binary derived state info in the mutation table metadata, in addition to the ASCII derived state info in its own column, when on disk (i.e., in .trees files); see #664
however, we do not rely on the derived state being anything when reading in a .trees file
in-memory, the binary derived state info remains in the derived state column and the mutation table metadata is kept empty, as before
the schema for the mutation table metadata now encodes an array (of length determined by the metadata itself) of int64_t SLiM mutation IDs
Comment thread
bhaller marked this conversation as resolved.


version 5.2 (Eidos version 4.2):
Expand Down
34 changes: 33 additions & 1 deletion core/slim_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,39 @@ const std::string gSLiM_tsk_metadata_binary_schema_FORMAT_SOURCE = R"V0G0N({

const std::string gSLiM_tsk_edge_metadata_schema_SOURCE = "";
const std::string gSLiM_tsk_site_metadata_schema_SOURCE = "";
const std::string gSLiM_tsk_mutation_metadata_schema_SOURCE = ""; // this is now managed by gSLiM_tsk_metadata_binary_schema in top-level metadata

// actual mutation metadata is now kept in the top-level metadata; see gSLiM_tsk_metadata_binary_schema
// the mutation metadata column now (on disk only) contains binary derived state info, in addition to the
// ASCII info kept in the derived state column; see DerivedStatesFromMetadata() and DerivedStatesToMetadata()
#pragma mark gSLiM_tsk_mutation_metadata_schema_SOURCE

const std::string gSLiM_tsk_mutation_metadata_schema_SOURCE = R"V0G0N({
"$schema": "http://json-schema.org/schema#",
"additionalProperties": false,
"codec": "struct",
"type": "object",
"description": "SLiM schema for representing binary derived state data in mutation metadata (the metadata for each unique SLiM mutation is stored in top-level metadata).",
"examples": [
{
"derived_states": [0, 1, 17]
}
],
"properties": {
"derived_states": {
"index": 1,
"type": "array",
"noLengthEncodingExhaustBuffer": true,
"description": "An array of SLiM mutation IDs (int64t), representing the (stacked) mutations contained by the derived state for the mutation.",
"items": {
"binaryFormat": "q",
Comment thread
bhaller marked this conversation as resolved.
"type": "number"
}
}
},
"required": [
"derived_states"
]
})V0G0N";

// BCH 12/10/2024: Removed the type field, and changed the treatment of is_vacant. We have a tricky problem
// here, which is that is_vacant is now variable-length and there is no count. The number of byte (uint8_t)
Expand Down
Loading
Loading