ga4gh / ga4gh/vrs-clojure

Mismatch in serialization causing digest mismatches

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Given this SequenceLocation:

```json
{
"type": "SequenceLocation",
"sequence_id": "ga4gh:SQ.7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ",
"start": {
"type": "IndefiniteRange",
"value": 49529759,
"comparator": "<="
},
"end": {
"type": "IndefiniteRange",
"value": 50759410,
"comparator": ">="
}
}
```

vrs-clojure's `vrs.digest/ga4gh_serialize`
```clojure
(-> {#_#_"id" "ga4gh:SL.J7j3XXkFUcTBYPrtX7x3Bw_vDBe638yc",
"type" "SequenceLocation",
"sequence_id" "ga4gh:SQ.7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ",
"start" {"type" "IndefiniteRange", "value" 49529759, "comparator" "<="},
"end" {"type" "IndefiniteRange", "value" 50759410, "comparator" ">="}}
digest/ga4gh_serialize
println)
```
output:
`{"end":{"type":"IndefiniteRange","value":50759410,"comparator":">="},"sequence_id":"7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ","start":{"type":"IndefiniteRange","value":49529759,"comparator":"<="},"type":"SequenceLocation"}`

vrs-python's `ga4gh.core._internal.identifiers.ga4gh_serialize`:
```python
location=models.SequenceLocation(
sequence_id="ga4gh:SQ.7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ",
start=models.IndefiniteRange(
value=49529759,
comparator="<="),
end=models.IndefiniteRange(
value=50759410,
comparator=">="))
print(str(identifiers.ga4gh_serialize(location), "UTF-8"))
```
output:
`{"end":{"comparator":">=","type":"IndefiniteRange","value":50759410},"sequence_id":"7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ","start":{"comparator":"<=","type":"IndefiniteRange","value":49529759},"type":"SequenceLocation"}`

We can see that vrs-clojure is not ordering the fields within `start` and `end`, they should be `["comparator", "type", "value"]`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.