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

Add method to ensure that hpoa annos are converted to Mondo first #930

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ src/ontology/components/legal_diseases.txt
src/ontology/components/d2p_*.ttl
src/ontology/components/disease_to_phenotype_merged_signature.tsv
src/ontology/components/efo-rename.tsv
src/ontology/components/mondo-rename.tsv
7 changes: 6 additions & 1 deletion src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ components/d2p_%.ttl: mirror/%.owl

components/efo-rename.tsv: components/mondo_efo_mappings.tsv components/disease_to_phenotype_merged_signature.tsv
python3 ../scripts/rename_tsv_subset.py $^ $@

components/mondo-rename.tsv: mirror/mondo.owl
$(ROBOT) query -i $< -q $(SPARQLDIR)/mondo_rename.sparql $@
cat $@ | tr -d '<>,' > [email protected] && mv [email protected] $@

# If you change the relation in the sparql query, make sure you add the new relation here as well.
components/legal_diseases.txt: $(SRC) components/disease_to_phenotype_merged.owl
Expand All @@ -164,8 +168,9 @@ components/disease_to_phenotype_merged.owl: $(D2P_RAW)
$(ROBOT) merge $(addprefix -i , $(D2P_RAW)) \
annotate --ontology-iri "http://www.ebi.ac.uk/efo/$@" -o $@

components/disease_to_phenotype.owl: components/disease_to_phenotype_merged.owl components/efo-rename.tsv components/legal_diseases.txt
components/disease_to_phenotype.owl: components/disease_to_phenotype_merged.owl components/mondo-rename.tsv components/efo-rename.tsv components/legal_diseases.txt
$(ROBOT) merge -i $< \
rename --mappings components/mondo-rename.tsv \
rename --mappings components/efo-rename.tsv \
remove -T components/legal_diseases.txt --select complement --trim true \
query --update $(SPARQLDIR)/remove-stray-classes.ru \
Expand Down
17 changes: 17 additions & 0 deletions src/sparql/mondo_rename.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?source ?mondo
WHERE {
{ ?mondo skos:exactMatch ?source . }
FILTER(isIRI(?mondo) && (regex(str(?mondo), "http://purl.obolibrary.org/obo/MONDO_")))
}