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 / bwt.rb
Created September 29, 2018 01:06
#!/usr/bin/env ruby
#
# https://qiita.com/erukiti/items/f11f448d3f4d73fbc1f9
# https://research.preferred.jp/2012/11/burrows-wheeler-transform-lf-mapping/
#
class BWT
def initialize(str)
@str = str + '$'
#!/usr/bin/env ruby
require 'json'
uniq = File.open("uniq_node.txt").map {|x| x.stip.to_i}
json = JSON.parse(ARGF.read)
json.each do |ary|
read_id = ary.shift
#!/usr/bin/env ruby
matrix = []
ARGF.each do |line|
ary = line.strip.split
matrix << ary
end
matrix.transpose.each do |row|
# Dockerfile for https://github.com/dbcls/sparqlist
FROM ubuntu:16.04
ARG node_version=v7.9.0
RUN apt-get -qq update && apt-get -qq install -y \
pkg-config \
sudo \
curl \
#!/usr/bin/env ruby-2.3
=begin
# SPARQL endpoint
https://stirdf.jglobal.jst.go.jp/sparql
# SPARQL query
select *
where {
?term a skos:Concept ;
@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() 関数を定義