Skip to content

Commit

Permalink
variant parsing for new VRS 2 location format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudis committed Aug 13, 2024
1 parent 5b396b5 commit 87f9df9
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/pages/variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,24 @@ function Variant({ variant, id, datasetIds }) {
console.log(locations)

locations.forEach(function (loc) {
if (loc.sequence_id) {
const chro = refseq2chro(loc.sequence_id)
if (loc.sequenceReference) {
const chro = refseq2chro(loc.sequenceReference)
chros.push(chro)
const i = loc.interval
const m = chro + ":" + i?.start?.value + "-" + i?.end.value
const l = "chr" + chro + " (" + i?.start?.value + "-" + i?.end.value + ")"
var start = 0
var end = 1
// TODO: This is a slightly ugly deparsing of the "evolving" VRS v2 options
if (loc.start && loc.end) {
start = loc.start
end = loc.end
} else if (loc.start) {
start = loc.start[0]
end = loc.start[1]
} else if (loc.end) {
start = loc.end[0]
end = loc.end[1]
}
const m = chro + ":" + start + "-" + end
const l = "chr" + chro + " (" + start + "-" + end + ")"
markers.push(m + ":" + l)
}
});
Expand Down

0 comments on commit 87f9df9

Please sign in to comment.