all: prep all_assocs all_gpi
prep: gene-associations

gafs := $(basename $(wildcard gene-associations/gene_association.*.gz))
dbs := $(subst gene-associations/gene_association., , $(gafs))

all_assocs: $(foreach d,$(dbs), $d-oa.ttl)
all_gpi: $(foreach d,$(dbs), $d-gpi.ttl)

gene-associations:
	ln -s ../../gene-associations

gene-associations/%: gene-associations

%-oa.ttl: gene-associations/gene_association.%.gz
	owltools --gaf $< --gaf2oa -o $@

%-gpi.ttl: gene-associations/gene_association.%.gz
	owltools --gaf $< --gaf2oa --mode gpi -o $@

%-lego.owl: gene-associations/gene_association.%.gz
	owltools ../ontology/go.obo --gaf $< --gaf2lego -o $@