-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
252 additions
and
1,232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"editor.defaultFormatter": "ms-python.black-formatter" | ||
}, | ||
"python.formatting.provider": "none" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,29 @@ | ||
You can explore and visualise how undirected population-based hypergraphs are built from multiple fictitious patients in the | ||
You can explore and visualise how undirected population-based hypergraphs are built from multiple fictitious patients in the | ||
`Undirected Hypergraph` tab at the top of this page. | ||
|
||
#### Directed B-Hypergraphs | ||
|
||
Directed hypergraphs expand on undirected hypergraphs, but have the advantage that they can represent directionality between | ||
Directed hypergraphs expand on undirected hypergraphs, but have the advantage that they can represent directionality between | ||
relationships i.e. the sequence in which conditions occur in patients. | ||
|
||
A directed hypergraph $\mathcal{H}_D(V, \mathcal{E})$ is a collection of nodes stored in $V = \{v_1, \dots, v_n\}$, and hyperarcs, | ||
A directed hypergraph $\mathcal{H}_D(V, \mathcal{E})$ is a collection of nodes stored in $V = \{v_1, \dots, v_n\}$, and hyperarcs, | ||
$\mathcal{E} = \{e_1, \dots,e_m\}$. Each hyperarc $e_i = \langle T(e_i), H(e_i)\rangle$ where $T(e_i), H(e_i) \subseteq V$ represents | ||
a collection of nodes such that those $v_i \in T(e_i)$ are the tails of the hyperarc and those $v_j \in H(e_i)$ are the heads of | ||
the hyperarc. | ||
a collection of nodes such that those $v_i \in T(e_i)$ are the tails of the hyperarc and those $v_j \in H(e_i)$ are the heads of | ||
the hyperarc. | ||
|
||
There are various types of directed hypergraphs, B-hypergraphs, F-hypergraphs, and BF-hypergraphs to name a few. | ||
B-hypergraphs are restricted to have only one head node for each hyperarc, but can have unlimited tail nodes. For example, someone | ||
might have disease $C$ and $A$ (tail nodes) and then gain disease $B$ (head node) (see visual below). In the opposite case, | ||
B-hypergraphs are restricted to have only one head node for each hyperarc, but can have unlimited tail nodes. For example, someone | ||
might have disease $C$ and $A$ (tail nodes) and then gain disease $B$ (head node) (see visual below). In the opposite case, | ||
F-hypergraphs can have only one tail node but unlimited head nodes. BF-hypergraphs have no restriction on the number of tail or head | ||
nodes. | ||
|
||
We chose to use B-hypergraphs due to the computational complexity being high in the BF-hypergraph variation and because the | ||
clinical way that conditions tend to aggregate can be well represented with B-hypergraphs. However, we do appreciate the | ||
limitation here that someone may gain two diseases simultaneously, which could be better represented using BF-hypergraphs, but we | ||
We chose to use B-hypergraphs due to the computational complexity being high in the BF-hypergraph variation and because the | ||
clinical way that conditions tend to aggregate can be well represented with B-hypergraphs. However, we do appreciate the | ||
limitation here that someone may gain two diseases simultaneously, which could be better represented using BF-hypergraphs, but we | ||
apply a workaround to this. This is out of the scope of this dashboard, but further information can be found in an upcoming | ||
publication and code base. | ||
|
||
Undirected, parent hyperedges give rise to children hyperarcs (directed hyperedges). Sibling hyperarcs are hyperarcs which have the | ||
same parent hyperedge and thus have the same set of nodes as the hyperarc in question. An example of a hyperarc with its siblings | ||
and parent hyperedge are shown in the image below. You can explore and visualise how directed hypergraphs are built from multiple | ||
and parent hyperedge are shown in the image below. You can explore and visualise how directed hypergraphs are built from multiple | ||
fictitious patients in the `Directed Hypergraph` tab at the top of this page. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
_What are graphs and hypergraphs and why do we want to use them?_ | ||
Using hypergraphs enables more complexities and relationships from the data to be included. | ||
_Why?_ Let's start by describing __undirected graphs__, __directed graphs__, __undirected hypergraphs__ and __directed | ||
hypergraphs__. | ||
Using hypergraphs enables more complexities and relationships from the data to be included. | ||
_Why?_ Let's start by describing __undirected graphs__, __directed graphs__, __undirected hypergraphs__ and __directed | ||
hypergraphs__. | ||
|
||
Graphs are very good at structuring interactivity and networks, which makes them particularly useful in healthcare where healthcare | ||
Graphs are very good at structuring interactivity and networks, which makes them particularly useful in healthcare where healthcare | ||
data can be sparse. | ||
|
||
A standard graph $\mathcal{G}(v,e)$ can connect only 2 objects/nodes ($v$) with one edge ($e$). Only pairwise connections can exist. | ||
|
||
Graphs can be directed or undirected. Directed graphs give directionality to node interactions. For a temporal example lets imagine | ||
$node_1$ is diabetes which could happen prior to $node_2$ which is chronic kidney disease, directionality shows the temporal order | ||
Graphs can be directed or undirected. Directed graphs give directionality to node interactions. For a temporal example lets imagine | ||
$node_1$ is diabetes which could happen prior to $node_2$ which is chronic kidney disease, directionality shows the temporal order | ||
or sequence of events. | ||
Alternatively, in an undirected graph edges connecting two nodes/diseases simply imply there is a relationship between the two. | ||
Here we should emphasize that standard graphs only enable __pairwise__ relationships to be represented. | ||
|
||
|
||
Graphs have the benefit of allowing extra information to be stored in the nodes or edges, these can be weights or attributes. For | ||
example, you may wish to store more details about a condition within a node or the elapsed time between disease contraction within | ||
Graphs have the benefit of allowing extra information to be stored in the nodes or edges, these can be weights or attributes. For | ||
example, you may wish to store more details about a condition within a node or the elapsed time between disease contraction within | ||
an edge. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
### Purpose of This Applet | ||
|
||
The model shown in this applet builds upon the work carried out in Rafferty et al., 2021. | ||
This Streamlit applet can be used to learn about how the hypergraphs multimorbidity model works with fictitious patient data. | ||
It provides test cases to allow users to understand the model and apply the `hypergraphs_mm` package to their own data | ||
This Streamlit applet can be used to learn about how the hypergraphs multimorbidity model works with fictitious patient data. | ||
It provides test cases to allow users to understand the model and apply the `hypergraphs_mm` package to their own data | ||
(the `hypergraph-mm` package is currently held within a private NHSX GitHub repository but will soon become available publically and as a PyPI package). | ||
It aims to explain graphs and hypergraphs in a health setting. It can be used to demonstrate the complexity of different types of | ||
It aims to explain graphs and hypergraphs in a health setting. It can be used to demonstrate the complexity of different types of | ||
graphs (left sidebar 'Show Maximum Number of Edges'). | ||
This website gives a interactive walkthrough of how to calulcate hyperedge weights, hyperarc weights, undirected hypergraph centrality, | ||
transition matrices and PageRank. The user can navigate between the pages using the tabs `Undirected Hypergraph`, `Directed Hypergraph` | ||
This website gives a interactive walkthrough of how to calulcate hyperedge weights, hyperarc weights, undirected hypergraph centrality, | ||
transition matrices and PageRank. The user can navigate between the pages using the tabs `Undirected Hypergraph`, `Directed Hypergraph` | ||
and `Successors` at the top of each page. | ||
It demonstrates a method to draw B-hypergraphs using the NetworkX package, where psuedonodes are used for hyperarc tails to | ||
transition to hyperarc heads. | ||
It demonstrates a method to draw B-hypergraphs using the NetworkX package, where psuedonodes are used for hyperarc tails to | ||
transition to hyperarc heads. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
This applet randomly generates a set of fictious 'patients' and their disease | ||
pathways to demonstrate the use of hypergraphs in understanding multimorbidity. The | ||
sidebar on the left of this page can be used to change the number of 'patients' to | ||
This applet randomly generates a set of fictious 'patients' and their disease | ||
pathways to demonstrate the use of hypergraphs in understanding multimorbidity. The | ||
sidebar on the left of this page can be used to change the number of 'patients' to | ||
generate and the maximum number of diseases to include in their pathways. | ||
In changing the number of patients and diseases, the outputs will change | ||
and this is purposeful to enable you to observe how population alterations result in different outcomes. | ||
In changing the number of patients and diseases, the outputs will change | ||
and this is purposeful to enable you to observe how population alterations result in different outcomes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "cython"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.