Skip to content

Instantly share code, notes, and snippets.

View client.py
# -*- coding: utf-8 -*-
# Modified lightsocket import script, based on Lightsocket
# example script by James Thornton (http://jamesthornton.com)
# mundane modification stuff
import os
import commands
import sys
import datetime
import re # regexp
View importclass.py
# -*- coding: utf-8 -*-
# Class implementation for importing stuff to Neo4j
# based on Lightsocket examples by
#James Thornton (http://jamesthornton.com)
from java.lang import Long, Double, Integer, String
from com.tinkerpop.rexster.util import ElementHelper
from com.tinkerpop.blueprints.pgm.impls.neo4j import Neo4jGraph
from com.tinkerpop.blueprints.pgm.impls.neo4jbatch import Neo4jBatchGraph
View jythoimporter.py
# -*- coding: utf-8 -*-
# Modified lightsocket import script, based on Lightsocket
# example script by James Thornton (http://jamesthornton.com)
# mundane modification stuff
import os
import commands
import sys
import datetime
import re # regexp
@amergin
amergin / gremlin-test1.groovy
Created Oct 10, 2012
Gremlin test script for bulbs
View gremlin-test1.groovy
def regulatory(clinicalNodeId, distanceThreshold, middleNodeType, mutatedType, targetType) {
if( targetType == 'GNAB' )
{
if( mutatedType == 'aberrated' )
{
/*distanceThreshold = 100000;
middleNodeType = 'GEXP';
clinicalNodeId = 137059;
mutatedType = 'aberrated';
targetType = 'GNAB'; */
View gist:3873399
START node1=node(1456) MATCH node1-[rel1]->node2
WITH node1, rel1, node2 ORDER BY rel1.distance! ASC LIMIT 10
MATCH node2-[rel2]->node3
WHERE node3 <> node1
WITH node2,node3, rel2, rel1 ORDER BY rel2.distance! ASC LIMIT 10
MATCH node3-[rel3]->node4
WHERE node4 <> node2
RETURN DISTINCT rel1, rel2, rel3
ORDER BY rel2.distance! ASC LIMIT 10;
View cytoproblem.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type="text/css">
.options { font-family:"Times New Roman", Times, serif; text-size: 12px; text-color: #A8A8A8; margin: 0px auto; background-color: #E3E3E3;}
.full-height { height: 800px; margin: 0 0; padding: 0 0; width: 800px; }
</style>
<script type='text/javascript' src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type='text/javascript' src="lib/cytoscape.js"></script>
@amergin
amergin / gist:3960966
Created Oct 26, 2012
Neo4j autocomplete test
View gist:3960966
eo4j-sh (0)$ start a=node:cbm_pc_quantrev_0706_i_n_GEXP('label:TP53') return id(a);
==> +-------+
==> | id(a) |
==> +-------+
==> | 48228 |
==> +-------+
==> 1 row
==> 249 ms
==>
neo4j-sh (0)$ start a=node:cbm_pc_quantrev_0706_i_n_GEXP('label:T*') return count(a);
@amergin
amergin / gist:4262270
Created Dec 11, 2012
Cypher branching example
View gist:4262270
START a = node(137059)
MATCH a-[rel]->b
WITH a,b,rel
ORDER BY rel.pvalue DESC LIMIT 5
MATCH b-[rel2]->c
WITH a,b,c,rel,rel2
ORDER BY rel2.pvalue DESC LIMIT 5
RETURN a.label?, rel.pvalue, b.label?, b.source, rel2.pvalue, c.label?, c.source;
@amergin
amergin / dump_after_warming_idle.txt
Created Dec 31, 2012
jstack after warming the cache, at idle, CPU ~33%.
View dump_after_warming_idle.txt
2012-12-31 02:25:57
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00007ff318003800 nid=0x63fe waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"712944945@qtp-2058324786-3" prio=10 tid=0x00007ff2a8003800 nid=0x63d0 in Object.wait() [0x00007ff25502e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000005202a9ef0> (a org.mortbay.thread.QueuedThreadPool$PoolThread)
@amergin
amergin / dump_while_traversing_highCPU.txt
Created Dec 31, 2012
jstack dump while high-CPU traversal.
View dump_while_traversing_highCPU.txt
2012-12-31 02:28:04
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode):
"1964274118@qtp-2058324786-4" prio=10 tid=0x00007ff2a8014800 nid=0x6429 in Object.wait() [0x00007ff271190000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000005337d6da0> (a org.mortbay.thread.QueuedThreadPool$PoolThread)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:626)
- locked <0x00000005337d6da0> (a org.mortbay.thread.QueuedThreadPool$PoolThread)