<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Syed Irtaza Raza on Medium]]></title>
        <description><![CDATA[Stories by Syed Irtaza Raza on Medium]]></description>
        <link>https://medium.com/@syedirtazaraza?source=rss-9e7b7af4ffd6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YvSk1aK61gxGOSku3a0JdQ.png</url>
            <title>Stories by Syed Irtaza Raza on Medium</title>
            <link>https://medium.com/@syedirtazaraza?source=rss-9e7b7af4ffd6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 08:03:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@syedirtazaraza/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Drug Discovery Knowledge Graphs]]></title>
            <link>https://medium.com/vaticle/drug-discovery-knowledge-graphs-46db4212777c?source=rss-9e7b7af4ffd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/46db4212777c</guid>
            <category><![CDATA[drugs]]></category>
            <category><![CDATA[pharmaceutical]]></category>
            <category><![CDATA[drug-discovery]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[systems-biology]]></category>
            <dc:creator><![CDATA[Syed Irtaza Raza]]></dc:creator>
            <pubDate>Fri, 07 Jun 2019 13:49:23 GMT</pubDate>
            <atom:updated>2022-05-19T17:00:04.685Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uC40oYHy1rF1ZoXP0piBvw.jpeg" /></figure><p>Combinatorial chemistry has produced a huge amount of chemical libraries and data banks which include prospective drugs. Despite all of this progress, the fundamental problem still remains: how do we take advantage of this data to identify the prospective nature of a compound as a vital drug? Traditional methodologies fail to provide a solution to this.</p><p><a href="https://blog.vaticle.com/what-is-a-knowledge-graph-5234363bf7f5">Knowledge graphs</a>, however, provide a framework which can make drug discovery much more efficient, effective and approachable. This radical advancement in technology can model biological knowledge complexity as it is found at its core. With concepts such as hyper relationships, type hierarchies, automated reasoning, and analytics we can finally model, represent, and query biological knowledge at an unprecedented scale.</p><p>But before we delve into the methodology of creating a drug discovery knowledge graph, let us look at what methodologies exist today, and why new techniques are required.</p><h4>Drug Discovery and its Shortcomings</h4><p>Drug discovery, as the name suggests, is the process by which new medications are discovered. It involves a wide range of scientific disciplines, including biology, chemistry, and pharmacology.</p><p>Historically, drugs were discovered either serendipitously, or through identifying the active ingredient in traditional remedies. More recently, chemical libraries of synthetic small molecules, natural products, or extracts were screened in intact cells or whole organisms to identify substances which have a desirable therapeutic effect in a process known as classical/forward pharmacology or phenotypic drug discovery.</p><p>The sequencing of the human genome changed things drastically, as it allowed the rapid cloning and synthesis of large quantities of purified proteins. It has since become common practice to use high throughput screening of large compound libraries against isolated biological targets which are hypothesised to be disease modifying, in a process known as reverse pharmacology, or target-based drug discovery. Hits from these screens are then tested in cells. then animals, for efficacy.</p><p>While the afore-mentioned processes may seem systematically effective, they are neither as efficient nor economical as desired. For a drug to be discovered, it takes on average $2 billion and almost 14 years. Further, there is a greater than 90% failure rate associated with drug discovery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*JfOBPbUOfm9pqzQ2AfuA4A.png" /></figure><p>With billions of dollars being spent on finding new drugs, and very low outcomes, it has therefore become essential to develop newer and more intelligent ways to do so. To illustrate this need, the diagram above depicts the trend of the return on pharmaceutical investments.</p><h4>What are the Challenges in Data-Driven Drug Discovery?</h4><p>While studying the various approaches that leverage data in drug discovery, I found several barriers to finding the insights that would accelerate and assist the industry. These can be summarised in the following three points:</p><ol><li><strong>Integration: Difficulty in ingesting and integrating complex networks of biological data<br></strong>The first challenge starts with the raw data. This data, which pertains to biological concepts and relationships, is scattered all over the world and is produced at an unprecedented rate by a multitude of institutions in various formats and standards. This is also known as the <a href="https://www.analyticsinsight.net/big-data-disruption-organizations-need-careful/">big data disruption paradigm</a>, where high throughput data pipelines are creating bottlenecks to the analysis and processing of that data. It is extremely difficult to ingest and integrate these multi-format and disparate data sets.</li><li><strong>Normalisation: Difficulty in contextualising relations within biomedical data<br></strong>The second challenge stems from the fact that the raw data contained in these data sets have no structure. This lack of structure makes it difficult to maintain and assure integrity, accuracy, and consistency over the data. It also causes a lack of control over the validity of the data when integrating such heterogeneous data sources. Taken together, this makes it hard to contextualise or understand the relationships contained within the data.</li><li><strong>Discovery: Difficulty in investigating insights over a magnitude of data in a scalable way<br></strong>Finally, due to the magnitude of data, it becomes extremely tedious to generate or investigate insights in a scalable way. Of course, valuable insights can be discovered manually for single data instances, but such an approach is impossible to scale across millions of data points. Moreover, in most cases, doing this manually is simply practically impossible. What do we do then?</li></ol><h4>What Solutions can Address These Challenges?</h4><p>With these problems in mind, we need to think of potential solutions that can address those challenges. Based on my research, the below is what I suggest:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8i-IkSM7s_Lj-rsjdrKEA.png" /></figure><p>Having identified a template to the solutions of the previously listed challenges, I wondered whether there was any one technology out there, that encompassed all three points?</p><p>Well, to my luck, <a href="http://www.vaticle.com/"><strong>TypeDB</strong></a><strong><em> </em></strong>solves all of these.</p><p>If you’re unfamiliar with this technology, TypeDB is an intelligent database in the form of a knowledge graph which organises complex networks of data. It contains a knowledge representation system based on <a href="https://en.wikipedia.org/wiki/Hypergraph">hyper-graphs</a>, enabling the modelling of every complex biological relationship. This knowledge representation system is then interpreted by an automated reasoning engine, which performs reasoning in real-time. The software gets exposed to the user in the form of a flexible and easily understood query language - <a href="https://docs.vaticle.com/docs/schema/overview"><strong>TypeQL</strong></a>.</p><h4>Building a Drug Discovery Knowledge Graph</h4><p>But how do we actually go about building a drug discovery knowledge graph using TypeDB?</p><p><strong>Identifying the Right Data</strong></p><p>Studying the various types and instances of data, I found it beneficial to leverage and navigate the complex relationships between compounds, genes, diseases, and proteins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUebZxFOUjJGeWX7YoCIVg.png" /></figure><p>To augment the above data types, we can also incorporate other types of data which may enrich our knowledge graph, as well as provide more powerful insights. This data may entail various biological pathway data or even <a href="https://blog.vaticle.com/text-mined-knowledge-graphs-beyond-text-mining-1ff207a7d850">text mined medical literature</a> (which can be used to connect certain research studies to give confidence to our insights).</p><p>Once we have the raw data we want for our application, we need to find reliable sources where we can retrieve this data from. The following list exhibits some of the sources that may be used to download the raw data pertaining to drug discovery:</p><ol><li>Gene Ontology</li><li><a href="https://www.ncbi.nlm.nih.gov/search/">NCBI</a></li><li><a href="https://www.ncbi.nlm.nih.gov/clinvar/">ClinVar</a></li><li>CTD</li><li><a href="http://www.disgenet.org/">DisGeNET</a></li><li>Gene Expression Omnibus</li><li>IntAct</li><li><a href="https://www.ncbi.nlm.nih.gov/pubmed/">PubMed</a></li></ol><p><strong>Normalising Raw Data<br></strong>Now that we have raw data, we need to tackle the second problem: that of normalisation. To this end, TypeDB utilises the <a href="https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model">entity-relationship model</a> to group each concept into either an entity, attribute, or relationship. This means that all we have to do is map each concept to a <a href="https://docs.vaticle.com/docs/schema/concepts">schema concept type</a>, and recognise the relationships between them. Let us look at an example to demonstrate how we would go about doing this.</p><p>First, let us assume we have the following two raw data sets representing instances of genes in one data set, and diseases in another:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmED9uYID4C6O_PmlAis5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPj75tuH1jPi9yzBQuEOqg.png" /></figure><p>If we were to visualise the above two concepts and the relations between them, it would look like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apkAffMsp2duPWc_ZpEsYw.png" /></figure><p>This structure can be represented using TypeQL as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*PvsTQM3AbZ1GaIl_yVUL3Q.png" /></figure><p>We recognised a gene and a disease as an entity, having symbol and name respectively. Then, we defined a relationship between the gene and person which we called gene-disease-association, where the role-players in the relationships are the associated-gene and diagnosed-disease.</p><p>In order to constrain the attributes of each concept, we also need to denote what data type they adhere to. In this case, we defined them asstring type.</p><p><strong>Migrating the Raw Data into TypeDB<br></strong>Now that we have the data from our sources, as well a structure imposed on this data, the next step is to migrate this into TypeDB. While there are many different ways to do migration, I will specifically touch on how we would go about using <a href="https://docs.vaticle.com/docs/client-api/java">Java</a>, <a href="https://docs.vaticle.com/docs/client-api/nodejs">NodeJS</a> and <a href="https://docs.vaticle.com/docs/client-api/python">Python</a>.</p><p>For this, we can easily use any of these languages to read/parse the raw data file and iterate over each entry within those files. The image below depicts how to insert a single instance of a gene with a name and symbol into TypeDB, using any of these three languages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-vdTFkZPWOEMFUOgxh_GQ.png" /></figure><p>You can learn more about <a href="https://docs.vaticle.com/docs/examples/phone-calls-overview">migrating data</a> into TypeDB in this <a href="https://blog.vaticle.com/modeling-migrating-big-biological-data-with-grakn-4c6bf5f94f17">article</a>.</p><p><strong>Discover Insights that Scale</strong></p><p>After migration, we can start to discover new insights. Discovering insights refers to finding new data that may be valuable to what we are trying to accomplish. In order to do that, we need to first look or ask for something. In other words, we start with a question — the questions we ask to find answers to in drug discovery.</p><p>Let us look at an example, and see how our drug discovery knowledge graph may provide answers to them:</p><p><em>Question: What are the potential targets of the disease Melanoma?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*5fEKRXn12GJYWiI7dHSO9A.png" /></figure><p>Answer: The answer returned is a list of proteins which are usually potential targets. For proteins to be identified as viable targets they must be related to the disease in some way. Let us say that in this case, they were part of a<em> protein-protein-interaction</em> pathway:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsrrorBmLpkdIfuxXdxSvw.png" /></figure><p>The question that then arises is — how did TypeDB recognise the proteins that were not directly related to the disease?</p><p>That comes down to the power of automated reasoning inherent in TypeDB, in the form of rules, which infers that all proteins which fall in a pathway leading to a disease can be identified as drug targets. Two rules were encoded in the knowledge graph that enabled this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*wEDoQHblO1DokfvquBHdJw.png" /></figure><p>First, we used a rule that formed the protein-protein-association relations between proteins that had a transitive relations between them. The TypeQL syntax above shows this rule, while the following diagram displays how this rule works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QeoTh-9jimjk0VSwelbfBQ.png" /></figure><p>The dotted relation on the top is the inferred protein-protein-association relation that was created by TypeDB. This rule resulted from all the proteins that are in a pathway and are linked to each other.</p><p>The second rule used a somewhat similar flavour of rules to form the initial protein-target-identification relation between the disease under observation and the potential target proteins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Swob2cxqYOhAgq80QX7pdA.png" /></figure><p>The syntax for this rule can be seen above, where we are now using the protein which is directly related to the disease and the proteins which are related to the directly related protein. A visual representation of this rule is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoVEY_so2eHpz_5H-rj0sg.png" /></figure><p>The dotted relations on the top are the inferred protein-protein-association relations which were created due to the logic of the first rule, while the ones on the bottom are the inferred protein-target-identification relations created by the second rule.</p><p>As much as we may want it to be, biology is not as simple as assumed above. Pathways are not linear in nature, but reveal much more complex sets of relations. Proteins that take part in disease pathways are also responsible for causing a variety of normal cell functions. A slightly more realistic model would look as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5m_sekn51IR_PzpROV7gg.png" /></figure><p><em>Question: Given this model, what are the potential targets for the disease Melanoma that do not take part in any normal cell function pathways?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*mj-m2QzOmBuaHuxPEZ3U_w.png" /></figure><p>This question can be translated into TypeQL with the help of negation, which enables us to ask for concepts which do not adhere to certain statements, and in this case enables us to retrieve the proteins that are not related to any normal cell function.</p><p>Answer: What is returned is the identification of the protein which is not causing any normal cell function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYYzMJehy3aYkKmGsx8_6Q.png" /></figure><p>But what if all proteins are responsible for cell functions? Can we get some sort of measure that can guide us to find out an insight which may help our research?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*USkJX0fVNG0QsYsa6bko7A.png" /></figure><p><em>Question: What are the potential targets for the disease Melanoma and what are the number of occurrences of those proteins in normal cell functions?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*izbagG9oElYfReCw14u5rw.png" /></figure><p><a href="https://blog.vaticle.com/distributed-big-data-analytics-with-graql-fc71500822d1">Distributed analytics</a> is a set of scalable algorithms that allows you to perform computation over large amounts of data in a distributed fashion. The TypeQL query above shows an example of this which helps us answering our question.</p><p>Answer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-TUEfOTyvDnbkk1XmU9Jw.png" /></figure><p>Here, we get back exactly what we asked for, allowing us to shortlist the target proteins that we want to prioritise in our research; and expediting our research to viable compounds capable of treating a disease with minimal effects to your normal physiology.</p><p><strong>How do all the Pieces Fit Together in one Architecture? <br></strong>Now, let us take a step back, and look at how all of the components of building a drug discovery knowledge graph piece together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8ouSlfsO9SUTNLhjNy2Qg.png" /></figure><p>We start with the data which can come from multiple sources and in various formats. That raw data is used to create a <a href="https://docs.vaticle.com/docs/schema/overview">schema</a> (high level data model) to enforce a structure on the raw data. Once that is done, we use one of <a href="https://docs.vaticle.com/docs/client-api/overview">TypeDB’s clients</a> to migrate the instances of data into TypeDB making sure every insertion adheres to the schema. TypeDB stores this in its knowledge representation system, which can be queried for insights to discover complex relationships or even test out hypotheses. These insights may already be in the graph or can even be created at the time of query by the reasoning engine.</p><h4>Conclusion</h4><p>So, we know that <em>Data Driven Drug Discovery </em>is extremely promising in revolutionising global health care. We understand that there are barriers and bottle-necks associated with achieving it. I hope to have shown that TypeDB can help to bring us many steps closer to efficiently, effectively, and economically discovering drugs which can cure and treat those patients with diseases whose medications are still at large. In summary, TypeDB helps to solve the three key challenges in drug discovery when it comes to handling data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wyebwRtzgFZ-QAEMqwv2yg.png" /></figure><p>You can checkout out our open source <a href="https://github.com/vaticle/biograkn">BioGrakn GitHub</a> repo to explore TypeDB and its capabilities in the biology space.</p><p>If you have any questions, comments or would like to collaborate, please shoot me an email at community@vaticle.com. You can also <a href="https://discord.com/invite/vaticle">talk to us</a> and <a href="https://forum.vaticle.com/">discuss</a> your ideas with the TypeDB community.</p><p><em>Grakn Labs was rebranded in 2021 to Vaticle; Grakn is now TypeDB, and Graql is now TypeQL.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46db4212777c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaticle/drug-discovery-knowledge-graphs-46db4212777c">Drug Discovery Knowledge Graphs</a> was originally published in <a href="https://medium.com/vaticle">TypeDB</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Mined Knowledge Graphs — Beyond Text Mining]]></title>
            <link>https://medium.com/vaticle/text-mined-knowledge-graphs-beyond-text-mining-1ff207a7d850?source=rss-9e7b7af4ffd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ff207a7d850</guid>
            <category><![CDATA[text-mining]]></category>
            <category><![CDATA[graph-database]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[biotechnology]]></category>
            <dc:creator><![CDATA[Syed Irtaza Raza]]></dc:creator>
            <pubDate>Sun, 21 Apr 2019 19:12:43 GMT</pubDate>
            <atom:updated>2022-05-20T11:37:54.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>Text Mined Knowledge Graphs: Beyond Text Mining</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxqIJjBn2ZYfrF_F_fiDfQ.jpeg" /></figure><p>Text is the medium used to store the tremendous wealth of scientific knowledge regarding the world we live in. However, with its ever increasing magnitude and throughput, analysing this unstructured data has become an impossibly tedious task. This has led to the rise of <a href="https://en.wikipedia.org/wiki/Text_mining">Text Mining</a> and <a href="https://en.wikipedia.org/wiki/Natural_language_processing">Natural Language Processing (NLP)</a> techniques and tools as the go-to for examining and processing large amounts of natural text data.</p><p>Text mining is the automatic extraction of structured semantic information from unstructured machine-readable text. The identification and further analysis of these explicit concepts and relationships help in discovering multiple insights contained in text in a scalable and efficient way.</p><p>Some of the various text mining and NLP techniques include: structure extraction, tokenisation, acronym normalisation, lemmatisation, de-compounding, and identifying language, sentences, entities, relations, phrases, and paragraphs.</p><p>But once we have this “structured semantic information”, what do we do then? Do these text mining techniques simply produce the insights we are trying to uncover?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBz1X6fCyG8_OGBIpPgFzQ.png" /></figure><p>Well, it’s never that simple. Even after extracting some information from text, there’s a long way to go to convert that first into knowledge, and then into a valuable insight. That insight may be a new discovery, or confirming and verifying a previous hypothesis, by creating new links in existing knowledge we have about our domain. Let us look at why going beyond text mining is not an easy task.</p><h4>What are the Challenges of Going Beyond Text Mining?</h4><p>While working with a number of NLP tools, I found several challenges between the output of a text-mining or NLP tools, and the insights I was looking for. These can be summarised as follows:</p><ol><li><strong>Difficulty in ingesting and integrating complex networks of text mined outputs<br></strong>Text mining a single instance of text is easy. We could also just read the text and extract the knowledge contained in it ourselves. However, what do we do when we have hundreds, thousands, or millions of independent text instances in our corpus? In this case it becomes extremely hard to uncover and understand the relationships between the knowledge extracted (text-mined outputs) from each text against each other. To be able to do such analyses, we need to integrate all the outputs in one place — which is not as easy as it sounds.</li><li><strong>Difficulty in contextualising knowledge extracted from text with existing knowledge <br></strong>Second, not only do we want to analyse knowledge extracted from text, but we want to go beyond that, to see how the information extracted relates to all the other data we have. This data would have its own format or structure; making it impossible to compare it with our original NLP output. This leads to the difficulty of contextualising relationships between various groups of disparate and heterogeneous data.</li><li><strong>Difficulty in investigating insights in a scalable and efficient way<br></strong>Finally, due to the magnitude of text that can be extracted, it becomes extremely tedious to generate or investigate insights in a scalable way. Of course, valuable insights can be discovered manually for single instances of text, but such an approach is impossible to scale across millions of text instances. Moreover, in most cases, doing this manually is simply practically impossible. What do we do then?</li></ol><h4>How do we Address These Challenges?</h4><p>With this in mind, we need to find potential solutions to address these challenges. Based on my research, I suggest this methodology:</p><ol><li><strong>Integrate and ingest complex networks of text-mined output into one collection<br></strong>To solve the first challenge, we need a method to easily accumulate text mined output into one collection — in other words, a text mined <a href="https://hackernoon.com/wtf-is-a-knowledge-graph-a16603a1a25f">knowledge graph</a>.</li><li><strong>Impose an explicit structure to normalise all data<br></strong>To enable the intelligent analysis and integration of data, while also maintaining data integrity, we need to impose an explicit structure on all the data we want to analyse. Not only will this help to contextualise the concepts themselves, but also the relationships between them. This translates into to having a higher-level data model to encompass the various types of data and consolidate their presence in the knowledge graph. This will then also allow us to validate the data at the time of ingestion. The data model will act as an umbrella over all data types allowing us to contextualise all relationships within and between them.</li><li><strong>Discover new insights using automated reasoning<br></strong>In order to extract or infer as much information as possible from our knowledge graph, we need some sort of <a href="https://en.wikipedia.org/wiki/Automated_reasoning">automated reasoning</a> tool to propagate our domain expertise throughout the entirety of the data. This will enable us to ask questions of our knowledge graph and get the right answers with their explanations — where other traditional methods would fail.</li></ol><p>Having identified solutions to the previously listed challenges, I wondered whether there was any one technology out there, that encompassed all three points?</p><p>Well, to my luck, <a href="http://www.vaticle.com/"><strong>TypeDB</strong></a><strong><em> </em></strong>solves all of these problems.</p><p>If you’re unfamiliar with it, TypeDB is an intelligent database in the form of a knowledge graph which organises complex networks of data. It contains a <a href="https://blog.vaticle.com/modelling-data-with-hypergraphs-edff1e12edf0">knowledge representation</a> system based on <a href="https://en.wikipedia.org/wiki/Hypergraph">hyper-graphs</a>, enabling the modelling of any type of complex networks. This knowledge representation system is then interpreted by an automated reasoning engine, which performs reasoning in real-time. The software gets exposed to the user in the form of a flexible and easily understood query language —<a href="https://docs.vaticle.com/docs/schema/overview"> <strong>TypeQL</strong></a>.</p><h4>Building a Text Mined Knowledge Graph</h4><p>How do we actually go about building a text-mined knowledge graph using TypeDB?</p><p><strong>Step 1: Identify Text<br></strong>To get started, we first need to know what kind of text we are mining and want to store. In this article, I want to focus specifically on biomedical data. Therefore, the types of unstructured text data that I looked at included:</p><ol><li><a href="https://en.wikipedia.org/wiki/Medical_literature">Medical Literature</a></li><li><a href="https://en.wikipedia.org/wiki/Medical_test">Diagnostic Test Reports</a></li><li><a href="https://en.wikipedia.org/wiki/Electronic_health_record">Electronic Health Records</a></li><li><a href="https://en.wikipedia.org/wiki/Past_medical_history">Patient Medical History</a></li><li><a href="https://en.wikipedia.org/wiki/Clinical_study_report">Clinical Reports</a></li></ol><p>Out of the above listed text corpuses. I chose to look specifically into medical literature. Specifically, <a href="https://www.ncbi.nlm.nih.gov/pubmed/">PubMed</a> article abstracts.</p><p><strong>Step 2: Identify Text Mining/NLP Tool<br></strong>While looking into this space, I found it easy to integrate <a href="https://stanfordnlp.github.io/CoreNLP/index.html">Stanford’s CoreNLP</a> API to allow me to train and mine text. The script to mine text can be found on our GitHub repo <a href="https://github.com/vaticle/biograkn/tree/master/textmining">here</a>. Other tools that may be used instead may include: <a href="http://www.nltk.org/">NLTK</a>, <a href="https://textblob.readthedocs.io/en/dev/index.html">TextBlob</a>, <a href="https://radimrehurek.com/gensim/">gensim</a>, <a href="https://spacy.io/">spaCy</a>, <a href="https://www.ibm.com/watson/services/natural-language-understanding/">IBM Watson NLU</a>, <a href="https://www.ncbi.nlm.nih.gov/CBBresearch/Lu/Demo/PubTator/">PubTator</a>, <a href="https://www.ncbi.nlm.nih.gov/CBBresearch/Lu/Demo/LitVar/">LitVar</a>, <a href="https://github.com/ncbi-nlp/NegBio">NegBio</a>, <a href="http://opennlp.apache.org/">OpenNLP</a>, and <a href="https://en.wikipedia.org/wiki/BioCreative">BioCreative</a>.</p><p><strong>Step 3: Model Your Data<br></strong>Thanks to CoreNLP, we now have raw text-mined data, and we can move onto data modelling. To this end, TypeDB utilises the <a href="https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model">entity-relationship model</a> to group each concept into either an entity, attribute, or relationship. This means that all we have to do is map each concept to a <a href="https://docs.vaticle.com/docs/schema/concepts">schema concept type</a>, and recognise the relations between them. Let us look at an example to demonstrate how we would go about doing this.</p><p>In order to start modelling our CoreNLP output, we first need to know what it actually looks like. The most basic mining extracts sentences from a body of text. Those sentences have a sentiment, tokens (which make up the sentence), and relations between certain tokens. We also get a confidence measure of each type that the tool identifies. A visual representation of this is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*pDfI_Z3PZW5y_cbM5EaEDw.gif" /></figure><p>As we can see, the structure of our output is already graph-like. Traditional methods strive to encapsulate this rich information into tables, however that strips away a whole dimension of information and is counter-productive. It feels more natural to keep this graph-like structure to build an integrated complex knowledge graph of everything we have extracted from the text corpus.</p><p>We can easily map the output to <a href="https://docs.vaticle.com/docs/schema/overview">TypeQL</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*pUeLujHvWA6HtoJd3j56NA.png" /><figcaption>Schema: <a href="https://gist.github.com/Irtazaraza/b7e2e0053d8ab7f38bb680eb3d0f1d44">link to code</a></figcaption></figure><p>We start by recognising mined-text, sentence and token to be entities, having attributes such as text, sentiment, lemma and type. We can also see the roles they play in the relations we will define next.</p><p>We can identify two relations. One is a containing relation which is between something that is contained and something that is the container. We can look at the entities to see that the mined-text entity plays the container for a sentence, a sentence plays the contained with respect to the mined-text and as the container with respect to a token. Lastly, the token only plays the contained with respect to the sentence.</p><p>The second relation is the mined-relation which relates the tokens as objects or subjects and also has the contained relation to show which sentence that mined-relation was extracted from. The relation mined-relation also has an attribute type, to represent the type of relation.</p><p>Finally we also need to specify the datatypes of each attribute we have defined, which can be done as the last four lines of the the schema above.</p><p><strong>Step 4: Migrate into TypeDB<br></strong>Now that we have the data, and a structure imposed on this data, the next step is to migrate this into TypeDB to convert it into knowledge. Please note there are many different ways to do migration, but here I would like to specifically touch on how we would go about using <a href="https://docs.vaticle.com/docs/client-api/java">Java</a>, <a href="https://docs.vaticle.com/docs/client-api/nodejs">NodeJS</a> and <a href="https://docs.vaticle.com/docs/client-api/python">Python</a>.</p><p>For this, we can easily use any of these languages to insert instances of extracted information compliant with the schema we modelled. The image below depicts how to insert a single instance of a token with a lemma and type into TypeDB using any of these three languages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quDkzeqP_njtB8Rhe3jXDw.png" /></figure><p>To learn more about <a href="https://docs.vaticle.com/docs/examples/phone-calls-overview">migrating data</a> into TypeDB, make sure to read this <a href="https://blog.vaticle.com/modeling-migrating-big-biological-data-with-grakn-4c6bf5f94f17">article</a>.</p><p><strong>Step 5: Discover and Interpret New Insights<br></strong>After migration, we can start to discover new insights. Discovering insights refers to finding new data that may be valuable to what we are trying to accomplish. In order to do that, we need to first look or ask for something. In other words, we start with a question. These questions can range from simply asking within the text, or more complex questions regarding other data which is augmented by the text-mined output.</p><p>Let us look at some examples, and see how our text-mined knowledge graph may provide answers to them:</p><p><em>Question 1: What knowledge is extracted from a PubMed article?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*cUyt6RoYGENFPN4wiXLR1A.png" /><figcaption>TypeQl query 1</figcaption></figure><p><em>Answer 1:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMdLhqgbTQ4v1Xs6eF8thA.png" /><figcaption>Visual representation of response</figcaption></figure><p>The answers we get back are the various concepts that were mined from the abstract of the PubMed article we are interested in. The figure above shows an example of this where the entities extracted were:</p><ol><li>Gene — <em>BRAF</em></li><li>Drug — <em>Trametinib</em></li><li>Drug — <em>Dabrafenib</em></li><li>Disease — <em>Melanoma</em></li><li>Protein — <em>MEK</em><br> <br>We also can see some mined-relations that were extracted:</li><li>Inhibition — between <em>BRAF</em> and <em>Dabrafenib</em></li><li>Inhibition — between <em>MEK</em> and <em>Trametinib</em></li><li>Treatment — between <em>Dabrafenib</em> and <em>Melanoma</em></li><li>Treatment — between <em>Trametinib</em> and <em>Melanoma</em></li></ol><p>These entities and relations were extracted due to the training performed on our CoreNLP tool. More information regarding this can be found <a href="https://stanfordnlp.github.io/CoreNLP/ner.html">here</a>.</p><p>Let us now try asking a harder question:</p><p><em>Question 2: Which PubMed articles mention the disease Melanoma and the gene BRAF?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*hOwNv3BZZN3SIISTIKNoBA.png" /><figcaption>TypeQL query 2</figcaption></figure><p><em>Answer 2:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Uc-Pinfubx91_Cte--g2g.png" /><figcaption>Visual representation of response</figcaption></figure><p>The answer we receive from TypeDB is a list of all PubMed articles that match the condition provided. A great application of such a query can be proposed in the precision medicine domain where we want to link individual patients to medical literature relevant to their personal biological medical case. If you’re interested in precision medicine and knowledge graphs, check out this <a href="https://blog.vaticle.com/precision-medicine-knowledge-graph-eea957d60c08">article</a>.</p><p>These queries are useful, however it now begs the question — how can we leverage our text-mined knowledge graph to augment our existing knowledge? How can we use what we mined to expand our insights and apply them to other domains or fields in life sciences? The next question shows a demonstration of this:</p><p><em>Question 3: Which drug is related to the disease Melanoma?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*GbnIXsyE3aPAVnfi6eV18g.png" /><figcaption>TypeQL query 3</figcaption></figure><p><em>Answer 3:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*GeFHIDQKX5nyOO5qRplgyg.gif" /><figcaption>Response</figcaption></figure><p>Even though TypeDB gives us a correct answer to our question, this data was actually never ingested into TypeDB — no connections exist between diseases and drugs. So, how did we get this relevant answer?</p><p>In short — TypeDB’s automated reasoner created this answer for us through <a href="https://en.wikipedia.org/wiki/Automated_reasoning">automated reasoning</a>. As this type of reasoning is fully explainable, we can interpret any inferred concept to understand how it was inferred or created. Below you can see how this explanation looks like in <a href="https://docs.vaticle.com/docs/workbase/overview"><strong>Studio</strong></a>. In the next section, I will dive deeper into how we created the logic and rules that allowed TypeDB to infer these relationships.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*rc4_p9FhLxInpILJ7KIQYg.gif" /><figcaption>Explanation</figcaption></figure><p><strong>Interpreting our answer<br></strong>The relation we saw above, was the product of first order logic. This can be modelled as a <em>when</em> and <em>then</em> scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTNVXsc3K2csTCWK3fJ_-Q.png" /><figcaption>Reasoning</figcaption></figure><p>The <em>when</em> in this case refers to a sub-graph of our text-mined knowledge graph — i.e., whenever any sub-graph like the one on the left is found, the relation on the right is created.</p><p>This logic propagates throughout the knowledge graph creating new valuable connections, which is done by written rules in TypeQL. The rule that I used for the inference above, is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8daKSLrddYQgzrmR9tCm7Q.png" /><figcaption>Rule: treatment-rule</figcaption></figure><p>The above rule states that <em>when</em>:</p><ol><li>There exists a PubMed article $p with an abstract $a</li><li>There exists a sentence $s contained in abstract $a</li><li>There exists a mined-relation extracted from sentence $s which has the type “treatment”</li><li>The tokens taking part in that mined-relation have lemmas</li><li>Those lemmas have the same value as a drug and a disease</li></ol><p>If this is true, <em>then</em> create a treatment relation between the drug and disease. We can also see from the rule above that it is agnostic to the disease or drug, hence creating treatment relations between each drug and disease that match the given conditions.</p><p>It should be noted that the rule above is a demonstration of how automated reasoning can be used to create a high-level abstraction over complex insights which scale through the data. It by no means compares to the full implementation of how an end-user application would look like.</p><h4>How do all the Pieces Fit Together in one Architecture?</h4><p>Now, let us take a step back, and look at how all the components of building a text-mined knowledge graph piece together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uzbgc2SrejOgm-IyrvsV7w.png" /></figure><p>We start with the text, which can come from multiple sources and in various formats. An NLP tool is used to mine the text and produce some sort of output with a structure. That structure is used to create a <a href="https://docs.vaticle.com/docs/schema/overview">schema</a> (high-level data model) to enforce a structure on the raw NLP output. Once that is done, we use one of <a href="https://docs.vaticle.com/docs/client-api/overview">TypeDB’s clients</a> to migrate the instances of NLP output into TypeDB, making sure every insertion adheres to the schema. TypeDB stores this in its knowledge representation system, which can be queried for insights to discover complex concepts or even test out hypotheses. These insights may already be in the graph, or may even be created at the time of query by the reasoning engine; for example, discovering gene cluster identifications, protein interactions, gene-disease associations, protein-disease associations, drug-disease associations, patient matching, and even for clinical decision support.</p><h4>Conclusion</h4><p>So, we know that text mining<em> </em>is extremely promising in several domains, and in this article we have specifically looked at the biomedical domain. We understand that there is a lot of work required from the point of extracting information from text to actually discovering something useful. I hope to have shown that TypeDB can help to bridge that gap. In summary, TypeDB helps to solve the three key challenges in text mining when it comes to going beyond text mining:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGD8xNff2Rf2_wg8dnT4zA.png" /></figure><p>If you have any questions, comments or would like to collaborate, please shoot us an <a href="http://community@vaticle.com/">email</a>. You can also <a href="https://discord.com/invite/vaticle">talk to us</a> and <a href="https://forum.vaticle.com/">discuss</a> your ideas with the TypeDB community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ff207a7d850" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaticle/text-mined-knowledge-graphs-beyond-text-mining-1ff207a7d850">Text Mined Knowledge Graphs — Beyond Text Mining</a> was originally published in <a href="https://medium.com/vaticle">TypeDB</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use a Knowledge Graph for Precision Medicine]]></title>
            <link>https://medium.com/vaticle/precision-medicine-knowledge-graph-eea957d60c08?source=rss-9e7b7af4ffd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/eea957d60c08</guid>
            <category><![CDATA[biology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[biotechnology]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Syed Irtaza Raza]]></dc:creator>
            <pubDate>Thu, 21 Feb 2019 15:51:41 GMT</pubDate>
            <atom:updated>2022-05-20T10:45:17.682Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using a Knowledge Graph for Precision Medicine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAPwOcr0ktexON8TRX4pvg.jpeg" /></figure><p>One of the biggest challenges in our current state of medicine is to provide relevant, personalised, and precise diagnoses and treatments. Rather than treating all patients in the same way, the goal is to fully take into account a person’s demographics and genetic profile while treating or diagnosing them.</p><p>In a nutshell, the problem is that a large number of drugs and treatments prescribed to patients do not treat the individual patient, but rather the generic disease. This, in addition to the fact that not all treatments affect every patient in the same way, is something doctors are well aware of. Yet for decades, the strategy of trial and error has still been used to a large extent to treat and diagnose patients. Not the most reassuring of thoughts.</p><p>However, there is hope. Due to recent advancements in bioinformatics and genomic sequencing, <em>precision medicine </em>(also known as personalised medicine) is slowly becoming a reality rather than a dream.</p><p><a href="https://en.wikipedia.org/wiki/Precision_medicine">Precision medicine</a> is a nascent field focused on disease prevention and treatment while taking into account an individual’s variability in genes, environment, and lifestyle. It aims to integrate vast data sets to build predictive and preventive models of complex versatile diseases. Precision medicine may simply mean prescribing the right drug to the right patient, with the right dose at the right time. Or, it may entail matching patients to the relevant therapeutic treatments which are relevant to their individual biological make up.</p><p>The benefits that this brings means that precision medicine is getting us much closer to e.g., curing cancer, and predicting and preventing chronic diseases. In doing so, we may also be saving trillions of dollars to the health industry.</p><p>Though promising, there are still many challenges facing precision medicine. Some of these are related to the handling of the data which is needed to personalise medicine. In this article, I’ll look at these problems and propose how they can be solved using a <a href="http://www.vaticle.com/">TypeDB</a> knowledge graph.</p><h4>What are some Challenges in Precision Medicine?</h4><p>When approaching precision medicine, we are faced with a myriad of challenges — from obtaining correct and relevant data sources, all the way to validating our treatments and diagnoses. With this in mind, I have been particularly interested in how precision medicine data should be handled, and observed the following challenges:</p><p><strong>1. Integrating heterogeneous biological data is difficult<br></strong>The first challenge starts with the raw data. This data, which pertains to biological concepts and relationships, is scattered all over the world and is produced at an unprecedented rate, by a multitude of institutions, in various formats and standards. This is also known as the big data disruption paradigm, where high throughput data pipelines are creating bottlenecks to the analysis and processing of that data. It is extremely difficult to ingest and integrate these multi-format and disparate data sets.</p><p><strong>2. Normalising raw complex biological data is difficult<br></strong>The second challenge stems from the fact that the raw data contained in these data sets have no structure. This lack of structure makes it difficult to maintain and assure integrity, accuracy and consistency over this data. It also causes a lack of control over the validity of data when integrating such heterogeneous data sources.</p><p><strong>3. Discovering new and valuable insights is difficult<br></strong>Finally, due to the heterogeneous nature of the biological data necessary for precision medicine, it becomes extremely tedious to generate or investigate insights in a scalable way. Of course, one valuable insight might be discovered manually for a single instance of a disease or patient, but such an approach is impossible to scale across thousands of patients. Moreover, in many cases, a manual approach may actually be impossible. What do we do then?</p><h4><strong>What Solutions Address These challenges?</strong></h4><p>With this in mind, we need to find potential solutions to address these challenges. Based on my research, the below is what I suggest:</p><p><strong>1. Integrating heterogeneous biological data into one single database<br></strong>To solve the disparateness of heterogeneous data, we need a method to easily accumulate patient profiles and biological data into one collection —in other words, we need a knowledge graph.</p><p><strong>2. Normalising biological data using a contextual structure<br></strong>To enable the intelligent analysis and integration of such data — while maintaining data integrity — we need to impose an explicit structure on the concepts contained in that data. This will not only help to contextualise the concepts themselves, but also the relationships between them. This translates to having some sort of high-level data model to encompass the various types of data and consolidate their presence in the knowledge graph. This will also allow us to validate the data at the time of ingestion.</p><p><strong>3. Discovering new insights using automated reasoning<br></strong>In order to extract or infer as much information as possible from our knowledge graph, we need some sort of <a href="https://en.wikipedia.org/wiki/Automated_reasoning">automated reasoning</a> tool to propagate our domain expertise throughout the entirety of the data. This will enable us to ask questions of our knowledge graph and get the right answers — while other traditional methods would fail.</p><p>Having identified a template to the solutions of the previously listed challenges, I wondered whether there was any one technology out there, that encompassed all three points?</p><p>Well, to my luck, <a href="http://www.vaticle.com/"><strong>TypeDB</strong></a><strong><em> </em></strong>solves all of these.</p><p>If you’re unfamiliar with this technology, TypeDB is an intelligent database in the form of a knowledge graph which organises complex networks of data. It contains a knowledge representation system based on <a href="https://en.wikipedia.org/wiki/Hypergraph">hyper-graphs</a>, enabling the modelling of every complex biological relationship. This knowledge representation system is then interpreted by an automated reasoning engine, which performs reasoning in real-time. The software gets exposed to the user in the form of a flexible and easily understood query language — <a href="http://www.vaticle.com/"><strong>TypeQL</strong></a>.</p><h4>Building a Precision Medicine Knowledge Graph</h4><p>But how do we actually go about building a precision medicine knowledge graph using TypeDB?</p><p><strong>Identifying the Right Data<br></strong>Every data driven system needs to start with the data itself. As such, the first step is to identify the right types of data sources we need in order to go about personalising medicine.</p><p>There are two types of data we need. First, the data related to the personalised aspect, which may include the demographic and medical profile of the patients we plan on examining. These may include:</p><ol><li>Genes</li><li>Variants</li><li>Medical history</li><li>Age</li><li>Gender</li><li>Ethnicity</li><li>Electronic health records</li></ol><p>In order to investigate how the patient’s data correlates with medicine, we also need other types of biomedical data:</p><ol><li>Diseases</li><li>Drugs</li><li>Clinical trials</li><li>Medical literature</li></ol><p>Once we have identified the raw data we want for our application, we need to find reliable sources to retrieve the data from. The following lists some of the sources where one can download raw data pertaining to precision medicine:</p><ol><li><a href="https://www.ncbi.nlm.nih.gov/search/">NCBI</a></li><li><a href="http://www.disgenet.org/">DisGeNet</a></li><li><a href="https://oncokb.org/#/">OncoKB</a></li><li><a href="https://www.drugbank.ca/">DrugBank</a></li><li><a href="https://www.ncbi.nlm.nih.gov/pubmed/">PubMed</a></li><li><a href="https://clinicaltrials.gov/ct2/home">ClinicalTrails.gov</a></li><li><a href="https://www.clinicalgenome.org/">ClinGen</a></li><li><a href="https://www.pharmgkb.org/">PHARMGKB</a></li><li><a href="https://www.ncbi.nlm.nih.gov/clinvar/">ClinVar</a></li><li><a href="https://www.accessdata.fda.gov/scripts/cder/daf/">Drugs@FDA</a></li></ol><p><strong>Normalising Raw Data <br></strong>Now that we have raw data, we need to tackle the second problem — that of normalisation. To this end, TypeDB utilises the <a href="https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model">entity-relationship model</a> to group each concept into either an entity, attribute, or relationship. This means that all we have to do is map each concept to a <a href="https://docs.vaticle.com/docs/schema/concepts">schema concept type</a>, and recognise the relationships between them. Let us look at an example to demonstrate how we would go about doing this:</p><p>First, let us assume we have the following two raw data sets representing instances of people in one data set, and diseases in another:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjs1i5fPXnea_sJR6aVfqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQ2bCdUJhgvt70xwRcNqag.png" /></figure><p>In the “People” dataset, we can see that the fourth column refers to “disease”, giving us a diagnosis about the diseases a person has. In other words, the raw data shows a relationship between a person, who is linked with a disease through a diagnosis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joRlgYdaA0W5Ltbmmaif2w.png" /></figure><p>This structure can be represented using TypeQL as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*CEer1G69mNpmpaH0zVDZ-Q.png" /><figcaption><a href="https://gist.github.com/Irtazaraza/1029437fb988d36aa89ad2052fdc5211">link to code</a></figcaption></figure><p>We recognised a person and a disease as an entity, having certain attributes. Then, we defined a relationship between the disease and person that we called diagnosis: where the role-players in the relationships are the patient and diagnosed-disease.</p><p>In order to constrain the attributes of each concept we also need to denote what data type they adhere to. In this case, we defined four attributes: one attribute with datatype double, and three of string type.</p><p><strong>Migrating the Raw Data into TypeDB<br></strong>Now that we have the data, and a structure imposed on this data, the next step is to migrate this into TypeDB. Please note there are many different ways to do migration, but here I would like to specifically touch on how we would go about using <a href="https://docs.vaticle.com/docs/client-api/java">Java</a>, <a href="https://docs.vaticle.com/docs/client-api/nodejs">NodeJS</a> and <a href="https://docs.vaticle.com/docs/client-api/python">Python</a>.</p><p>For this, we can easily use any of these languages to read/parse the raw data file and iterate over each entry within those files. The image below depicts how to insert a single instance of a disease with a name and type into TypeDB using any of these three languages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwUEGZzq3GUXr89lYBZdwQ.png" /></figure><p>To learn more about <a href="https://docs.vaticle.com/docs/examples/phone-calls-overview">migrating data</a> into TypeDB, make sure to read this <a href="https://blog.vaticle.com/modeling-migrating-big-biological-data-with-grakn-4c6bf5f94f17">article</a>.</p><p><strong>Discovering a New Relevant Therapy for a Patient<br></strong>After migration, we can get started on discovering new insights. Discovering insights refers to finding new data that may be valuable to what we are trying to accomplish. In order to do that, we need to first look or ask for something. In other words, we start with a question — the questions we ask to find answers to in precision medicine. These questions can range from asking if a particular individual’s profile is susceptible to any disease, or which treatments are relevant to an individual’s biological make-up.</p><p>Let us look at an example, and see how our precision medicine knowledge graph may provide answers to them:</p><p><em>Question: Given a person suffering from melanoma, what clinical trial could be recommended to her/him?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPmBySIYpqCRfjJhbl-FgQ.png" /></figure><p><em>Answer:</em></p><p>The answer that TypeDB returns is a relationship called personalised-therapy, which connects a person and a clinical-trial. The clinical trial returned has information about the trial which we ingested in the graph; including its title (GSK1120212 vs Chemotherapy in Advanced or Metastatic BRAF V600E/K Mutation-positive Melanoma), intervention type (drug), and also a <a href="https://clinicaltrials.gov/ct2/show/NCT01245062">URL</a> to the trial page.</p><p>The response to this query can also be visualised in TypeDB Studio (<a href="https://docs.vaticle.com/docs/workbase/overview">Knowledge graph IDE</a>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CvpYWgi3Rh8ASxwRkaG5VQ.gif" /></figure><p>Even though TypeDB gives us a correct answer to our question, this data was actually never ingested into TypeDB— no connections exist between persons and clinical trials. So, how did we get this relevant answer?</p><p>In short, TypeDB’s automated reasoner created this answer for us through <a href="https://en.wikipedia.org/wiki/Automated_reasoning">automated reasoning</a>. As this type of reasoning is fully explainable, we can interpret any inferred concept to understand how it was inferred or created. Below you can see how this explanation looks like in <a href="https://docs.vaticle.com/docs/workbase/overview">Studio</a>. In the next section, I will dive deeper into how we created the logic and rules that allowed TypeDB to infer these relationships.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*VzJc-2uXxouuAC9F-Acx9g.gif" /></figure><p><strong>Forming Rules to Propagate Reasoning Over the Graph</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6TUJUjKdF_Ac4_5eJM4Sw.png" /><figcaption>Rule 1: personalised-patient-therapy. Creates the personalised therapy relationship.</figcaption></figure><p>The inferred relationship between a person and a clinical-trial was called a personalised-therapy, as is shown in rule 1: personalised-patient-therapy. This gets created when two other conditions (represented by relationships) are met:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*S5Wx4bY8tFNJnL0wSfiMaw.png" /><figcaption>Rule 2: trial-participant-eligibility. The person is <strong>eligible </strong>for the clinical trial.</figcaption></figure><p>First, the person must be <strong>eligible</strong> to take part in the clinical-trial (eligible-trial-participant). This is evaluated by another rule (rule 2: trial-participant-eligibility) which takes into consideration the patient’s age, gender and diagnosis, and compares it with the clinical-trial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fgT4paPrrKu1bYleEjMFg.png" /><figcaption>Rule 3: trial-participant-relevance. The person is <strong>relevant</strong> to the clinical trial.</figcaption></figure><p>Second, the person must be <strong>relevant</strong> to the trial. This is evaluated by rule 3, trial-participant-relevance, which checks that the title of the clinical trials contain the gene and variant symbol belonging to the person. This would indicate relevance between the individual person and the clinical-trial.</p><p>It should be noted that the rules above are a demonstration of how automated reasoning can be used to create a high level abstraction over complex insights which scale though the data. They by no means compare to the full knowledge of how a biologist would go about achieving such an insight.</p><p><strong>How do all the Pieces fit Together in one Architecture? <br></strong>Now, let us take a step back, and look at how all the components of building a precision medicine knowledge graph piece together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6VrUt6RiNO1anYaPa51qA.png" /></figure><p>We start with the data which can come from multiple sources and in various formats. That raw data is used to create a <a href="https://docs.vaticle.com/docs/schema/overview">schema</a> (high level data model) to enforce a structure on the raw data. Once that is done, we use one of <a href="https://docs.vaticle.com/docs/client-api/overview">TypeDB’s clients</a> to migrate the instances of data into TypeDB, making sure every insertion adheres to the schema. TypeDB stores this in its knowledge representation system, which can be queried for insights to discover complex relationships or even test out hypotheses. These insights may already be in the graph, or can even be created at the time of query by the reasoning engine; for example, discovering personalised diagnoses and therapies.</p><h4>Conclusion</h4><p>So we know that precision medicine<em> </em>is extremely promising in revolutionising global health care. We understand that there are barriers and bottlenecks associated with achieving it. I hope to have shown that TypeDB can help to bring us many steps closer to having precision medicine as the standard for health care. In summary, TypeDB helps to solve the three key challenges in precision medicine when it comes to handling data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGd6wSr2UafHkDaxzf4hAg.png" /></figure><p>If you have any questions, comments or would like to collaborate, please shoot us an email at community@vaticle.com. You can also <a href="http://www.vaticle.com/discord">talk to us</a> and <a href="https://forum.vaticle.com/">discuss</a> your ideas with the TypeDB community.</p><p><em>Grakn Labs was rebranded in 2021 to Vaticle; Grakn is now TypeDB, and Graql is now TypeQL.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eea957d60c08" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaticle/precision-medicine-knowledge-graph-eea957d60c08">How to Use a Knowledge Graph for Precision Medicine</a> was originally published in <a href="https://medium.com/vaticle">TypeDB</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modeling & Migrating Big Biological Data with Grakn]]></title>
            <link>https://medium.com/vaticle/modeling-migrating-big-biological-data-with-grakn-4c6bf5f94f17?source=rss-9e7b7af4ffd6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c6bf5f94f17</guid>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[systems-biology]]></category>
            <category><![CDATA[genomics]]></category>
            <category><![CDATA[biological-engineering]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Syed Irtaza Raza]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 19:31:03 GMT</pubDate>
            <atom:updated>2022-03-29T16:47:43.984Z</atom:updated>
            <content:encoded><![CDATA[<h3>Modelling &amp; Migrating Big Biological Data with Grakn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AwvSD0fO-AqWDuCXqLa9Dg.jpeg" /></figure><p>Welcome to the <a href="https://en.wikipedia.org/wiki/Multiomics">multi-omics</a> age of biological big data. Where data about a myriad of biological systems, all interacting with one another, is being collected. The data may represent <a href="https://en.wikipedia.org/wiki/Genome">genomes</a>, <a href="https://en.wikipedia.org/wiki/Proteome">proteomes</a>, <a href="https://en.wikipedia.org/wiki/Epigenome">epigenomes</a>, <a href="https://en.wikipedia.org/wiki/Metabolome">metabolomes</a>, <a href="https://en.wikipedia.org/wiki/Transcriptome">transcriptoms</a>, <a href="https://en.wikipedia.org/wiki/Biological_pathway">biological pathways</a>, diseases, drugs, published articles, imaging and even medical and clinical data. There is no doubt in the immense value of this tremendous amount of growing data.</p><p>Biological data is being accumulated all over the world from various organisations. Some examples include; <a href="https://www.ncbi.nlm.nih.gov/search/">NCBI</a>, <a href="https://www.nlm.nih.gov/NIHbmic/nih_data_sharing_repositories.html">NIH</a>, <a href="http://www.internationalgenome.org/data">1000 Genomes</a>, <a href="https://www.ensembl.org/index.html">Ensemble Genomes</a>, <a href="https://www.ncbi.nlm.nih.gov/geo/">Gene Expression Omnibuss</a>, <a href="http://geneontology.org/page/download-go-annotations">Gene Ontology</a>, <a href="https://github.com/jhpoelen/eol-globi-data/wiki#accessing-species-interaction-data">Global Biotic Interactions</a>, <a href="http://www.hagsc.org/hgdp/files.html">Human Genome Diversity Project</a>, <a href="https://www.genome.jp/kegg/">KEGG</a>, <a href="https://reactome.org/">Reactome</a>, <a href="http://www.broadinstitute.org/cgi-bin/cancer/datasets.cgi">MIT Cancer Genomics Data</a>, <a href="https://gdc.cancer.gov/access-data/gdc-data-portal">NCI</a>, <a href="http://www.rcsb.org/">Protein Data Bank</a>, <a href="https://www.drugbank.ca/">Drug Bank</a>, <a href="http://www.disgenet.org/">DisGeNet</a>, <a href="http://www.dgidb.org/">The Drug Gene Interaction Database</a>, <a href="https://pubchem.ncbi.nlm.nih.gov/">PubChem Project</a>, <a href="https://gdac.broadinstitute.org/">The Cancer Genome Atlas</a>, and <a href="https://www.uniprot.org/">UniProt</a>.</p><p>However, dealing with these terabytes and petabytes of data comes with its own challenges; how to accumulate data from heterogeneous sources, how to handle the complexity of their interactions and how to standardise the structure of the complex data. The solution? <a href="http://www.vaticle.com/"><strong>Grakn</strong></a>.</p><p>I’ve been working on various projects utilising some of the above data sources and encountered the following methodology to cater to various formats (e.g. CSV, JSON, XML) and disparateness of the data. (Inspired by the migration tutorial <a href="https://blog.grakn.ai/loading-data-into-a-grakn-knowledge-graph-using-the-java-client-5f2f1a7f9903">here</a>)</p><ol><li><strong>First, model the data into a single structured architecture — a schema.</strong></li><li><strong>Then, migrate the data into a single place — a knowledge graph.</strong></li></ol><h4><strong>1. Modelling</strong></h4><p>Let’s look at how this can be done using the following example datasets:</p><p>The first is the <strong>“disease_names”</strong> dataset from <a href="https://www.ncbi.nlm.nih.gov/clinvar/">NCBI ClinVar</a> which lists diseases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uBrKBcV4zXcGEbx8g1TIw.png" /><figcaption>sample data</figcaption></figure><p>The second is the <strong>“curated_gene_disease_associations”</strong> from <a href="http://www.disgenet.org/">DisGeNet</a> containing relationships between diseases and genes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQhAu6zdmMHT2yHN2Piv6A.png" /><figcaption>sample data</figcaption></figure><p>The Grakn schema for the above data would look like the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6300567f5e2ac3d47fe5a713777ff12/href">https://medium.com/media/a6300567f5e2ac3d47fe5a713777ff12/href</a></iframe><p>We can visualise the schema using <a href="https://dev.grakn.ai/docs/workbase/overview">Grakn’s Knowledge graph IDE — Workbase</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLU2Qwu0-8aGUqCqJj771w.png" /></figure><p>For a detailed documentation of a Grakn schema, refer to the documentation <a href="https://dev.grakn.ai/docs/schema/overview">here</a>. Another useful example of schema modelling is available <a href="https://dev.grakn.ai/docs/examples/phone-calls-schema">here</a>.</p><h4>2. Migrating</h4><p>To migrate your data instances we can use the following java migration script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f07c98e768d5d184d223532539b7958/href">https://medium.com/media/7f07c98e768d5d184d223532539b7958/href</a></iframe><p>For a detailed tutorial for migrating data you can refer to the following documentation:</p><ol><li><a href="https://dev.grakn.ai/docs/examples/phone-calls-migration-nodejs">Node.js example</a></li><li><a href="https://dev.grakn.ai/docs/examples/phone-calls-migration-java">Java example</a></li><li><a href="https://dev.grakn.ai/docs/examples/phone-calls-migration-python">Python example</a></li></ol><p>If you have any questions, comments or would like to collaborate, please shoot me an email at syed@grakn.ai or reach out through <a href="https://www.linkedin.com/in/s-i-r/">linkedin</a>. You can also <a href="https://grakn.ai/slack">talk to us</a> and <a href="https://discuss.grakn.ai/">discuss</a> your ideas with the Grakn community.</p><p>Thank you. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c6bf5f94f17" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaticle/modeling-migrating-big-biological-data-with-grakn-4c6bf5f94f17">Modeling &amp; Migrating Big Biological Data with Grakn</a> was originally published in <a href="https://medium.com/vaticle">TypeDB</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>