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
library(igraph) | |
library(colorBreweR) | |
g <- watts.strogatz.game(1, 100, 5, 0.05) | |
V(g)$degree <- degree(g) | |
V(g)$betweenness <- betweenness(g) | |
V(g)$closeness <- closeness(g) | |
V(g)$eigen <- eigen_centrality(g)$vector |
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
library(igraph) | |
g <- watts.strogatz.game(1, 100, 5, 0.05) | |
#g <- erdos.renyi.game(100, 3/100) | |
plot(g, vertex.size=2, vertex.label=NA) | |
# Calculate edge betweenness | |
eb <- cbind(E(g),edge_betweenness(g)) | |
ebt <- eb[order(eb[,2], decreasing = T),] | |
head(ebt) |
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
source | target | |
---|---|---|
A1 | A2 | |
A2 | A3 | |
A2 | A4 |
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
<html> | |
<head> | |
<style> | |
.node { | |
stroke: #fff; | |
stroke-width: 1.5px; | |
} | |
.link { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function initializeNodes(n) { | |
var arr = []; | |
for (var i = 0; i < n; i++) { | |
arr.push({id:i}); | |
} | |
return arr; | |
} | |
function getRandomArbitrary(min, max) { |
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
var myvar = { | |
"hits": [ | |
{ | |
"_id": "chr1:g.218631822G>A", | |
"_score": 17.48471, | |
"dbsnp": { | |
"allele_origin": "unspecified", | |
"alleles": [ | |
{ | |
"allele": "G", |
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
//constants | |
var K_r = 60; | |
var L = 50; | |
var delta_t = 0.4; | |
var MAX_DISP_SQ = 20; | |
var width = 300; | |
var height = width; | |
var body = d3.select('body'); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>title</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var margin = {"left":20, "top":10, "right":20, "bottom":20} |
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
[ | |
{ | |
"Encoding" : "placement-position", | |
"Ordered" : "true", | |
"UsefulVales" : "inf", | |
"Quantitative" : "true", | |
"Ordinal" : "true", | |
"Categorical" : "true", | |
"Relational" : "true" | |
}, |