Skip to content

Instantly share code, notes, and snippets.

Takatomo Fujisawa tfuji

Block or report user

Report or block tfuji

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View json2ld-context.json
{
"@context": [
"https://schema.org/docs/jsonldcontext.json",
{
"@vocab": "http://togovar.biosciencedbc.jp/ontology/",
"tgv": "http://togovar.biosciencedbc.jp/ontology/",
"dcterms": "http://purl.org/dc/terms/",
"m2r": "http://med2rdf.org/ontology/med2rdf",
"faldo": "http://biohackathon.org/resource/faldo#",
"obo": "http://purl.obolibrary.org/obo/",
@tfuji
tfuji / es_msearch_test.rb
Last active Oct 30, 2019
es_msearch_test.rb
View es_msearch_test.rb
#!/usr/bin/env ruby
require 'elasticsearch'
require 'json'
require 'pp'
begin
#client = Elasticsearch::Client.new({log: true, hosts: { host: 'localhost'}})
client = Elasticsearch::Client.new({hosts: { host: 'localhost', port: 9291 }})
q ='water'
from = 0
size = 20
View load_sample.rb
#!/usr/bin/env ruby
#
# ruby load_sample.rb biosample/annotated_json dev
require 'elasticsearch'
require 'json'
require 'pp'
#client = Elasticsearch::Client.new({log: true, hosts: { host: 'localhost', user: 'user', password: 'password' }})
client = Elasticsearch::Client.new({log: true, hosts: { host: 'localhost'}})
View ncbi_biosample_attributes_extend2ttl.rb
#!/usr/bin/env ruby
require 'nokogiri'
#require 'erb'
require 'pp'
require 'json'
#require 'thor'
# 1. wget https://www.ncbi.nlm.nih.gov/biosample/docs/attributes/?format=xml -O ncbi_biosample_attributes.xml
# 2. %ruby ncbi_biosample_attributes_extend2ttl.rb ncbi_biosample_attributes.xml > biosample_attributes_extend.ttl
View fetch_context.rb
#require 'open-uri'
require 'rdf/raptor'
require 'json'
require 'json/ld'
require 'pp'
require "faraday"
require 'faraday_middleware'
require 'fileutils'
require 'systemu'
View ft_rfam.json
This file has been truncated, but you can view the full file.
{
"RF00001": {
"AC": "RF00001",
"ID": "5S_rRNA",
"DE": "5S ribosomal RNA",
"feature": "rRNA",
"qualifiers": [
{
"product": "5S ribosomal RNA"
@tfuji
tfuji / parse_st.rb
Created Mar 14, 2016
INSDC structured comment parser
View parse_st.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'bio'
def parse_st_comment comment
tagset_id = nil
tag_name = tag_value = ''
st = Hash.new { |h,k| h[k] = {} }
comment.split("\n").each do |line|
@tfuji
tfuji / biosample2ttl.rb
Created Feb 20, 2015
biosample2ttl.rb v0.2
View biosample2ttl.rb
#!/usr/bin/env ruby
require 'nokogiri'
require 'erb'
#require 'uri'
#require 'pp'
class BioSampleSet
include Enumerable
@tfuji
tfuji / genome_reports2ttl.rb
Last active Aug 29, 2015
genome_reports2ttl_v2.rb
View genome_reports2ttl.rb
#!/usr/bin/env ruby
#
# convert genome_reprots to RDF
# * ftp://ftp.ncbi.nlm.nih.gov/genomes/GENOME_REPORTS/prokaryotes.txt
# * ftp://ftp.ncbi.nlm.nih.gov/genomes/GENOME_REPORTS/eukaryotes.txt
#
require 'date'
View refseq2rdf.rb
#!/usr/bin/env ruby-1.9
require 'rubygems'
require 'bio'
require 'json'
require 'securerandom'
# [TODO] true to combine the result with the EdgeDB
if $DEBUG
$edgedb = true
You can’t perform that action at this time.