Skip to content

Instantly share code, notes, and snippets.

@idot
idot / eulerGrid.R
Created November 21, 2014 14:36
euler grid
## Prepare data to plot in Euler Grid.
## Quantity or binary table with columns for samples and rows for features
#### FUNCTIONS #######
## convert a (table, matrix,) data.frame to either 0/1 or FALSE/TRUE based on whether values exceed threshold.
## to invert a threshold use: new.table <- table == FALSE
### Keybase proof
I hereby claim:
* I am idot on github.
* I am idotamir (https://keybase.io/idotamir) on keybase.
* I have a public key whose fingerprint is CAB5 4E68 808E 591E 4F62 E3BE 0271 0975 3DDF F04E
To claim this, I am signing this object:
#!/bin/sh
cd `dirname $0`
python -ES ./importer/importer.py universe_wsgi.ini $@
class InputActor(latch: CountDownLatch, outputStream : OutputStream) extends Actor {
private val log = LoggerFactory getLogger(Popen getClass)
private val writer = new PrintWriter(outputStream)
def act(){
react{
case null => {
ControlUtil.closeInsulated(writer)
latch.countDown
@idot
idot / igb_bed.xml
Created April 26, 2011 13:06
Display files from galaxy in IGB (needs copy of synonyms.txt)
<display id="igb_bed" version="1.0.0" name="display in ">
<link id="igb_bed" name="IGB">
<url>http://localhost:7085/UnibrowControl?version=${buildversion}&amp;${position}&amp;loadresidues=false&amp;feature_url_0=${bed_file.url}&amp;sym_name_0=${thenicename}&amp;sym_method_0=${bed_file.url}&amp;sym_bg_0=0xFFFFFF&amp;graph_show_label_0=true&amp;graph_show_axis_0=true&amp;graph_minvis_0=0.0&amp;graph_maxvis_0=100&amp;graph_float_0=false&amp;graph_style_0=Bar&amp;query_url=${bed_file.url}&amp;server_url=galaxy</url>
<param type="data" name="bed_file_for_name" viewable="False"/>
<param type="template" name="thenicename" viewable="False" strip="True">
#import re
#set nm=$bed_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
<param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
@idot
idot / build tophat
Created July 12, 2011 14:35
build tophat in own folder
#similar to brentp http://biostar.stackexchange.com/questions/4885/installation-of-tophat-1-1-4
* in samtools download mkdir lib include/bam bin
* cp libbam.a lib; *.h include/bam ; samtools bin
tophat:
./configure --with-bam=/path/to/samtools/samtools-0.1.13 --prefix /path/to/tophat/checkout/tophat/tophat.git
make && make install
will create tophat binaries in tophat.git/bin
@idot
idot / tikz2pdf.py
Created July 26, 2011 10:05
converts .tikz to pdf files
#!/usr/bin/env python
#
# Copyright (c) 2007, Hans Meine <hans_meine@gmx.net>
# All rights reserved.
#
# This is licensed according to the new BSD license.
# Please send patches / comments, I would be happy about any feedback.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@idot
idot / toIllu.py
Created October 10, 2011 16:52
converts 1.8+ illumina qualities somehow to 1.5+
#!/usr/bin/env python
def toIllu(c):
"""returns the 1.5 value of phred+33
>>> [toIllu(ord(n)) for n in["!",'"',"#","$","H","I","J"]]
['B', 'B', 'B', 'C', 'g', 'h', 'h']
"""
if c < 36:
return "B"
elif c > 73:
@idot
idot / CQRS_ES_Actor.scala
Created October 25, 2011 08:44 — forked from viktorklang/CQRS_ES_Actor.scala
CQRS and EventSourcing using Akka Actors
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {
@idot
idot / ngGrid.js
Created November 11, 2012 14:27 — forked from mathwizard/ngGrid.js
Angular Grid
//////////////////////////////////////
/// Grid Directive to Angular 1.0.2
//////////////////////////////////////
// To use:
// <script>
// var app = angular.module('myapp', ['ngGrid']);
// var Ctrl = function($scope) { $scope.todos = [...] }
// </script>
// <div ng-app="myapp">