-
Notifications
You must be signed in to change notification settings - Fork 34
Command Line Examples
Here are some examples of how to use owltools
You can list all owltools commands like this:
owltools -h
to get help on a specific command:
owltools COMMAND -h
Each command has its own sub-options and grammar
to get help on a command-specific option:
owltools COMMAND OPTION -h
ORDER IS IMPORTANT! Command line options are processed in order. This is quite unusual, but it allows for powerful sequential chaining of commands.
A detailed understanding of the OWLTools model is not required. However, some understanding of the central OWLGraphWrapper class helps. An instance of this class holds a pointer to a single source OWLOntology and zero to many support OWLOntologies. Each OWLOntology can itself wrap multiple OWL ontologies via an imports closure. However, support ontologies are not formally connected in any way.
When the command line is processed, if an argument is not recognized as a command, then it is treated as an ontology. The first ontology encountered is loaded as the source ontology. Subsequent ones are added to the list of support ontologies. These can be mashed and merged via various commands.
owltools cl.obo --ancestors neuron
Same thing, over the web:
owltools http://purl.obolibrary.org/obo/cl.owl --ancestors neuron
Same thing, using ID:
owltools cl.obo --ancestors CL:0000540
Same thing, using official obo-foundry URI:
owltools cl.obo --ancestors http://purl.obolibrary.org/obo/CL_0000540
For an explanation of what is meant by ancestor, see owltools.graph
Example output:
...
CL:0000540 "neuron" [CL:0000393 "electrically responsive cell"
CL:0000540 "neuron" [SUBCLASS_OF](SUBCLASS_OF]/1)/1 CL:0002319 "neural cell"
CL:0000540 "neuron" ["develops_from" SOME](RO:0002202)/5 ObjectSomeValuesFrom(BFO:0000050 "part_of" UBERON:0001017 "central nervous system")
...
i.e. their is a path of length 5 between "neuron" and CNS, and the relationship is that every neuron is a develops_from some part_of some CNS
owltools go.obo --save-closure-for-chado go.inf
This merges multiple ontologies into cl:
owltools cl.obo pro.obo go.obo --merge-support-ontologies -o cl-merged.owl
Save it:
owltools uberon.owl --save-closure -c uberon.closure
Use the cached closure:
owltools uberon.owl --read-closure uberon.closure -a digit
(note the closure must be read AFTER the ontology is loaded)
Basic report:
owltools uberon.owl --reasoner hermit --run-reasoner
Assert implied links:
owltools uberon.owl --reasoner hermit --run-reasoner --assert-implied
Attempt to check asserted links, see if we can re-infer them (ADVANCED):
owltools go.obo go_xp_chebi.obo chebi.obo --stash-subclasses --merge-support-ontologies --reasoner hermit --run-reasoner --assert-implied
Note the stashing has to be done before merging - only the source ontology axioms are stashed
All brain parts:
owltools uberon.owl --reasoner-query -r elk 'BFO_0000050 some UBERON_0000955'
Note that Elk does not allow reasoner queries over class expressions. If the reasoner is Elk, then a temp query class is created equivalent to the query class expression prior to reasoning. This can be explicitly set by the "-m" option. See Queries for more details.