Skip to content

Instantly share code, notes, and snippets.

View bow's full-sized avatar

Wibowo Arindrarto bow

View GitHub Profile
@bow
bow / bioinf-format-gotchas.md
Created April 5, 2017 20:05
Bioinformatics file format-specific quirks
  • Coordinates are one-based, fully closed (i.e. position start at 1 and an interval's end position is included).
  • (for files released by GENCODE & Ensembl) CDS include start_codon but not stop_codon. stop_codon is included in the UTR instead.
  • Coordinates are zero-based, half open (i.e. position start at 0 and an interval's end position is not included).
  • (for refFlat.txt.gz file available via UCSC) CDS does include start and stop codons
@bow
bow / cli_argparse.py
Last active April 25, 2018 12:29
Python CLI templates
#!/usr/bin/env python
"""
One-line description.
More elaborate description.
"""
import argparse
@bow
bow / handy.sql
Last active April 19, 2018 12:29
Handy PostgreSQL queries
-- View index sizes and some of their stats, largest first.
SELECT idx.relname AS table_name,
idx.indexrelname AS index_name,
pg_size_pretty(pg_relation_size(cls.oid)) AS size,
cls.reltuples AS num_tuples,
idx.idx_scan AS num_scanned,
idx.idx_tup_read AS num_read,
idx.idx_tup_fetch AS num_fetched
FROM pg_stat_user_indexes idx,
pg_class cls,
@bow
bow / Vagrantfile
Last active November 23, 2021 09:49
Stock Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API version
VAGRANTFILE_API = 2
# Set global VM name.
VM_NAME = ENV["VM_NAME"] || "stock"
# Environment-variable controlled config values with some defaults