Skip to content

Instantly share code, notes, and snippets.

@Bek
Bek / CpG_Methylation_Sanity_Check.ipynb
Last active March 20, 2019 09:09
This code looks at methylation region in base pair resolution and gets ratio of signal values in C to G nucleotides in ENCODE whole genome bisulfite sequencing experiment ENCSR481JIW
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Bek
Bek / mapping_test.sh
Last active April 5, 2016 19:19
Elasticsearch not_analyzed still gets analyzed when included in _all
curl -XDELETE 'http://localhost:9200/test'
echo
curl -XPUT 'http://localhost:9200/test'
echo
echo
curl -XPUT 'http://localhost:9200/test/_mapping/message' -d '
{
"message" : {
"properties" : {
"message" : {"type" : "string", "store" : "true" },
@Bek
Bek / gist:2342056
Created April 9, 2012 07:01 — forked from shazron/gist:1725083
PhoneGap/Cordova: Open a url in the same UIWebView programmatically
function openInWebView(url)
{
var anchor = document.createElement('a');
anchor.setAttribute('href', url);
//anchor.setAttribute('target', '_self');
var dispatch = document.createEvent('HTMLEvents')
dispatch.initEvent('click', true, true);
anchor.dispatchEvent(dispatch);
Exception in SMS Gateway: incompatible character encodings: ASCII-8BIT and US-ASCII at /Users/Bek/ruby-smpp/lib/smpp/pdu/base.rb:91:in `initialize'
/Users/Bek/ruby-smpp/lib/smpp/pdu/submit_sm.rb:49:in `initialize'
/Users/Bek/ruby-smpp/lib/smpp/transceiver.rb:21:in `new'
/Users/Bek/ruby-smpp/lib/smpp/transceiver.rb:21:in `send_mt'
sample_gateway.rb:46:in `send_mt'
sample_gateway.rb:27:in `receive_line'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/em/protocols/linetext2.rb:64:in `receive_data'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
sample_gateway.rb:61:in `block in start'
Exception in SMS Gateway: incompatible character encodings: ASCII-8BIT and US-ASCII at /Users/Bek/ruby-smpp/lib/smpp/pdu/base.rb:91:in `initialize'
/Users/Bek/ruby-smpp/lib/smpp/pdu/submit_sm.rb:49:in `initialize'
/Users/Bek/ruby-smpp/lib/smpp/transceiver.rb:21:in `new'
/Users/Bek/ruby-smpp/lib/smpp/transceiver.rb:21:in `send_mt'
sample_gateway.rb:46:in `send_mt'
sample_gateway.rb:27:in `receive_line'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/em/protocols/linetext2.rb:64:in `receive_data'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/Bek/.rvm/gems/ruby-1.9.2-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
sample_gateway.rb:61:in `block in start'
require 'logger'
require 'openssl'
class UcellGateway
#dunno what this is, but it's yours :)
include MessageFilter
def initialize
@logger = Logger.new
module MessageSender
def self.redis
@redis ||= EM::Hiredis.connect
end
def self.next
if UcellGateway.connection_exists == true
redis.blpop("ucell-out", 0) do |item| #blpop on redis return an array with key(ucell-out) and value
if item[1]