Skip to content

Instantly share code, notes, and snippets.


Nezar Abdennur nvictus

View GitHub Profile
nvictus /
Last active Jun 16, 2020
motif PFM/PWM dataframe reader
import numpy as np
import pandas as pd
def _probability_mat_to_information_mat(prob_df, bg_df):
Converts a probability matrix to an information matrix.
Taken from logomaker (
nvictus /
Last active Jun 13, 2020
preferred numbers
def geomprog(start, mul):
Generate a geometric progression.
Beginning with integer `start`, generate an unbounded geometric
progression with ratio `mul`.
start = int(start)
yield start
nvictus /
Created Mar 16, 2020 — forked from GaelVaroquaux/
Estimating entropy and mutual information with scikit-learn
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
These computations rely on nearest-neighbor statistics
import numpy as np
nvictus / godsnot.json
Created Dec 24, 2019
A large palette of reasonably distinct colors
View godsnot.json
nvictus /
Last active Jan 22, 2020 — forked from nokados/
Paginator for pandas.DataFrame in Jupyter Notebook
Forked from:
* Added slider control to scroll through pages of really large dataframes.
* Reduce flicker by making events trigger widget element updates instead of
clearing output and re-rendering.
* Add support for dataframe CSS styling.
* Register custom pandas accessor
nvictus / cool.r
Last active Oct 25, 2019
coolR: a cooler reader for R
View cool.r
# Notes
# -----
# * Cooler's stored bin IDs are 0-based. However, for consistency with R, this API should take
# 1-based indexing as input for table row and matrix range queries.
# * See Ilya's implementation:
nvictus / .inputrc
Last active May 1, 2018
linux inputrc
View .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
nvictus / load-dense-contact-matrix.ipynb
Last active Jul 16, 2017
load dense contact matrix
View load-dense-contact-matrix.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
nvictus /
Last active Jun 20, 2017
print traceback in warnings
import traceback
import warnings
import sys
def warn_with_traceback(message, category, filename, lineno, file=None, line=None):
log = file if hasattr(file,'write') else sys.stderr
log.write(warnings.formatwarning(message, category, filename, lineno, line))
View zarr-s3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.