OMOP concept relationships
OMOP concepts have relationships to one another. There are many different types of relationships. It's helpful to look at the nature of the concepts in different relationships.
If you think the vocabularies have changed
This SQL can be used to build ./data/relationships_summary.csv
SELECT
c1.domain_id as from_domain,
c1.vocabulary_id as from_vocab,
c1.standard_concept as from_standard,
c2.domain_id as to_domain,
c2.vocabulary_id as to_vocab,
c2.standard_concept as to_standard,
cr.relationship_id as relationship,
COUNT(c1.concept_id)
FROM omop.concept_relationship cr
JOIN omop.concept c1 ON cr.concept_id_1 = c1.concept_id
JOIN omop.concept c2 ON cr.concept_id_2 = c2.concept_id
GROUP BY
from_domain,
from_vocab,
from_standard,
to_domain,
to_vocab,
to_standard,
relationship;
The first thing to look at is how many relationships there are, and what the type of relationship is.
Note
There are a lot of redundant relationship IDs, as many relationships are inverses of one another. For example, "Maps to" and "Mapped from" are the same, but with the concepts swapped. For our purposes, these are unnecessary
That's a nice little summary of the overall counts. What are the domains being mapped to and from?
Below is a heatmap for this. It's filtered on the same domains as the bar chart.
I'm sorry choosing domains is a pain.
The heatmap shows what is being mapped, but not the nature of the relationships. The diagram below shows a more detailed view of the nature of relationships. The domain being mapped from is shown on the left, and the domains it is mapped to is shown on the right. The stripes running left to right show are thick proportional to the count of relationships, coloured by the type of relationship. You can hover over the stripe to see what the relationship is.
I had thought to show more domains on the left, but that would be too chaotic.