Skip to content

First pass at mesh mapping #17

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 10 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
language: java
jdk:
- oraclejdk8
sudo: required

before_script:
- mkdir -p bin
- export PATH=$PATH:$PWD/bin
- wget http://build.berkeleybop.org/userContent/owltools/owltools -O bin/owltools
- wget http://build.berkeleybop.org/userContent/owltools/ontology-release-runner -O bin/ontology-release-runner
- wget http://build.berkeleybop.org/userContent/owltools/owltools-runner-all.jar -O bin/owltools-runner-all.jar
- wget http://build.berkeleybop.org/userContent/owltools/owltools-oort-all.jar -O bin/owltools-oort-all.jar
- chmod +x bin/*
services:
- docker

before_install:
- docker pull obolibrary/odkfull

# command to run tests
script: cd src/ontology && make test
script: cd src/ontology && sh run.sh make travis_test

#after_success:
# coveralls

# whitelist
branches:
only:
- master

### Add your own lists here
### See https://github.com/INCATools/ontology-development-kit/issues/35
notifications:
email:
- [email protected]

- [email protected]
41 changes: 41 additions & 0 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ imports/%_import.owl: chiro-edit.owl %.owl imports/seed.tsv
robot extract -i $*.owl -T imports/seed.tsv -m BOT -O $(OBO)/chiro/$@ -o [email protected] && mv [email protected] $@
# owltools --use-catalog $< $(OBO)/$*.owl --add-imports-from-supports --extract-module -s $(OBO)/$*.owl -c --extract-mingraph --set-ontology-id $(OBO)/go/extensions/$@ -o $@

imports/chebi-role.owl: chebi.owl
robot filter -i $< --term CHEBI:50906 --select "annotations self descendants" \
--signature true \
--output $@

chebi.owl:
wget $(OBO)/chebi.owl

Expand Down Expand Up @@ -92,3 +97,39 @@ role-xp-unvetted.obo: role-list-mined.txt

chiro-xp.owl: role-xp.obo
owltools $< -o -f ofn $@

# ----------------------------------------
# Mappings
# ----------------------------------------

imports/mesh-chemrole.owl: mesh-obo.owl
robot filter -i $< --term http://id.nlm.nih.gov/mesh/D020164 --select "annotations self descendants" \
--signature true \
--output $@

imports/ncit-chemeffect.owl: ncit.owl
robot filter -i $< --term http://purl.obolibrary.org/obo/NCIT_C19996 --select "annotations self descendants" \
--signature true \
--output $@

mappings/mesh-chebi-role-mappings.tsv: imports/mesh-chemrole.owl imports/chebi-role.owl
rdfmatch -p CHEBI -w mappings/chebi_mesh_weights.pro -i prefixes.ttl -i $< -i imports/chebi-role.owl match > [email protected] && mv [email protected] $@

mappings/ncit-chebi-role-mappings.tsv: imports/ncit-chemeffect.owl imports/chebi-role.owl
rdfmatch -p CHEBI -d rdf_matcher -i prefixes.ttl -i $< -i imports/chebi-role.owl match > [email protected] && mv [email protected] $@

mappings/ncit-mesh-role-mappings.tsv: imports/ncit-chemeffect.owl imports/mesh-chemrole.owl
rdfmatch -p NCIT -d rdf_matcher -i prefixes.ttl -i $< -i imports/mesh-chemrole.owl match > [email protected] && mv [email protected] $@

mappings/mesh-chebi-role-mappings-unique.tsv: mappings/mesh-chebi-role-mappings.tsv
cut -f1-4 $< | sort -u > $@

mappings/%-ptable.tsv: mappings/%-mappings.tsv
python ~/repos/sssom-py/sssom/cli.py ptable --priors 0.01 0.01 0.88 0.1 $< > $@

imports/mesh-chebi-role.owl: imports/mesh-chemrole.owl imports/ncit-chemeffect.owl
robot merge -i imports/mesh-chemrole.owl -i imports/ncit-chemeffect.owl -o $@

mappings/mesh-chebi-role-equivs.owl: mappings/mesh-chebi-role-ptable.tsv imports/mesh-chebi-role.owl
boomer --ptable $< --ontology imports/mesh-chebi-role.owl --prefixes prefixes.yaml --window-count 20 --runs 20 && robot reason -A EquivalentClass -r elk -i output.ofn -o $@

Empty file added src/ontology/Makefile-mappings
Empty file.
24 changes: 24 additions & 0 deletions src/ontology/mappings/chebi_mesh_weights.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
% xrefs
weight(1.0, [predicate_id='owl:equivalentClass', subject_match_field='oio:hasDbXref', object_match_field='oio:hasDbXref']).

weight(2, [predicate_id='owl:equivalentClass', any_match_field='dc:identifier']).
weight(2, [predicate_id='owl:equivalentClass', any_match_field='schema:url']).

weight(3, [predicate_id='owl:equivalentClass', any_match_field='rdfs:label']).
weight(3, [predicate_id='owl:equivalentClass', any_match_field='oio:hasExactSynonym']).
weight(3, [predicate_id='owl:equivalentClass', any_match_field='skos:exactMatch']).
weight(2, [predicate_id='owl:equivalentClass', any_match_field='oio:hasRelatedSynonym']).

weight(-2, [predicate_id='owl:equivalentClass', any_match_field='oio:hasNarrowSynonym']).
weight(-2, [predicate_id='owl:equivalentClass', any_match_field='oio:hasBroadSynonym']).

% lexical is lower, stemmming even lower
weight(-1.0, [predicate_id='owl:equivalentClass', match_type=['Lexical','Stemming']]).
weight(-0.5, [predicate_id='owl:equivalentClass', match_type=['Lexical']]).

weight(-1, [match_string=S]) :- atom_length(S,3).
weight(-2, [match_string=S]) :- atom_length(S,2).
weight(-3, [match_string=S]) :- atom_length(S,1).
weight(-99, [match_string=S]) :- atom_length(S,0).


Loading