Skip to content

Instantly share code, notes, and snippets.

View yk-tanigawa's full-sized avatar

Yosuke Tanigawa yk-tanigawa

View GitHub Profile
$ parallel mkdir -p dirs/{2}/{1} :::: <(seq 1 10) <(seq 1 5)
$ parallel -k 'echo {}' :::: <(seq 1 10)
$ # https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1

install necessary software to cluster machine

pyenv

  • download and install pyenv via github
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
  • add the following to ~/.bash_profile
@yk-tanigawa
yk-tanigawa / .ssh_config
Created August 11, 2016 20:42
GeneX2016@CSHL
## line starting with '#' is will be ignored by your computer (comment line)
## configuration
Host nickname_of_your_server
User somebody@somewhere.com
Port 22
Hostname server
IdentityFile ~/.ssh/server
IdentitiesOnly yes
def someMap: Map[String, Int]
someMap.keys.map(key => (key -> someMap(key).someFunc)).toMap
@yk-tanigawa
yk-tanigawa / myheatmap.py
Last active June 15, 2016 07:25
python plots snippet
def myheatmap(ndary):
X, Y = ndary.shape
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(1,1,1)
ax.set_xlim(0, Y)
ax.set_ylim(0, X)
ax.invert_yaxis()
ax.pcolor(ndary, cmap=plt.cm.Blues)
fig.show()
from itertools import groupby
import gzip
# Fasta IO
def fasta_iter(fasta_name):
'''
given a fasta file. yield tuples of header, sequence
modified from Brent Pedersen
Correct Way To Parse A Fasta File In Python
https://www.biostars.org/p/710/
@yk-tanigawa
yk-tanigawa / .ssh_config
Last active June 21, 2017 18:39
Templates
Host github.com
User somebody@somewhere.com
Port 22
Hostname github.com
IdentityFile ~/.ssh/github
IdentitiesOnly yes
Host *
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
@yk-tanigawa
yk-tanigawa / README
Created May 12, 2016 02:57
python notebook
いつも使うpython notebook の最初に書くimport 文
@yk-tanigawa
yk-tanigawa / file0.txt
Created May 6, 2016 05:32
Scala + Apache Spark をIntelliJにて開発する方法 ref: http://qiita.com/yk-tanigawa/items/4fc86c7e0e529c3b2fa0
- 例えば,http://qiita.com/chosan211/items/1472198165442e93047e などを参照してインストールする
- 手元のmac環境の場合は,macports を使って下記のように簡単にインストールできた
- `$sudo port install maven3`
- `$sudo port select --set maven maven3`
- `$ mvn --version`
from itertools import groupby
def fasta_iter(fasta_name):
'''
given a fasta file. yield tuples of header, sequence
modified from Brent Pedersen
Correct Way To Parse A Fasta File In Python
https://www.biostars.org/p/710/
'''
with open(fasta_name) as f: