Skip to content

Instantly share code, notes, and snippets.

@inutano
inutano / moshimokoukouyakyunojoshimanagergaNCBInoSRAwotsukattara.rb
Created May 10, 2011 14:17
counting number of SRA entries which came from same samples.
# -*- coding: utf-8 -*-
require "open-uri"
require "json"
require "pp"
###
# loading bullet
###
# -*- coding: utf-8 -*-
require "nokogiri"
hako = "/path/to/directory_contains_pubmed_html"
title_list = []
Dir::entries(hako).each do |item|
if !item.include?("url_list")
if !item.include?("¥.")

スキー@裏磐梯猫魔スキー場

日程

  • 2012-01-07 (Sat)
  • 2012-01-08 (Sun)

参加者

@inutano
inutano / ar_test.rb
Created January 27, 2012 05:21
てめー ブッ殺す! 『アクティブ・レコード』ッ!
require "active_record"
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => './test.sqlite3'
)
class UsersInit < ActiveRecord::Migration
def self.up
create_table( :users ) do |t|
@inutano
inutano / transfer_speed.sh
Created February 3, 2012 01:17
time sequence raw file transfer speed from NCBI, EBI, DDBJ with various transfer protocol.
#!/bin/zsh
#
# time file transfer from NCBI, EBI, and DDBJ with various transfer protocol.
# calc avg time send it to stdout
# usage: transfer_speed.sh <target SRA Run ID>
# requirement: SRA_Accessions.tab from ftp.ncbi.nlm.nih.gov/sra/reports/Metadata
#
###################################################################################
# time format (set as showing total time by second only)

Andare in Italia! Febbraio 2012

( ゚∀゚)o彡゜

Flight information

Tokyo, Narita -> Milano, Malpensa

  • departure: Feb 13, 9pm
  • arrival: Feb 14, 13pm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="icon" href="{Favicon}"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="{RSS}"/>
<title>{Title}{block:PostSummary} - {PostSummary}{/block:PostSummary}</title>
<style type="text/css">
* {
@inutano
inutano / backup.rb
Created February 16, 2012 11:43
backing up the result file
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# `gisty sync` to update gist
# run with --run option to show the whole list of the zip file to be backuped
# use --test option before running
# rsync command
# rsync -avzr iNut@hostname:/home/iNut/project/sra_qualitycheck/result /Volumes/HD2/fastqc2AllSRA
# get the list of zip files
@inutano
inutano / nature_parser.rb
Created April 20, 2012 03:55
nature_parser.rb
# -*- coding: utf-8 -*-
require "open-uri"
require "nokogiri"
require "ap"
class NatureParser
def initialize(page_url)
@nkgr_main = Nokogiri::HTML(open(page_url))
end
# -*- coding: utf-8 -*-
require "yaml"
require "twitter"
def force_mecab_parse(y_conf, text)
mecabed = `echo "#{text}" | /opt/local/bin/mecab`.split("\n")
parsed_arr = mecabed.map do |line|
tab_sep = line.split("\t")
com_sep = tab_sep.map{|p| p.split(",") }
com_sep.flatten