biolink / ontobio

python library for working with ontologies and ontology associations
https://ontobio.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
119 stars 30 forks source link

adding version option to convert subcommand in ontobio-parse-assocs #495

Closed dougli1sqrd closed 3 years ago

dougli1sqrd commented 3 years ago

For https://github.com/biolink/ontobio/issues/494

kltm commented 3 years ago

@dougli1sqrd Shouldn't there be a choice of GAF and GAF 2.2? And I guess GPAD/GPI is always assumed to be "2.0", but adding versions the right way now might make it easier when the inevitable increment comes. Looks good to me, assuming the underlying system can deal with it.

dougli1sqrd commented 3 years ago

For invalid versions, the default for each writer/parser is used if a weird value.

kltm commented 3 years ago

@dougli1sqrd Right, but specifically for our use case, don't we need to be able to actively toggle between GAF 2.1 and GAF 2.2? What -t flag is used?

dougli1sqrd commented 3 years ago

Yeah, so if you do ontobio-parse-assocs.py -F gaf -f mgi.gaf -o mgi.gpad convert -t gpad -v 2.0 you'll take your mgi.gaf gaf and convert it into a gpad 2.0. If you supply something wacky for -v it'll just use 1.2, since that's the default for GPAD.

And if you want GAF whichever, ontobio-parse-assocs.py -F gaf -f mgi.gaf -o mgi.gpad convert -t gaf -v 2.1 to conver to GAF 2.1, etc.

kltm commented 3 years ago

@dougli1sqrd Aaaahhhh--I didn't realize that format and version were separate. Nevermind!

kltm commented 3 years ago

(I would note though, that -v and --version are usually reserved for software introspection; e.g. https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html)

dougli1sqrd commented 3 years ago

I did think about that, but I couldn't think of a better letter ha. I can make something up tho that's maybe better than v

kltm commented 3 years ago

revision, version number? What I was assuming, and why it was easy to not see what you were doing, is that I was expecting something like: gaf, gaf2.1, gaf2.2, or the like. I'm thinking of things like pandoc:

sjcarbon@moiraine:~/local/src/git/ontobio[gocamgen]$:) pandoc --list-output-formats
...
docbook
docbook5
...
epub
epub3
fb2
haddock
html
html5
...
markdown
markdown_github
markdown_mmd
markdown_phpextra
markdown_strict
...
kltm commented 3 years ago

Of course, if this is what we've been doing, we can continue for now--we don't want to derail on what we already have.