Skip to content

Instantly share code, notes, and snippets.

Avatar

Nezar Abdennur nvictus

View GitHub Profile
View Zimm-Braggin'.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View rs1421085.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:240c9e9ee33e20d02a36
CONDA_DIR="$HOME/miniconda"
alias workon='source $CONDA_DIR/bin/activate'
# function workon () {
# source "$CONDA_DIR/bin/activate" "$1"
# }
function __conda_user_setup () {
_workon_tab_completion_bash () {
@nvictus
nvictus / lexbisect.py
Last active Jan 14, 2016
Bisection search on lexically sorted sequences in Python.
View lexbisect.py
def lexbisect(arrays, values, side='left', lo=0, hi=None):
"""
Bisection search on lexically sorted arrays.
Parameters
----------
arrays : sequence of k 1-D array-like
Each "array" can be any sequence that supports scalar integer indexing,
as long as the arrays have the same length and their values are
lexsorted from left to right.
View cooler_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvictus
nvictus / example-ucsc.ipynb
Last active Sep 2, 2016
UCSC genome browser to matplotlib
View example-ucsc.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvictus
nvictus / discreternd.py
Last active Sep 5, 2016
Sample a discrete distribution (i.e. simulate a loaded die) efficiently via the "alias sampling" method
View discreternd.py
"""
Alias sampler
=============
See : <http://www.keithschwarz.com/darts-dice-coins/> by Keith Schwarz.
References
----------
+ Vose, Michael D.
View tilt_matrix_diag_utils.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nvictus
nvictus / expected.py
Last active Feb 27, 2017
cooler_expected_new.ipynb
View expected.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from multiprocess import Pool
from functools import partial
from itertools import chain
import itertools
import argparse
import sys
@nvictus
nvictus / doi2bib
Last active Apr 3, 2017
Fetch reference citations in BibTeX, JSON or YAML from DOI
View doi2bib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import tempfile
import requests
import argparse
import textwrap
import sys
You can’t perform that action at this time.