Skip to content

Instantly share code, notes, and snippets.

View yoavram's full-sized avatar

Yoav Ram yoavram

View GitHub Profile
@yoavram
yoavram / truncnorm.py
Last active June 29, 2017 10:40
Truncated normal distribution in Python. Translation fron CRAN/truncnorm (https://github.com/cran/truncnorm) C code to python. The examples in the __main__ are comparisons to R.
import numpy as np
from scipy.stats import norm
EPSILON = 1e-10
DBL_MAX = 1.79769e+308
M_1_SQRT_2PI = 1.0/np.sqrt(2.0 * np.pi)
t1 = 0.15
t2 = 2.18
t3 = 0.725
t4 = 0.45
@yoavram
yoavram / environment.yml
Created October 25, 2015 16:05
conda environment file for FlowCytometryTools https://github.com/eyurtsev/FlowCytometryTools
name: flowcytometrytools
dependencies:
- matplotlib=1.4.3=np110py27_1
- numpy=1.10.1=py27_0
- pandas=0.17.0=np110py27_0
- pip=7.1.2=py27_0
- pyparsing=2.0.3=py27_0
- pyqt=4.10.4=py27_1
- python=2.7.10=1
- python-dateutil=2.4.2=py27_0
@yoavram
yoavram / .travis.yml
Last active June 7, 2019 11:30
Build and deploy conda packages to Anaconda.org from Travis-CI
language: python
python:
- 2.7
- 3.4
# Setup anaconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
@yoavram
yoavram / future-walker.py
Created October 8, 2015 21:58
walks through a folder, collects python files, calls futurize
from __future__ import print_function
import glob
import os
import subprocess
blacklist = [__file__, 'venv', 'venv3', 'build', 'dist']
def walker(path):
"""Folder walker that collects .py files
@yoavram
yoavram / data-win1255.csv
Last active September 21, 2015 20:15
Israeli elections 2009 data in Win1255 encoding (see https://github.com/yoavram/elections-2009 for utf8).
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 37 columns, instead of 6 in line 8.
,ß≥∞Θ µδσ· ßτΘ°Σ,ε÷ßΘ≥Θφ,Σ≥ßσπΣ,ασ°,ε⌠πפ∞,ΘΣπσ· Σ·σ°Σ,ß∞פπ,Σ·≡σ≥Σ ΣΘ°σ≈Σ εΘεπ,τπפ∙,Γε∞αΘφ,Θ∙°α∞ τµ≈Σ,αΘτσπ ∞ασεΘ,ΣΘ∙°α∞Θφ,∞ß,≡Θ÷σ∞Θ Σ∙σαΣ σßσΓ°Θ ≥∞Σ Θ°σ≈,≈πΘεΣ,Θ∙°α∞ ßΘ·≡σ,∞Θδσπ,ε°÷,Θ∙°α∞ Σε·τπ∙·,ατ°Θσ·,∞µσµ,∞στεΘ τß°Σ εαστπΘφ,°≥פε,δτ ∞Σ∙⌠Θ≥,εΣ⌠Ω ßτΘ≡σΩ,ß°Θ· ≥σ∞φ,µδσΘσ· ΣΓß° ßε∙⌠τΣ,÷σε·,÷ß°,π≥φ,≥∞Σ Θ°σ≈,δστ Σδ±≤,∞Θπ°,ΣΘ°σ≈Θφ,∙פ±
αßσ Γσ∙,3476,1553,26,0,1,1,591,0,79,1,0,5,1,0,2,155,8,21,25,2,0,3,0,551,1,0,0,1,3,2,1,7,3,0,1,12
αßσ ±≡α∩,7147,4203,309,1,1,3,439,1,1592,5,0,5,2,0,0,292,158,295,61,0,2,2,2,789,0,0,0,4,2,3,6,3,2,1,2,129
αßσ ≈σ°Θ≡α· (∙ßΦ),2114,531,20,0,0,2,1,0,2,1,1,0,1,0,0,35,1,7,3,2,2,1,0,417,0,0,3,0,1,0,0,3,6,0,1,8
αßσ °σßΘΘ≥Σ (∙ßΦ),2530,497,10,0,1,3,132,1,2,3,0,0,3,0,0,6,3,8,5,2,0,1,1,257,1,0,1,2,4,4,5,0,2,3,3,12
αßσ °σ≈ΘΘ≈ (∙ßΦ),3393,678,6,0,1,1,4,0,4,0,1,0,5,0,2,2,1,5,2,0,1,0,0,594,0,0,1,4,0,1,6,2,2,3,2,4
αßΦΘ∩,1340,695,5,0,0,2,165,1,47,0,0,5,0,1,0,5,0,3,2,0,0,1,0,438,7,0,0,1,0,1,0,1,0,1,0,5
αßΦ∞Θσ∩,170,133,22,0,0,0,0,7,0,0,0,0,0,0,0,68,7,15,13,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0
αßΘα∞,430,335,30,0,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yoavram
yoavram / lowess.py
Created August 26, 2015 06:03 — forked from agramfort/lowess.py
LOWESS : Locally weighted regression
"""
This module implements the Lowess function for nonparametric regression.
Functions:
lowess Fit a smooth nonparametric regression curve to a scatterplot.
For more information, see
William S. Cleveland: "Robust locally weighted regression and smoothing
scatterplots", Journal of the American Statistical Association, December 1979,
@yoavram
yoavram / lmd2fcs.R
Last active February 2, 2022 19:01
Convert flow cytometry formats: Gallios Coulter Beckman LMD file to standard FCS file.
# install
source("http://bioconductor.org/biocLite.R")
biocLite("flowCore")
# convert
library(tools) # for file_path_sans_ext
library(flowCore)
in.fname <- 'flow123.LMD'
folder <- 'C:\\users\\user\\flow\\'
@yoavram
yoavram / email.md
Last active August 29, 2015 14:22
17/6 - Poster Session of the "Python Programming for Biologists" course

Hello,

We'd like to invite you to the Poster Session of the "Python Programming for Biologists" course.

The session will include posters by the students describing their research and utilizing computational tools discussed during the course, including biological data analysis, statistical analysis, visualization and plotting, simulations and more.

See the invitation for a list of poster titles.

The session will take place at 16-18:00 on Wednesday, 17 June 2015 in the Sherman building lobby.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.