Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new support for prefixes in OBO format #119

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ clean:

TEST_SRCS ?= sgd pombase
SRCS ?= sgd pombase mgi zfin rgd dictybase fb tair wb goa_human goa_human_complex goa_human_rna goa_human_isoform goa_pig xenbase pseudocap ecocyc goa_sars-cov-2 uniprot_reviewed
ROBOT_ENV = ROBOT_JAVA_ARGS=-Xmx12G
ROBOT = $(ROBOT_ENV) robot

OBO_SRCS = $(patsubst %,target/neo-%.obo,$(SRCS))
all_obo: $(OBO_SRCS)
Expand All @@ -23,8 +25,8 @@ trigger:
touch $@

IMPORTS = imports/pr_import.obo
neo.obo: $(OBO_SRCS) $(IMPORTS)
owltools --create-ontology http://purl.obolibrary.org/obo/go/noctua/neo.owl $^ --merge-support-ontologies -o -f obo [email protected] && grep -v ^owl-axioms [email protected] > $@
neo.obo: $(OBO_SRCS) $(IMPORTS)
$(ROBOT) merge $(addprefix -i ,$^) annotate --ontology-iri 'http://purl.obolibrary.org/obo/go/noctua/neo.owl' convert -f obo -o [email protected] && grep -v ^owl-axioms [email protected] >$@

## datasets.json is created as a throwaway in the NEO versions of the
## pipeline and is based on the go-site master data.
Expand Down Expand Up @@ -75,20 +77,13 @@ target/neo-uniprot_reviewed.obo: mirror/uniprot_reviewed.gpi.gz
# see below for regenerating this
include Makefile-gafs

# This is very hacky:
# - The neo solr index has an ID field (which is a CURIE), but no URI
# - Minerva requires OWL which uses URIs
# The neo solr index has an ID field (which is a CURIE), but no URI
# Minerva requires OWL which uses URIs
#
# When loading solr, owltools will use the oboInOwl:id field as priority to load the ID field (see https://github.com/owlcollab/owltools/pull/247)
# Otherwise, the owltools built-in URI contraction method is used, which assumes OBO purls, with unpredictable behavior non-OBO PURLs
#
# Neo entities are NOT OBO ontologies, so they have a mix of prefixes, including identifiers.org
#
# Our hack is as follows. The perl code first generates an OBO file with CURIEs like FlyBase:FBgn111
# The default owltools expansion makes this an OBO PURLs
# We then "reverse" this with some hacky regexes...
neo.owl: neo.obo
owltools $< -o [email protected] && ./bin/fix-obo-uris.pl [email protected] > [email protected] && mv $@.tmp2 $@
$(ROBOT) convert -i $< -o [email protected] -f owl && mv $@.tmp $@

Makefile-gafs: datasets.json
./build-neo-makefile.py -i $< > [email protected] && mv [email protected] $@
Expand All @@ -110,7 +105,5 @@ rnacentral.gpi: rnacentral.gpi.gz
target/neo-rnac.obo: rnacentral.gpi.gz
gzip -dc $< | ./rnacgpi2obo.pl > [email protected] && mv [email protected] $@

target/xneo-%.owl: target/neo-%.obo
owltools $< -o [email protected] && mv [email protected] $@
target/neo-%.owl: target/xneo-%.owl
./bin/fix-obo-uris.pl $< > [email protected] && mv [email protected] $@
target/neo-%.owl: target/neo-%.obo
$(ROBOT) convert -i $< -o [email protected] -f owl && mv [email protected] $@
4 changes: 4 additions & 0 deletions gaf2obo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
my $spn = 'generic';
my $ontid;
my $isoform_only = 0;
open my $fh, '<', 'prefixes.obo.txt' or die "error opening prefixes.obo.txt: $!";
my $prefixes = do { local $/; <$fh> };

while (@ARGV) {
my $opt = shift @ARGV;
Expand All @@ -24,6 +26,8 @@

my $is_rat = $spn eq 'Rnor';

print "format-version: 1.2\n";
print $prefixes;
print "ontology: go/noctua/$ontid\n";
print "\n";

Expand Down
4 changes: 4 additions & 0 deletions gpi2obo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
my $fill_p = 0; # fill unknown species name with taxon id
my $ontid;
my $isoform_only = 0;
open my $fh, '<', 'prefixes.obo.txt' or die "error opening prefixes.obo.txt: $!";
my $prefixes = do { local $/; <$fh> };

while (@ARGV) {
my $opt = shift @ARGV;
Expand All @@ -26,6 +28,8 @@
$ontid = $spn;
}

print "format-version: 1.2\n";
print $prefixes;
print "ontology: go/noctua/$ontid\n";
print "\n";

Expand Down
15 changes: 15 additions & 0 deletions prefixes.obo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
idspace: AGI_LocusCode http://arabidopsis.org/servlets/TairObject?type=locus&name=
idspace: ComplexPortal https://www.ebi.ac.uk/complexportal/complex/
idspace: dictyBase http://identifiers.org/dictybase.gene/
idspace: FB http://identifiers.org/flybase/
idspace: GR_protein http://identifiers.org/uniprot/
idspace: MGI http://identifiers.org/mgi/
idspace: PomBase http://identifiers.org/pombase/
idspace: RGD http://identifiers.org/rgd/
idspace: RNAcentral http://rnacentral.org/rna/
idspace: SGD http://identifiers.org/sgd/
idspace: TAIR_locus http://identifiers.org/tair.locus/
idspace: UniProtKB http://identifiers.org/uniprot/
idspace: WB http://identifiers.org/wormbase/
idspace: Xenbase http://identifiers.org/xenbase/
idspace: ZFIN http://identifiers.org/zfin/
6 changes: 5 additions & 1 deletion rnacgpi2obo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
);

my %tm = map {($_=>1)} @taxa;


open my $fh, '<', 'prefixes.obo.txt' or die "error opening prefixes.obo.txt: $!";
my $prefixes = do { local $/; <$fh> };

print "format-version: 1.2\n";
print $prefixes;
print "ontology: go/noctua/rnac\n";
print "\n";

Expand Down
Loading