Closed anshumanmohan closed 1 year ago
Today I discovered that odgi build
dies if you try to name a segment non-numerically.
Graph:
S a AAAA
S 2 TTTT
S 3 GGGG
S 4 CCCC
Error:
terminate called after throwing an instance of 'std::invalid_argument'
what(): stol
Aborted (core dumped)
Wow, how about that! Good to know. So maybe we shouldn't bother doing anything about this?
Yeah I think so. At least for now, while odgi is the oracle and odgi functionality is the target, I think this issue is moot. If/when we decide to graduate from odgi-style commands and allow pangenome-ey commands more generally, we could revisit this.
It doesn't seem like segment names are guaranteed to be numbers in the GFA format. They are in all the examples we're familiar with, but it seems to me like the format defines them to be arbitrary strings (which is why we store them as
str
s and notint
s). Therefore:int(seg.name)
is not guaranteed to succeedstr(int(seg.name) + 1)
is not guaranteed to be uniqueLonger term, we probably want to generate a "fresh" name by looking at all the existing names and generating one that is actually guaranteed to be unused. Or perhaps we want to use some kind if internal numeric ID space, which we then map back to strings. Anyway, plenty of options here!
_Originally posted by @sampsyo in https://github.com/cucapra/pollen/pull/51#discussion_r1170651606_