Skip to content

Instantly share code, notes, and snippets.

View kozo2's full-sized avatar

Kozo Nishida kozo2

View GitHub Profile
@kozo2
kozo2 / vimrc
Last active July 15, 2023 17:37
execute pathogen#infect()
syntax on
filetype plugin indent on
inoremap jj <Esc>
inoremap kk <Esc>
inoremap <C-l> <Esc>
nnoremap ; :
nnoremap : ;
@kozo2
kozo2 / gist:7178924
Created October 27, 2013 07:47
77th kansaidebian meeting, wheezy (not sid)
sudo aptitude install git-buildpackage
git-pbuilder create
gbp-clone git://anonscm.debian.org/pkg-ruby-extras/ruby-bio.git
cd ruby-bio
sudo apt-get build-dep ruby-bio
git-buildpackage --git-ignore-new --git-biulder='git-pbuilder'
中略
import requests
ORGANISM = "hsa"
pathways = requests.get('http://rest.kegg.jp/list/pathway/' + ORGANISM)
for line in pathways.content.split('\n'):
pathwayid = line.split('\t')[0].replace('path:', '')
kgml = requests.get('http://rest.kegg.jp/get/' + pathwayid + '/kgml')
f = open(pathwayid + '.xml', 'w')
f.write(kgml.content)
package org.cytoscape.keggscape.internal.read.kgml;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.cytoscape.keggscape.internal.generated.Entry;
import org.cytoscape.keggscape.internal.generated.Graphics;
import requests
from sets import Set
import more_itertools
pathways = requests.get('http://rest.kegg.jp/list/pathway')
compounds = []
for line in pathways.content.split('\n'):
mapid = line.split('\t')[0].replace('path:', '')
cpds = requests.get('http://rest.kegg.jp/link/cpd/' + mapid)
[knishida@dhcp255-85]~% cytoscape-unix-3.2.0-SNAPSHOT/cytoscape.sh
_
___ _ _| |_ ___ ___ ___ __ _ _ __ ___
/ __| | | | __|/ _ \/ __|/ __|/ _` | '_ \ / _ \
| (__| |_| | |_| (_) \__ \ (__| (_| | |_) | __/
\___|\__, |\__|\___/|___/\___|\__,_| .__/ \___|
|___/ |_|
Cytoscape 3.2.0-SNAPSHOT
@kozo2
kozo2 / load_kegg.py
Last active January 1, 2016 17:29 — forked from keiono/load_kegg.py
from java.io import File
KEGG_DIR = "/Users/kozo2/kegg/"
CARBOHYDRATE = "Carbohydrate"
pathwayids_for = { CARBOHYDRATE : ["00010", "00020", "00030", "00040", "00051", "00052", "00053", "00500", "00520", "00562", "00620", "00630", "00640", "00650", "00660"] }
ORGANISM = "eco"
loadNetworkTF = cyAppAdapter.get_LoadNetworkFileTaskFactory()
@kozo2
kozo2 / alias
Last active January 2, 2016 06:59
alias l ls -l $*
alias j dired-jump
alias f find-file $1
@kozo2
kozo2 / xml.scala
Last active January 4, 2016 18:29
import net.liftweb.json.Xml // converts XML to JSON
import com.mongodb.casbah.Imports._ // To put stuff in Mongo
import com.mongodb.casbah.MongoDB // To connect to Mongo
import com.mongodb.util.JSON // To parse JSON into a MongoDBObject
import net.liftweb.json._ // To output Lift JSON as actual JSON
import scala.xml.XML // To load XML
// load the XML
val xml = XML.load("http://www.w3schools.com/xml/note.xml")
// fire up mongo connection
@kozo2
kozo2 / test sparql
Created January 30, 2014 06:10
SPARQLs
SELECT a #?uniprot_id #?xref_id
WHERE
{
?id ?label "ConA" .
?uniprot_id ?p ?id .
?uniprot_id a <http://purl.uniprot.org/core/Protein> .
# ?uniprot_id <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?xref_id .
# <http://purl.uniprot.org/pfam/PF00139> ?p ?o
# ?xref_id <http://purl.uniprot.org/core/database> <http://purl.uniprot.org/database/Pfam>
}