Skip to content

Instantly share code, notes, and snippets.

View ktym's full-sized avatar

Toshiaki Katayama ktym

  • Database Center for Life Science
  • Japan
View GitHub Profile
@ktym
ktym / ajacs55.md
Last active August 29, 2015 14:26
AJACS 55 Introduction of pathway databases

パスウェイデータベースを使ってみる

Pathguide

まずは、様々なパスウェイデータベースの一覧を見てみましょう。

500 以上のデータベースが下記の分類でリストアップされています。

@ktym
ktym / lodconvert.rb
Last active August 29, 2015 14:09
RDF format converter
#!/usr/bin/env ruby
#
# % gem install linkeddata
# % lodconvert.rb -h
# % lodconvert.rb [-i input_format] [-o output_format] inputfile > outputfile
#
require 'rubygems'
require 'linkeddata'
require 'getoptlong'
@ktym
ktym / Sample_ruby_native_apps_script.rb
Created October 30, 2014 12:23
Ruby port of the BaseSpace Native App test python script
require 'json'
def metadatajson
json = JSON.parse('
{
"Name": "",
"Description": "",
"HrefAppSession": "",
"Properties": [
{
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<!-- Twitter Bootstrap http://getbootstrap.com/2.3.2/ を取得してインストール -->
<link rel="stylesheet" type="text/css" href="bootstrap.css"/>
<!-- jQuery http://jquery.com/ を取得してインストール -->
<script src="jquery.min.js"></script>
<script>
// SPARQL 検索を行う query() 関数を定義
@ktym
ktym / rw-l5.rb
Last active August 29, 2015 14:03
Ruby Warrior Level 5 https://www.bloc.io/ruby-warrior
class Player
def play_turn(warrior)
# cool code goes here
@health ||= warrior.health
if warrior.feel.captive?
warrior.rescue!
elsif warrior.feel.enemy?
warrior.attack!
else
if warrior.health < 20 and !(warrior.health < @health)
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<!-- Twitter Bootstrap http://getbootstrap.com/2.3.2/ を取得してインストール -->
<link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css"/>
<!-- D3.js http://d3js.org/ を取得してインストール -->
<script src="lib/d3/d3.v3.min.js"></script>
<script>
function query() {
@ktym
ktym / taxdump2owl.rb
Last active August 29, 2015 13:56
INSDC (NCBI) taxdump to OWL converter
#!/usr/bin/env ruby
#
# Taxonomy ontology generator
#
# Copyright (C) 2013, 2014 Toshiaki Katayama <[email protected]>
#
# Version: Jan 29, 2014
#
# Usage:
#
@ktym
ktym / sparql2das.rb
Created January 18, 2014 10:07
Generate BioDAS XML from a SPARQL endpoint which stores genome sequences/annotations using FALDO
#!/usr/bin/env ruby
#
# Usage:
# DAS XML for http://togogenome.org/das/645657/features?segment=NC_017196.1:1,100000 can be generated by
# % ruby sparql2das.rb 645657 features segment=NC_017196.1:1,100000
# With ruby -d option, you'll see debug massages with pretty formatted XML (will miss <?xml> tag though)
#
# TODO:
# Wrap as an Rack app and add X-DAS-* HTTP headers
#
@ktym
ktym / .emacs
Last active December 20, 2015 02:09
Configuration for multi-line editing mode in Emacs 24.
;;; library
(let ((default-directory "~/lib/lisp"))
(normal-top-level-add-subdirs-to-load-path))
;; multiple-cursors
; % git clone https://github.com/magnars/multiple-cursors.el.git
; % mv multiple-cursors.el lib/lisp/multiple-cursors
@ktym
ktym / refseq2ttl.rb
Last active December 17, 2015 03:59
refseq2ttl.rb version 8 (migrated into https://github.com/dbcls/rdfsummit/tree/master/insdc2ttl in 2014)
#!/usr/bin/env ruby
require 'rubygems'
require 'uri'
require 'bio'
require 'json'
require 'securerandom'
# [TODO] integrate this into BioRuby
module Bio