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
# -*- coding: utf-8 -*- | |
require "pp" | |
require "optparse" | |
def open_t_delimited_file(filename) | |
h = { } | |
File.open(filename).readlines.each do |line| | |
a = line.split("\t") | |
if /\d+/ =~ a[6] | |
if h[a[0]] #もし既にidとfpkmの配列がhに入っている場合 |
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/sh | |
#$ -o cuffout.txt -e cufferr.txt | |
LD_LIBRARY_PATH=/usr/local/boost-1.40.0/lib | |
export LD_LIBRARY_PATH | |
/usr/local/cufflinks-0.8.2/bin/cufflinks -p 2 $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
#/usr/bin/env ruby | |
require "pp" | |
require "optparse" | |
# Usage : ruby bedgraph.rb [-o output_dir] input_file | |
# Output_dir is optional. Default output_dir is "bedgraph". | |
# | |
# Input_file format must be tab delimited file and the following format below. | |
# gene_id gene_name fpkm chr start end | |
# |
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 | |
def open_t_delimited_file(filename) | |
h = {} | |
File.open(filename).readlines.each do |line| | |
a = line.split("\t") | |
h[a[0]] = a | |
end | |
puts filename.to_s + " was loaded." | |
return h |
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 | |
# -*- coding: utf-8 -*- | |
require "pp" | |
def input_marshal_data(path) | |
a = 0 | |
a_id_list = [] | |
open(path,"rb") {|f| | |
a = Marshal.load(f) |
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 | |
def open_indel_file(filename) | |
h = [] | |
open(filename) { |f| | |
f.each_line do |line| | |
a = line.chomp.split("\t") | |
h << a | |
end |
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
#compdef samtools | |
################################################ | |
# SAMtools commands and options are based on ver. 0.1.18 | |
# http://samtools.sourceforge.net/samtools.shtml | |
# | |
# Edited by yag_ays 2011.10.25 | |
################################################ | |
_samtools() { |
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
;; 訓練データ | |
(def text_classified_p '(["good" "bad" "good" "good"] | |
["exciting" "exciting"] | |
["good" "good" "exciting" "boring"])) | |
(def text_classified_n '(["bad" "boring" "boring" "boring"] | |
["bad" "good" "bad"] | |
["bad" "bad" "boring" "exciting"])) | |
;;多変数ベルヌーイモデル | |
(defn train [features] |
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
;;; 文字列の指定 | |
(def sentence "mississippi") | |
(def sentence "Ask not what your country can do for you but what you can do for your country") | |
;;; 接尾辞リストを作る | |
(defn tail [x] | |
(loop [s x result []] | |
(if (empty? s) (conj result s) (recur (apply str (rest s)) (conj result s) )))) | |
;;; ソートする |
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
(map #(if (zero? (rem % 3)) | |
(if (zero? (rem % 5)) | |
"fizzbuzz" | |
"fizz") | |
(if (zero? (rem % 5)) | |
"buzz" | |
%)) | |
(range 1 101)) | |
OlderNewer