Skip to content

Commit

Permalink
Merge pull request #60 from INCATools/rg-tab
Browse files Browse the repository at this point in the history
Refactor to use relation-graph TSV output
  • Loading branch information
cmungall committed Nov 23, 2022
2 parents e198d74 + 1016476 commit 0178c2d
Show file tree
Hide file tree
Showing 38 changed files with 2,095 additions and 1,230 deletions.
21 changes: 1 addition & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,11 @@ jobs:
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction --extras gilda
run: poetry install --no-interaction

#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: poetry run python -m unittest discover

#----------------------------------------------
# coverage report
#----------------------------------------------
- name: Generate coverage results
run: |
poetry run coverage run -m unittest discover
poetry run coverage xml
poetry run coverage report -m
#----------------------------------------------
# upload coverage results
#----------------------------------------------
- name: Upload coverage report
uses: codecov/[email protected]
with:
name: codecov-results-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
37 changes: 16 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,32 @@ PREFIX_DIR = $(BUILDER_DIR)/prefixes
ALL_OBO_ONTS := $(shell cat reports/obo.tsv)
SELECTED_ONTS = obi mondo go envo ro hp mp zfa wbphenotype ecto upheno uberon_cm doid chebi pr wbphenotype fbbt dron

# EXTRA_ONTOLOGIES is defined in ontologies.Makefile
ALL_ONTS = $(ALL_OBO_ONTS) $(EXTRA_ONTOLOGIES)

STAGED_ONTOLOGIES = $(patsubst %,stage/%.db.gz,$(ALL_ONTS))

TEST_ONTOLOGIES = go-nucleus robot-example


all: build_all stage_all
build_all: $(patsubst %,all-%,$(ALL_OBO_ONTS))
stage_all: $(patsubst %,stage/%.db.gz,$(ALL_OBO_ONTS))
build_all: $(patsubst %,all-%,$(ALL_ONTS))
stage_all: $(STAGED_ONTOLOGIES)

selected: $(patsubst %,all-%,$(SELECTED_ONTS))

all-%: db/%.db
sqlite3 $< "SELECT COUNT(*) FROM statements"
stage/%.db.gz: db/%.db
gzip -c $< > $@.tmp && mv $@.tmp $@
.PRECIOUS: stage/%.db.gz

list-onts:
echo $(ALL_ONTS)
list-extra:
echo $(EXTRA_ONTOLOGIES)
list-staged:
ls -alt $(STAGED_ONTOLOGIES)

# INSTALL
include install.Makefile
Expand Down Expand Up @@ -97,10 +111,6 @@ db/obo-ontologies.owl:
reports/obo.tsv: db/obo-ontologies.db
sqlite3 $< "SELECT subject FROM ontology_status_statement WHERE value = 'active'" | perl -npe 's@^obo:@@' > $@

# to test
list-onts:
echo $(ALL_OBO_ONTS)




Expand All @@ -119,21 +129,6 @@ reports/%.problems.tsv: db/%.db target/%.views
STAMP:
touch $@

# download OWL, ensuring converted to RDF/XML
db/%.owl: STAMP
robot merge -I http://purl.obolibrary.org/obo/$*.owl -o $@
.PRECIOUS: db/%.owl

db/foodon.owl: STAMP
robot merge -I $(OBO)/foodon.owl relax reduce -c true -o $@

db/go.owl: STAMP
curl -L -s http://purl.obolibrary.org/obo/go/extensions/go-plus.owl > $@

db/monarch.owl:
robot merge -I http://purl.obolibrary.org/obo/upheno/monarch.owl -o $@


db/reactome-Homo-sapiens.owl: download/reactome-biopax.zip db/biopax.owl
unzip -p $< Homo_sapiens.owl > $@.tmp &&\
robot merge -i $@.tmp -i db/biopax.owl -o $@
Expand Down
2 changes: 1 addition & 1 deletion install.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bin/rdftab:
curl -L -o $@ $(RDFTAB_URL)
chmod +x $@

RG_VERSION=2.2.0
RG_VERSION=2.3.0
bin/relation-graph:
curl -L -s https://github.com/balhoff/relation-graph/releases/download/v$(RG_VERSION)/relation-graph-cli-$(RG_VERSION).tgz | tar -zxv && mv relation-graph-cli-$(RG_VERSION) relation-graph && (cd bin && ln -s ../relation-graph/bin/relation-graph)

Loading

0 comments on commit 0178c2d

Please sign in to comment.