obo2obo
The obo2obo utility loads one or more obo files,
optionally
filters them, and then saves the results into one or
more new obo files.
obo2obo [-formatversion <myversion>] [-parsecomments]
[-writecomments] \
[-script <scriptname> [<arg1>
<arg2> ... <argN>] \;] \
<inputfile1> <inputfile2> ...
<inputfileN> -o <outputspec1> -o <outputspec2> -o
<outputspecN>
or
obo2obo
-?
The command line parameters are:
- -formatversion - The version of
OBO to use when
writing the output file. Allowed values are
OBO_1_0
and OBO_1_2
- -parsecomments - Attempt to parse obsolete term comments
for information about replacement and consider terms. The comment must end
with a sentence of the form To update annotations, [use|consider] the
<ontology name> term "<term name>; <term id>" [, [and] the
<ontology name> term "<term name>; <term id>"]* [and
[use|consider] the <ontology name> term "<term name>; <term
id>" [, [and] the <ontology name> term "<term name>; <term
id>"]*]. If
the sentence can be successfully parsed, the replacement and consider fields
of the term are populated with the data from the comment, and the parsed lines
of the comment are removed.
- -script <scriptname> <args> \;- Runs an OSL Script. The script name may be
followed by any number of space-separated arguments that are passed to the
script. Note that the -script tag MUST be followed by a \; sequence so that
obo2obo knows where the script arguments stop and obo2obo arguments resume. Any number
of -script tags may be specified. If a -script tag is specified, the -o
tag is not necessary (although it is still allowed).
- -writecomments - Creates a structured comment of the sort
described in -parsecomments from an obsolete terms replacement and consider
fields. If such a comment already exists, it will be updated.
- <inputfileX> - Any number of OBO
files can be used as inputs
- -o <outputspec> - Specifies an output file. See below for details
on how to format the output specification.
- -? - Prints a page of usage information and exits
At least one input file and one output specification are required. By
default, obo2obo writes out OBO 1.2 format.
Output Specification
The output specification gives an output file name, and may optionally
specify some options for writing the file. The output spec format is:
-o [-f <filterfile.xml>] [-allowdangling] [-p <prefilter property id>] [-strictrootdetection]
[-saveimpliedlinks|-saveallimpliedlinks] [-realizeimpliedlinks]
<outputfile.obo>
The command line parameters are:
- -f <filterfile.xml> - Optional. Specifies a saved filter
to apply to the output file before saving. This filter must be in OBO-Edit's
XML filter format. An XML filtering file may be generated by saving a filter
from any filter editor (see Reusing
Filters
).
- -allowdangling - Optional. If this flag is
present, dangling links will be saved to the file. Otherwise, they are trimmed
out.
- -p <prefilter_property_id> - Optional. Applies a reasoner prefilter with the given id.
This can add a lot of time to the operation, because the reasoner must be
started up.
- -strictrootdetection - Optional. Applies the
filter specified by the -f
flag using strict root detection. See Orphaned Terms and the Root Picking
Algorithm for more information.
- -saveimpliedlinks - Optional. Runs the reasoner, and
saves any useful implied links. This is equivalent to specifying "Save for
presentation" in the Advanced OBO
Adapter settings.
- -saveallimpliedlinks - Optional. Runs the reasoner, and saves ALL
implied links. This will result in tens of thousands of new links appearing in
the file. This option should only be used if the resulting file will be loaded
by software that needs access to the internal link database used by the
reasoner. This is equivalent to specifying "Save all links" in the Advanced OBO Adapter settings.
- -realizeimpliedlinks - Optional. Saves implied links as
if they were created by a user. Normally, implied links are saved with a
{implied="true"} flag after them in the output file.
If this option is specified, the flag is dropped. Note that every single
realized link will be flagged as redundant by the reasoner when the file is
loaded into OBO-Edit. This option only takes effect if -saveimpliedlinks or -saveallimpliedlinks is
specified.
- <outputfile.obo> - The output
filename.
Also see Java Options on the
Command-line
Example:
To convert an OBO 1.2 file at ~/cvs/go/ontology/gene_ontology.obo into an
OBO 1.0 file:
obo2obo -formatversion
OBO_1_0 ~/cvs/go/ontology/gene_ontology.obo
-o ~/cvs/go/ontology/gene_ontology_1.0.obo
To filter ~/cvs/go/ontology/gene_ontology.obo using the filter
yeast_goslim_filter.xml to generate a file in OBO 1.0 format:
obo2obo -formatversion OBO_1_0 ~/cvs/go/ontology/gene_ontology.obo -o
-f yeast_goslim_filter.xml
~/cvs/gso/ontology/goslim_yeast_1.0.obo