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
#!/usr/bin/env ruby | |
class Percentile | |
ROUND_DIGIT = 1 | |
def pctile(data0) | |
return [] if data0.empty? | |
data = data0.map{|x|Integer(x.round(ROUND_DIGIT) * (10 ** ROUND_DIGIT))} | |
sorted_data = data.sort | |
index_sum = Hash.new(0) | |
count = Hash.new(0) |
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
##INFO=<ID=BaseQRankSum,Number=1,Type=Float,Description="."> | |
##INFO=<ID=InbreedingCoeff,Number=1,Type=Float,Description="."> | |
##INFO=<ID=ReadPosRankSum,Number=1,Type=Float,Description="."> | |
##INFO=<ID=NEGATIVE_TRAIN_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=POSITIVE_TRAIN_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=TOMMO_POSSIBLE_PLATFORM_BIAS_SITE,Number=0,Type=Flag,Description="."> | |
##INFO=<ID=CLNREVSTAT,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNSIGCONF,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNDISDBINCL,Number=A,Type=String,Description="."> | |
##INFO=<ID=CLNSIGINCL,Number=A,Type=String,Description="."> |
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
require 'statistics2' | |
def chisq_test(a, b, c, d) | |
total = a + b + c + d | |
row1_total = a + b | |
row2_total = c + d | |
col1_total = a + c | |
col2_total = b + d | |
e_a = (row1_total * col1_total).to_f / total | |
e_b = (row1_total * col2_total).to_f / total |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'fileutils' | |
require 'rubyXL' | |
require 'rubyXL/convenience_methods/cell' | |
require 'rubyXL/convenience_methods/color' | |
require 'rubyXL/convenience_methods/font' | |
require 'rubyXL/convenience_methods/workbook' | |
require 'rubyXL/convenience_methods/worksheet' |
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
#!/usr/bin/env ruby | |
# $ ./klass.rb --hoge=fuga --hoge=puyo --foo=bar | |
# {:h=>false, :hoge=>["fuga", "puyo"] :foo=>["bar"]} | |
require 'optparse' | |
class Klass | |
attr_reader :opts | |
def initialize(opts) |
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
#!/usr/bin/env ruby | |
# | |
# Blink all locate LEDs of an SAS-enclosure binded to a block device | |
# Hiroyuki Mishima ([email protected]) | |
# | |
require 'optparse' | |
class BlinkEnclosure | |
PARALLEL = "parallel -j1" |
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
Sub PhysPosGrouping() | |
Dim oRange As Range | |
Dim lRorB As Long | |
Dim lColR As Long | |
Dim gcount As Long | |
Set oRange = ActiveSheet.UsedRange | |
lRowB = oRange.Row + oRange.Rows.Count - 1 | |
lColR = oRange.Column + oRange.Columns.Count - 1 | |
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
#!/bin/bash | |
sel=$(byobu ls | peco | cut -d ":" -f 1) | |
if [ ! -z "${sel}" ] ; then | |
byobu a -t ${sel} | |
fi |
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
#!/usr/bin/env ruby | |
# License: the MIT lincense. | |
# Copyright: MISHIMA, Hiroyuki hmishima at nagasaki-u.ac.jp, 2015 | |
require 'rexml/document' | |
class Qstat2 | |
JOBNAME_WIDTH = 65 | |
def initialize |
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
iupac = { | |
"A" => ["A"], # Adenine | |
"C" => ["C"], # Cytosine | |
"G" => ["G"], # Guanine | |
"T" => ["T"], # Thymine | |
"R" => ["A", "G"], # puRine | |
"Y" => ["C", "T"], # pYrimidine | |
"S" => ["G", "C"], # Strong | |
"W" => ["A", "T"], # Weak | |
"K" => ["G", "T"], # Keto |
NewerOlder