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
START source=node(10), destination=node(144) | |
MATCH p = allShortestPaths(source-[r:interacts*..3]->destination) | |
RETURN NODES(p); |
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 program takes the PPI data from ConsensusDB and populates the NEO4J database with it | |
# By Nikhil Gopal | |
# | |
# To run: python populate_running_db.py ConsensusDB_Human_PPI nodes_list.txt | |
# The code to generate the nodes_list.txt file exists here: https://gist.github.com/ngopal/9164294 | |
import os, sys | |
from neo4jrestclient.client import GraphDatabase | |
from itertools import chain, combinations |
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
brew install neo4j |
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 start server | |
neo4j start | |
# To stop server | |
neo4j stop |
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
import os, sys | |
from itertools import chain, combinations | |
genes_set = set([]) | |
for i in open(sys.argv[1], 'r').readlines(): | |
if '#' in i: | |
continue | |
else: | |
line = i.strip('\r\n').split('\t') | |
genes = line[2].replace('_HUMAN','').split(',') |
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); |
OlderNewer