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 | |
# | |
# Mac OS X webarchive is a binary format of a plist file. You can extract the contents manually: | |
# 1. convert the plist file into XML by "plutil -convert xml1 file.webarchive" | |
# 2. parse the resulted XML file by some XML parser | |
# 3. decode "WebResourceData" by Base64.decode64(data) in each key | |
# 4. save the decoded content into a file indicated by "WebResourceData" | |
# Thankfully, the plist library can take care of annoying steps 2 and 3. | |
# | |
# Preparation: |
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
""" | |
Example RDF/Turtle: | |
hnt:A0A024QYV7-Q00653 | |
bp3:dataSource <http://identifiers.org/HINT> ; | |
bp3:displayName "A0A024QYV7-Q00653"^^xsd:string ; | |
bp3:evidence pint:evidence-pubmed_14743216-MI_0007-literature-curated , pint:evidence-pubmed_14743216-MI_0676-literature-curated ; | |
bp3:name "A0A024QYV7-Q00653"^^xsd:string ; | |
bp3:participant [ | |
obo:BFO_0000051 uni:A0A024QYV7 ; |
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 | |
# | |
# https://qiita.com/erukiti/items/f11f448d3f4d73fbc1f9 | |
# https://research.preferred.jp/2012/11/burrows-wheeler-transform-lf-mapping/ | |
# | |
class BWT | |
def initialize(str) | |
@str = str + '$' |
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 '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 |
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 | |
matrix = [] | |
ARGF.each do |line| | |
ary = line.strip.split | |
matrix << ary | |
end | |
matrix.transpose.each do |row| |
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
# 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 \ |
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-2.3 | |
=begin | |
# SPARQL endpoint | |
https://stirdf.jglobal.jst.go.jp/sparql | |
# SPARQL query | |
select * | |
where { | |
?term a skos:Concept ; |
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 "rubygems" | |
require "net/http" | |
require "uri" | |
require "cgi" | |
require "json" # gem install json | |
class SPARQL |
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 | |
# | |
# 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 | |
# |
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
;;; 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 |