Built with blockbuilder.org
Last active
April 10, 2018 15:53
-
-
Save greenmna/0785a30d640e733efb747f320ed1bf64 to your computer and use it in GitHub Desktop.
Bubbles for realskiezzzzz
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
license: mit |
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
Isolate | Source | Serotype | AMR_Phenotype | MLST | rMLST | cgMLST | wgMLST | gene_number | |
---|---|---|---|---|---|---|---|---|---|
HJ1 | Muddy Creek | Give | - | 654 | New | 80760 | 118467 | 0 | |
HJ2 | Muddy Creek | Give | - | 654 | New | 80760 | 94902 | 0 | |
HJ3 | Pleasant Run | Uganda | Strep Sulf Tet | 684 | 8441 | 80845 | 94997 | 0 | |
HJ4 | Pleasant Run | Uganda | - | 684 | 8441 | 70491 | 94903 | 0 | |
HJ5 | Cook's Creek Rt. 11 | Litchfield | - | 214 | 7970 | 80915 | 95074 | 0 | |
HJ6 | Cook's Creek Rt. 11 | Schwarzengrund | - | 96 | 1430 | 80849 | 95001 | 0 | |
HJ7 | Pleasant Run | Muenster | Strep Sulf Tet | 321 | 3730 | 80796 | 94943 | 4 | |
HJ8 | Pleasant Run | Muenster | Strep Sulf Tet | 321 | 3730 | 80796 | 94954 | 4 | |
HJ9 | Cook's Creek Rt. 704 | Mbandaka | - | 413 | 3668 | 80794 | 94941 | 0 | |
HJ10 | Muddy Creek | Anatum | Tet | 64 | 3700 | 80537 | 94650 | 1 | |
HJ11 | Cook's Creek Rt. 704 | Schwarzengrund | - | 96 | 1430 | 80539 | 94651 | 0 | |
HJ12 | Cook's Creek Rt. 704 | Senftenberg | - | 14 | 7973 | 80536 | 94654 | 0 | |
HJ13 | Cook's Creek Rt. 11 | Hadar | Amp Gent Strep Tet | 33 | 3764 | 80533 | 94647 | 6 | |
HJ14 | Cook's Creek Rt. 11 | Hadar | Amp Gent Strep Tet | 33 | 3764 | 80527 | 94646 | 6 | |
HJ15 | Cook's Creek Rt. 11 | Hadar | Amp Gent Strep Tet | 33 | 3764 | 80538 | 94653 | 6 | |
HJ16 | Poultry Litter | Cerro | - | 367 | New | 80542 | 118418 | 0 | |
HJ17 | Poultry Litter | Typhimurium | Gent Strep Sulf Tet | 19 | 1369 | 80529 | 94648 | 6 | |
HJ18 | Poultry Litter | Typhimurium | Gent Strep Sulf Tet | 19 | 1369 | 80535 | 94652 | 6 | |
HJ19 | Poultry Litter | Typhimurium | Gent Strep Sulf Tet | 19 | 1369 | 80530 | 94655 | 6 | |
HJ20 | Poultry Litter | Typhimurium | Gent Strep Sulf Tet | 19 | 1369 | 80534 | 94642 | 6 | |
HJ21 | Cook's Creek Rt. 11 | Typhimurium | - | 19 | 1369 | 80528 | 94643 | 6 | |
HJ22 | Cook's Creek Rt. 704 | Muenchen | - | 112 | 60549 | 80532 | 118420 | 0 | |
HJ23 | Cook's Creek Rt. 704 | Muenchen | - | 112 | 60549 | 80526 | 94644 | 0 | |
HJ24 | Pleasant Run | Montevideo | - | - | - | - | - | 0 | |
HJ25 | Pleasant Run | Montevideo | Strep | - | - | - | - | 0 | |
HJ26 | Muddy Creek | Senftenberg | - | - | - | - | - | 0 | |
HJ27 | Cook's Creek Rt. 704 | Cerro | - | 367 | New | 101373 | 124055 | 0 | |
HJ28 | Cook's Creek Rt. 704 | Cerro | - | 367 | New | 101373 | 124080 | 0 | |
HJ29 | Cook's Creek Rt. 704 | Anatum | - | 64 | 3700 | 11895 | 124504 | 0 | |
HJ30 | Cook's Creek Park | Braenderup | - | 22 | 26853 | 4601 | 124041 | 0 | |
HJ31 | Cook's Creek Park | Braenderup | - | 22 | 26853 | 101420 | 124092 | 0 | |
HJ32 | Cook's Creek Park | Braenderup | - | 22 | 26853 | 4601 | 132745 | 0 | |
HJ33 | Muddy Creek | Montevideo | - | 138 | 8182 | 101411 | 124094 | 0 | |
HJ38 | Cook's Creek Park | Typhimurium | - | - | - | - | - | 0 | |
HJ39 | Cook's Creek Park | Typhimurium | - | - | - | - | - | 0 |
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> | |
<head> | |
<meta charset="utf-8"> | |
<svg width="960" height="960" font-family="sans-serif" font-size="10" text-anchor="middle"></svg> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
</style> | |
</head> | |
<body> | |
<script> | |
// Feel free to change or delete any of the code you see in this editor! | |
var salmonella_data=[] | |
var svg = d3.select("svg"), | |
width = +svg.attr("width"), | |
height = +svg.attr("height"); | |
var format = d3.format(",d"); | |
var color = d3.scaleOrdinal(d3.schemeCategory20c); | |
var pack = d3.pack() | |
.size([width, height]) | |
.padding(1.5); | |
//var salmonella_data=[] | |
console.log(salmonella_data) | |
d3.csv("BIO583_Salmonella_data.csv", function(d){ | |
if (d.Isolate) return d; | |
}, function (error, classes){ | |
if (error) throw error; | |
classes.forEach(function(d){ | |
salmonella_data.push({"Isolate": d.Isolate, "Source": d.Source, "Serotype": d.Serotype, "AMR Phenotype": d.AMR_Phenotype, "gene_number": +d.gene_number})}) | |
var root = d3.hierarchy({children: classes}) | |
.each (function (d){ | |
if (Isolate = d.data.Isolate){ | |
var Isolate, i = Isolate.lastIndexOf("."); | |
d.Isolate = Isolate; | |
d.package = Isolate.slice (0,i) | |
d.class = Isolate.slice (i+1) | |
} | |
}); | |
var node = svg.selectAll(".node") | |
.data(pack(root).leaves()) | |
.enter().append("g") | |
.attr("class", "node") | |
.attr("transform", function (d){return "translate(" + d.x + "," + d.y + ")";}); | |
node.append("circle") | |
.attr("Isolate", function(d){return d.Isolate}) | |
.attr("r", function (d) {return d.gene_number}) | |
.attr("Serotype", function (d){return d.Serotype}) | |
.style ("fill", function(d) {return color(d.package); }); | |
/*node.append("clipPath") | |
.attr("Isolate", function(d) {return "clip-" + d.Isolate; }) | |
.append("use") | |
.attr("xlink:href", function (d) {return "#" + d.Isolate; });*/ | |
node.append("text") | |
.attr("clip-path", function (d) {return "url(#clip-" + d.Isolate + ")"}) | |
.selectAll("tspan") | |
.data(function (d) {return d.class.split(/(?=[A-Z][^A-Z])/g); }) | |
.enter().append("tspan") | |
.attr("x", 0) | |
.attr("y", function (d, i, nodes) {return 13 + (i - nodes.length / 2 - 0.5) * 10; }) | |
.text(function (d) {return d}); | |
node.append("title") | |
.text(function (d) {return d.Isolate + "\n" + format(d.value); }); | |
}); | |
//console.log(salmonella_data) | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment