text:
:- use_module(bio(ontol_db)).
:- use_module(bio(bioprolog_util)).

xp_mismatch(P1,P2,X1,X2,Msgs) :-
        equivalent_class(P1,P2),
        \+ \+ class(P1),
        \+ \+ class(P2),
        xp_mismatch_2(P1,P2,X1,X2,Msgs).

xp_mismatch_2(P1,P2,X1,X2,Msgs) :-
        class_cdef(P1,X1),
        class_cdef(P2,X2),
        setof(Msg,cdef_mismatch(X1,X2,Msg),Msgs).
xp_mismatch_2(P1,P2,X1,none,no_def1) :-
        class_cdef(P1,X1),
        \+ class_cdef(P2,_).
xp_mismatch_2(P1,P2,none,X2,no_def2) :-
        class_cdef(P2,X2),
        \+ class_cdef(P1,_).

cdef_mismatch(cdef(G1,_),cdef(G2,_),mismatched_genus) :-
        G1\=G2.
cdef_mismatch(cdef(G,D1),cdef(G,D2),Msg) :-
        maplist(umap,D1,D1x),
        maplist(umap,D2,D2x),
        diffs_mismatch(D1x,D2x,Msg).

diffs_mismatch(D1x,D2x,unique1(X)) :-
        member(_=X,D1x),
        \+ member(_=X,D2x).
diffs_mismatch(D1x,D2x,unique2(X)) :-
        member(_=X,D2x),
        \+ member(_=X,D1x).
diffs_mismatch(D1x,D2x,rel1(R)) :-
        member(R=X,D1x),
        \+ member(R=X,D2x),
        member(_=X,D2x).
diffs_mismatch(D1x,D2x,rel1(R)) :-
        member(R=X,D2x),
        \+ member(R=X,D1x),
        member(_=X,D1x).

umap(R=X,R=Y) :- !,umap(X,Y).
umap(X,Y) :- entity_xref(Y,X),id_idspace(Y,'UBERON'),!.
umap(X,X).

repo_name: obophenotype/upheno

repo_language: Makefile

mime_type: text/plain


text:
! Use to override the results of text matches

[Term]
id: MP:0001189 ! absent skin pigmentation
disjoint_from: HP:0007419 ! Pale pigmentation

[Term]
id: MP:0005421 ! loose skin
disjoint_from: HP:0010750 ! Dermatochalasis

[Term]
id: MP:0002185 ! ectopia
disjoint_from: HP:0002282 ! Heterotopia

! http://code.google.com/p/phenotype-ontologies/issues/detail?id=7
[Term]
id: MP:0003030 ! acidemia
disjoint_from: HP:0001941 ! Acidosis

! http://code.google.com/p/phenotype-ontologies/issues/detail?id=10
[Term]
id: MP:0011617 ! abnormal habituation
disjoint_from: HP:0004323 ! Abnormality of body weight

! http://code.google.com/p/phenotype-ontologies/issues/detail?id=12
[Term]
id: MP:0010030 ! abnormal orbit morphology
disjoint_from: HP:0000315 ! Abnormality of the orbital region

[Term]
id: MP:0000428 ! abnormal craniofacial morphology
disjoint_from: HP:0001999 ! Abnormal facial shape


text:
class_quad_flip	HP:0001257 ! Spasticity	HP:0001276 ! Hypertonia	MP:0012051 ! spasticity	MP:0012052 ! hypertonicity
class_quad_flip	HP:0001999 ! Abnormal facial shape	HP:0000234 ! Abnormality of the head	MP:0000428 ! abnormal craniofacial morphology	MP:0000432 ! abnormal head morphology
class_quad_flip	HP:0002773 ! Small vertebral bodies	HP:0008479 ! Hypoplastic vertebral bodies	MP:0004670 ! small vertebral body	MP:0004667 ! vertebral body hypoplasia
class_quad_flip	MP:0000432 ! abnormal head morphology	MP:0000428 ! abnormal craniofacial morphology	HP:0000234 ! Abnormality of the head	HP:0001999 ! Abnormal facial shape
class_quad_flip	MP:0004667 ! vertebral body hypoplasia	MP:0004670 ! small vertebral body	HP:0008479 ! Hypoplastic vertebral bodies	HP:0002773 ! Small vertebral bodies
class_quad_flip	MP:0012052 ! hypertonicity	MP:0012051 ! spasticity	HP:0001276 ! Hypertonia	HP:0001257 ! Spasticity