Skip to content

Instantly share code, notes, and snippets.

View yk-tanigawa's full-sized avatar

Yosuke Tanigawa yk-tanigawa

View GitHub Profile
local$ ssh -L 8888:localhost:8888 remote
remote$ jupyter notebook
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
c = get_config()
#c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:xxxx'
c.NotebookApp.open_browser = False
#c.NotebookApp.port = 8899
#usage: make SRA=XXXXX.sra
## commands
FASTQ-DUMP = /somewhere/fastq-dump
## files
FASTQ1 = $(SRA:%.sra=%_1.fastq)
FASTQ2 = $(SRA:%.sra=%_2.fastq)
all: $(FASTQ1) $(FASTQ2)
@yk-tanigawa
yk-tanigawa / file0.txt
Created February 23, 2016 02:34
NCBI SRA (Short Read Archive) 形式から fastq 形式に変換する Makefile ref: http://qiita.com/yk-tanigawa/items/f78834d697daf23378b0
## commands
FASTQ-DUMP = /somewhere/fastq-dump
## files
FASTQ1 = $(SRA:%.sra=%_1.fastq)
FASTQ2 = $(SRA:%.sra=%_2.fastq)
all: $(FASTQ1) $(FASTQ2)
# obtain the paired-end fastq files from a given sra file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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:
@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`
@yk-tanigawa
yk-tanigawa / README
Created May 12, 2016 02:57
python notebook
いつも使うpython notebook の最初に書くimport 文
@yk-tanigawa
yk-tanigawa / .ssh_config
Last active June 21, 2017 18:39
Templates
Host github.com
User [email protected]
Port 22
Hostname github.com
IdentityFile ~/.ssh/github
IdentitiesOnly yes
Host *
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
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/