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
Xco | Yco | |
---|---|---|
0 | 1 | |
3 | 1 | |
1 | 1 | |
1 | 0 | |
1 | 1 | |
4 | 1 | |
2 | 1 | |
2 | 0 | |
2 | 3 |
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
margin = {top: 20, right: 20, bottom: 30, left: 50} | |
width = 960 - margin.left - margin.right | |
height = 500 - margin.top - margin.bottom | |
parseDate = d3.time.format("%Y-%m-%d").parse | |
x = d3.time.scale().range([0, width]) |
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 GetBinCoeff(N, K) { | |
// http://stackoverflow.com/questions/14556266/how-to-calculate-combination-of-large-numbers | |
if ( K > N) { | |
return 0; | |
} | |
else { | |
var r = 1; | |
var d; | |
for (d = 1; d <= K; d++) | |
{ |
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
// Written by Nikhil Gopal | |
// http://www.nikhilgopal.com | |
function TwoCellCalculation(k,j) { | |
return(k/(k+j)); | |
} | |
function ConfusionMatrix(a,b,c,d) { | |
this.n = a+b+c+d; | |
this.true_positives = a; |
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
// To parse CSV, TSV, etc | |
// https://code.google.com/p/jquery-csv/ --> Library to parse CSV | |
// otherwise use ajax call with dataType set to text | |
// If the JSON file is in string form | |
// http://stackoverflow.com/questions/4935632/how-to-parse-json-in-javascript | |
var json = '{"result":true,"count":1}'; | |
var obj = JSON.parse(json); | |
console.log(obj.count); |
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
{ | |
"sbml": { | |
"-xmlns": "http://www.sbml.org/sbml/level2/version4", | |
"-level": "2", | |
"-version": "4", | |
"model": { | |
"-id": "pathway_977225", | |
"-name": "Amyloids", | |
"-metaid": "metaid_0", | |
"notes": { |
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 node(inid,inname) { | |
return { | |
id : inid, | |
name : inname | |
}; | |
} | |
function edge(node1,node2) { | |
return { | |
source : node1, |
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 getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
function erdosRenyi(nodesNum,directedness,prob) { | |
// create nodes list | |
var nodes = [] | |
for (var i = 0; i < nodesNum; i++) { | |
nodes.push(i); |
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
# Blog Post is here: http://www.nikhilgopal.com/applying-a-divergent-color-scale-to-a-gene-expression-heat-map/ | |
source("http://bioconductor.org/biocLite.R") | |
biocLite("ALL") | |
biocLite("limma") | |
library("ALL") | |
library("limma") | |
data("ALL") | |
eset <- ALL[, ALL$mol.biol %in% c("BCR/ABL", "ALL1/AF4")] |
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> | |
<head> | |
<meta name="description" content="Degree Centrality based force-layout" /> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://jsbin.com/xiyehe/1.js"></script> |