|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- <!DOCTYPE html>
- <html lang="" xml:lang="">
- <head>
- <title>Graphes</title>
- <meta charset="utf-8" />
- <meta name="author" content="Maxime Wack" />
- <script src="libs/header-attrs-2.1/header-attrs.js"></script>
- <link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
- <script src="libs/htmlwidgets-1.5.1/htmlwidgets.js"></script>
- <script src="libs/jquery-1.12.4/jquery.min.js"></script>
- <link href="libs/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet" />
- <script src="libs/datatables-binding-0.13/datatables.js"></script>
- <link href="libs/dt-core-1.10.20/css/jquery.dataTables.min.css" rel="stylesheet" />
- <link href="libs/dt-core-1.10.20/css/jquery.dataTables.extra.css" rel="stylesheet" />
- <script src="libs/dt-core-1.10.20/js/jquery.dataTables.min.js"></script>
- <link href="libs/crosstalk-1.1.0.1/css/crosstalk.css" rel="stylesheet" />
- <script src="libs/crosstalk-1.1.0.1/js/crosstalk.min.js"></script>
- <link rel="stylesheet" href="css/my_style.css" type="text/css" />
- </head>
- <body>
- <textarea id="source">
-
-
-
-
- class: center, middle, title
-
- # UE Visualisation
-
- ### 2020-2021
-
- ## Dr. Maxime Wack
-
- ### AHU Informatique médicale
- #### Hôpital Européen Georges Pompidou, </br> Université de Paris
-
- ---
- # Graphe bipartite
-
- .pull-left[
- ### Graphe contenant deux sets de sommets **complèment déconnectés**
- ### Dit aussi 2-coloriable
- ]
-
- .pull-right[
- ![](06-img/bipartite.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/71.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/72.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/73.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/74.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/75.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/76.png)
- ]
-
- ---
- # Projection
-
- .pull-left[
- ### Méthode permettant de créer **deux** graphes
- ### Les sommets d'une partie sont connectés s'ils partagent un sommet d'une autre partie
- ]
-
- .pull-right[
- ![](06-img/77.png)
- ]
-
- ---
- class:center
- # Projection
-
- .pull-right[
- ![](06-img/bipartite.png)
- ]
-
- ---
- class:center
- # Projection
-
- .pull-left[
- ![](06-img/numbered_.png)
- ]
-
- .pull-right[
- ![](06-img/bipartite.png)
- ]
-
- ---
- class:center
- # Projection
-
- .pull-c1[
- ![](06-img/numbered_.png)
- ]
-
- .pull-c2[
- ![:scale 75%](06-img/bipartite.png)
- ]
-
- --
- .pull-c3[
- ![:scale 65%](06-img/projection.png)
- ]
-
- ---
-
- # OMIM
-
- *Online Mendelian Inheritance in Men*
-
- Base de données d'associations connues gène ↔ phénotype
-
- https://omim.org
-
- https://maximewack.com/files/OMIM.csv
-
- ---
- class: center
- # The Human Disease Network
-
- https://www.ncbi.nlm.nih.gov/pubmed/17502601
-
- ![:scale 90%](06-img/HDN_principe.png)
-
- ---
- class: center
- # The Human Disease Network
-
- https://www.ncbi.nlm.nih.gov/pubmed/17502601
-
- ![:scale 90%](06-img/HDN.png)
-
- ---
- # Librairies
-
-
- ```r
- library(igraph)
- library(ggraph)
- library(tidyverse)
- ```
-
- ---
- class:center,middle
- # igraph
-
- ---
-
- # Créer des graphes
-
-
- ```r
- # Graphe sans arête
- graph.empty(n = 10, directed = T)
-
- # Graphe complètement connecté
- graph.full(n = 10, directed = F, loops = F)
-
- # Graphe en étoile
- graph.star(n = 10, mode = "out")
- ```
-
- ---
- # Chargement du graphe
-
-
-
- ```r
- read_csv("lab06-data/OMIM.csv") -> OMIM
- ```
-
- <div id="htmlwidget-4e9bb6da534171530ca8" style="width:100%;height:auto;" class="datatables html-widget"></div>
- <script type="application/json" data-for="htmlwidget-4e9bb6da534171530ca8">{"x":{"filter":"none","data":[["ACYL-CoA DEHYDROGENASE, SHORT-CHAIN, DEFICIENCY OF","ADAMS-OLIVER SYNDROME 1","ADAMS-OLIVER SYNDROME 2","ADAMS-OLIVER SYNDROME 3","ADENINE PHOSPHORIBOSYLTRANSFERASE DEFICIENCY","LUNG CANCER","LUNG CANCER","LUNG CANCER","LUNG CANCER","LUNG CANCER","LUNG CANCER"],["ACADS","ARHGAP31","DOCK6","RBPJ","APRT","CYP2A6","EGFR","TNFSF6","IRF1","BRAF","ERBB2"]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th>Disease<\/th>\n <th>Gene<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"paging":false,"search":false,"info":false,"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
-
- ---
- # Chargement du graphe
-
-
- ```r
- graph.data.frame(OMIM, directed = F) -> graphe
- ```
-
-
- ```
- ## IGRAPH 1a34d81 UN-- 6288 4234 --
- ## + attr: name (v/c)
- ## + edges from 1a34d81 (vertex names):
- ## [1] ADRENAL HYPERPLASIA, CONGENITAL, DUE TO 17-ALPHA-HYDROXYLASE DEFICIENCY--CYP17A1
- ## [2] 17-BETA-HYDROXYSTEROID DEHYDROGENASE X DEFICIENCY --HSD17B10
- ## [3] 2-METHYLBUTYRYL-CoA DEHYDROGENASE DEFICIENCY --ACADSB
- ## [4] THREE M SYNDROME 1 --CUL7
- ## [5] THREE M SYNDROME 2 --OBSL1
- ## [6] 3-METHYLCROTONYL-CoA CARBOXYLASE 1 DEFICIENCY --MCCC1
- ## [7] 3-METHYLCROTONYL-CoA CARBOXYLASE 2 DEFICIENCY --MCCC2
- ## + ... omitted several edges
- ```
- ---
- # Informations sur le graphe
-
- ### Sommets
-
-
- ```r
- vcount(graphe)
- ```
-
- ```
- ## [1] 6288
- ```
- ### Arêtes
-
-
- ```r
- ecount(graphe)
- ```
-
- ```
- ## [1] 4234
- ```
-
- ---
- # Informations sur le graphe
-
- ### Dirigé ?
-
-
- ```r
- is.directed(graphe)
- ```
-
- ```
- ## [1] FALSE
- ```
-
- ### Voisins d'un sommet
-
-
- ```r
- neighbors(graphe, V(graphe)[2019])
- ```
-
- ```
- ## + 1/6288 vertex, named, from 1a34d81:
- ## [1] SLC25A3
- ```
-
- ---
- # Projection
-
-
- ```r
- # Établir les types (gène, phénotype)
- V(graphe)$type <- bipartite.mapping(graphe)$type
-
- # Créer les projections
- projs <- bipartite.projection(graphe)
-
- # Séparer les projections en deux graphes
- HDN <- projs$proj1
- HGN <- projs$proj2
- ```
- ---
-
- # HDN
-
-
- ```r
- HDN
- ```
-
- ```
- ## IGRAPH de908b5 UNW- 3512 2839 --
- ## + attr: name (v/c), weight (e/n)
- ## + edges from de908b5 (vertex names):
- ## [1] 17-BETA-HYDROXYSTEROID DEHYDROGENASE X DEFICIENCY--MENTAL RETARDATION, X-LINKED 17
- ## [2] 17-BETA-HYDROXYSTEROID DEHYDROGENASE X DEFICIENCY--MENTAL RETARDATION, X-LINKED, SYNDROMIC 10
- ## [3] 3-HYDROXYACYL-CoA DEHYDROGENASE DEFICIENCY --HYPERINSULINEMIC HYPOGLYCEMIA, FAMILIAL, 4
- ## [4] 3-METHYLGLUTACONIC ACIDURIA, TYPE III --OPTIC ATROPHY 3, AUTOSOMAL DOMINANT
- ## [5] 46,XX SEX REVERSAL 1 --46,XY SEX REVERSAL 1
- ## + ... omitted several edges
- ```
- ---
-
- # HGN
-
-
- ```r
- HGN
- ```
-
- ```
- ## IGRAPH 54560af UNW- 2776 2810 --
- ## + attr: name (v/c), weight (e/n)
- ## + edges from 54560af (vertex names):
- ## [1] AKR1C2--AKR1C4 LMNA --MYBPC3 LMNA --ZMPSTE24 GNAS --SSTR5
- ## [5] GNAS --AIP GNAS --STX16 GNAS --GNASAS1 COL2A1--COL11A2
- ## [9] FGFR3 --KRAS FGFR3 --HRAS FGFR3 --RB1 FGFR3 --PIK3CA
- ## [13] FGFR3 --AKT1 FGFR3 --APC FGFR3 --TP53 FGFR3 --NRAS
- ## [17] FGFR3 --FLCN FGFR3 --MLH3 FGFR3 --ODC1 FGFR3 --CCND1
- ## [21] FGFR3 --PLA2G2A FGFR3 --PTPRJ FGFR3 --EP300 FGFR3 --BUB1B
- ## [25] FGFR3 --TLR2 FGFR3 --TLR4 FGFR3 --AURKA FGFR3 --BCL10
- ## [29] FGFR3 --AXIN2 FGFR3 --PDGFRL FGFR3 --KIT FGFR3 --STK11
- ## + ... omitted several edges
- ```
- ---
-
- # Décomposition en sous-graphes
-
-
- ```r
- HDN %>%
- decompose -> diseases
- ```
- ---
-
- # ggraph
-
-
- ```r
- graph_one <- function(graph)
- {
- ggraph(graph) +
- geom_edge_diagonal() +
- geom_node_label(aes(label = name))
- }
- ```
-
- ---
-
- # Filtrer sous-graphes < 10 sommets
-
-
- ```r
- diseases %>%
- keep(map_dbl(diseases, vcount) >= 10) %>%
- map(graph_one) -> plots
- ```
- ---
-
- # Malformations cardiaques
-
-
- ```r
- plots[[5]]
- ```
-
- ![](lab06-graphes_files/figure-html/cardiaques-1.png)<!-- -->
- ---
- # Surdités
-
-
- ```r
- plots[[9]]
- ```
-
- ![](lab06-graphes_files/figure-html/surdités-1.png)<!-- -->
- ---
- # Ostéogénèses imparfaites
-
-
- ```r
- plots[[12]]
- ```
-
- ![](lab06-graphes_files/figure-html/Ostéogénèses-1.png)<!-- -->
- ---
-
- # Export
-
-
- ```r
- write.graph(HDN, file = "diseases.graphml", format = "graphml")
- write.graph(HGN, file = "genes.graphml", format = "graphml")
- ```
- </textarea>
- <style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
- <script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
- <script src="addons/macros.js"></script>
- <script>var slideshow = remark.create({
- "ratio": "4:3",
- "countIncrementalSlides": false,
- "self-contained": true,
- "highlightLines": true
- });
- if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
- window.dispatchEvent(new Event('resize'));
- });
- (function(d) {
- var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
- if (!r) return;
- s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
- d.head.appendChild(s);
- })(document);
-
- (function(d) {
- var el = d.getElementsByClassName("remark-slides-area");
- if (!el) return;
- var slide, slides = slideshow.getSlides(), els = el[0].children;
- for (var i = 1; i < slides.length; i++) {
- slide = slides[i];
- if (slide.properties.continued === "true" || slide.properties.count === "false") {
- els[i - 1].className += ' has-continuation';
- }
- }
- var s = d.createElement("style");
- s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
- d.head.appendChild(s);
- })(document);
- // delete the temporary CSS (for displaying all slides initially) when the user
- // starts to view slides
- (function() {
- var deleted = false;
- slideshow.on('beforeShowSlide', function(slide) {
- if (deleted) return;
- var sheets = document.styleSheets, node;
- for (var i = 0; i < sheets.length; i++) {
- node = sheets[i].ownerNode;
- if (node.dataset["target"] !== "print-only") continue;
- node.parentNode.removeChild(node);
- }
- deleted = true;
- });
- })();
- (function() {
- "use strict"
- // Replace <script> tags in slides area to make them executable
- var scripts = document.querySelectorAll(
- '.remark-slides-area .remark-slide-container script'
- );
- if (!scripts.length) return;
- for (var i = 0; i < scripts.length; i++) {
- var s = document.createElement('script');
- var code = document.createTextNode(scripts[i].textContent);
- s.appendChild(code);
- var scriptAttrs = scripts[i].attributes;
- for (var j = 0; j < scriptAttrs.length; j++) {
- s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
- }
- scripts[i].parentElement.replaceChild(s, scripts[i]);
- }
- })();
- (function() {
- var links = document.getElementsByTagName('a');
- for (var i = 0; i < links.length; i++) {
- if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
- links[i].target = '_blank';
- }
- }
- })();
- // adds .remark-code-has-line-highlighted class to <pre> parent elements
- // of code chunks containing highlighted lines with class .remark-code-line-highlighted
- (function(d) {
- const hlines = d.querySelectorAll('.remark-code-line-highlighted');
- const preParents = [];
- const findPreParent = function(line, p = 0) {
- if (p > 1) return null; // traverse up no further than grandparent
- const el = line.parentElement;
- return el.tagName === "PRE" ? el : findPreParent(el, ++p);
- };
-
- for (let line of hlines) {
- let pre = findPreParent(line);
- if (pre && !preParents.includes(pre)) preParents.push(pre);
- }
- preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
- })(document);</script>
-
- <script>
- slideshow._releaseMath = function(el) {
- var i, text, code, codes = el.getElementsByTagName('code');
- for (i = 0; i < codes.length;) {
- code = codes[i];
- if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
- text = code.textContent;
- if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
- /^\$\$(.|\s)+\$\$$/.test(text) ||
- /^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
- code.outerHTML = code.innerHTML; // remove <code></code>
- continue;
- }
- }
- i++;
- }
- };
- slideshow._releaseMath(document);
- </script>
- <!-- dynamically load mathjax for compatibility with self-contained -->
- <script>
- (function () {
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
- if (location.protocol !== 'file:' && /^https?:/.test(script.src))
- script.src = script.src.replace(/^https?:/, '');
- document.getElementsByTagName('head')[0].appendChild(script);
- })();
- </script>
- </body>
- </html>
|