Skip to content

Instantly share code, notes, and snippets.

View olgabot's full-sized avatar

Olga Botvinnik olgabot

View GitHub Profile
@olgabot
olgabot / (home-yeo) ssh -4 -vvv tscc-login1 7710:localhost::7710
Last active August 29, 2015 13:58
Debugging ssh tunneling into TSCC
debug3: load_hostkeys: loading entries for host "tscc-login1" from file "/home/obotvinnik/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug3: load_hostkeys: loading entries for host "tscc-login1" from file "/etc/ssh/ssh_known_hosts"
debug3: load_hostkeys: found key type DSA in file /etc/ssh/ssh_known_hosts:341
debug3: load_hostkeys: found key type RSA in file /etc/ssh/ssh_known_hosts:342
debug3: load_hostkeys: loaded 2 keys
debug3: load_hostkeys: loading entries for host "10.1.255.90" from file "/home/obotvinnik/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug3: load_hostkeys: loading entries for host "10.1.255.90" from file "/etc/ssh/ssh_known_hosts"
debug3: load_hostkeys: found key type DSA in file /etc/ssh/ssh_known_hosts:341
@olgabot
olgabot / README.md
Last active August 29, 2015 13:58
Segfault on scipy test_djbfft

How Numpy was installed:

git clone [email protected]:numpy/numpy
git clone [email protected]:scipy/scipy
cd numpy
cp ~/.numpy.site.cfg .

emacs numpy/distutils/intelccompiler.py 
# In "IntelEM64TCCompiler", changed:

self.cc_exe = 'icc -m64 -fPIC'

@olgabot
olgabot / matplotlib_axes_set_ticks_position_ticklabels_disappear.ipynb
Last active August 29, 2015 14:00
matplotlib ticklabels text disappears when set to non-default position
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@olgabot
olgabot / pandas_groupby_operate_on_specific_columns.py
Last active August 29, 2015 14:00
pandas groupby operate on specific columns and sub-columns
json = '{"chrom":{"4010":"chr2","4011":"chr2","4012":"chr2","4013":"chr2","4014":"chr2","4015":"chr2","4016":"chr2","4017":"chr2","4018":"chr2","4019":"chr2","4020":"chr2","4021":"chr2","4022":"chr2","4023":"chr2","4024":"chr2","4025":"chr2"},"first_bp_intron":{"4010":50149390,"4011":50170930,"4012":50280729,"4013":50318633,"4014":50464109,"4015":50692700,"4016":50693626,"4017":50699610,"4018":50723234,"4019":50724853,"4020":50733756,"4021":50755790,"4022":50758569,"4023":50765775,"4024":51012497,"4025":51015345},"last_bp_intron":{"4010":50170841,"4011":50280408,"4012":50318460,"4013":50463926,"4014":50692579,"4015":50693598,"4016":50699435,"4017":50723042,"4018":50724470,"4019":50733632,"4020":50755762,"4021":50758364,"4022":50765390,"4023":50779724,"4024":51017681,"4025":51017681},"unique_junction_reads":{"4010":1,"4011":3,"4012":6,"4013":6,"4014":15,"4015":8,"4016":8,"4017":5,"4018":40,"4019":86,"4020":85,"4021":64,"4022":81,"4023":53,"4024":12,"4025":9}}'
sj = pd.read_json(json)
five_prime_reads = sj.
import pandas as pd
json = '{"chrom":{"18716":"chrM","28459":"chrM","41509":"chrM","22813":"chrM"},"first_bp_intron":{"18716":728,"28459":728,"41509":728,"22813":728},"last_bp_intron":{"18716":5369,"28459":5295,"41509":5295,"22813":5295},"strand":{"18716":2,"28459":2,"41509":2,"22813":2},"intron_motif":{"18716":"CT\\/AC","28459":"CT\\/GC","41509":"CT\\/GC","22813":"CT\\/GC"},"annotated":{"18716":false,"28459":false,"41509":false,"22813":false},"unique_junction_reads":{"18716":99,"28459":1407,"41509":1,"22813":139},"multimap_junction_reads":{"18716":0,"28459":0,"41509":0,"22813":0},"max_overhang":{"18716":49,"28459":50,"41509":34,"22813":45},"sample_id":{"18716":"M4_9","28459":"M6_4","41509":"M6_6","22813":"M1_08"},"multimap_junction_reads_filtered":{"18716":0,"28459":0,"41509":0,"22813":0},"unique_junction_reads_filtered":{"18716":99,"28459":1407,"41509":0,"22813":139},"total_filtered_reads":{"18716":99,"28459":1407,"41509":0,"22813":139},"psi5":{"18716":1.0,"28459":1.0,"41509":null,"22813":1.0},"psi3":{"18
@olgabot
olgabot / conda -h
Created June 16, 2014 23:11
After updating conda, many errors..
[obotvinnik@tscc-login2 ~]$ conda -h
Traceback (most recent call last):
File "/projects/ps-yeolab/software/anaconda/bin/conda", line 3, in <module>
from conda.cli import main
File "/projects/ps-yeolab/software/anaconda/lib/python2.7/site-packages/conda/cli/__init__.py", line 8, in <module>
from conda.cli.main import main
File "/projects/ps-yeolab/software/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 47, in <module>
from conda.cli import main_create
File "/projects/ps-yeolab/software/anaconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 11, in <module>
from conda.cli import common, install
@olgabot
olgabot / conda_environment
Created June 19, 2014 17:40
Conda info -a
(olga)[obotvinnik@tscc-login2 flotilla]$ conda info -a
Current conda install:
platform : linux-64
conda version : 3.5.5
python version : 2.7.7.final.0
root environment : /projects/ps-yeolab/software/anaconda (writable)
default environment : /projects/ps-yeolab/software/anaconda/envs/olga
envs directories : /projects/ps-yeolab/software/anaconda/envs
package cache : /projects/ps-yeolab/software/anaconda/pkgs
@olgabot
olgabot / test_predict.py
Created June 25, 2014 20:28
How to check for raising an error within a test class using pytest?
import numpy as np
import numpy.testing as npt
import pandas as pd
import pandas.util.testing as pdt
import pytest
from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier
from sklearn.preprocessing import LabelEncoder
class TestPredictorBase:
@olgabot
olgabot / binify.py
Created July 2, 2014 23:00
Bin a pandas dataframe on its columns
def binify(df, bins):
"""Makes a histogram of each row the provided binsize
Parameters
----------
data : pandas.DataFrame
A samples x features dataframe. Each feature will be binned into the
provided bins
bins : iterable
Bins you would like to use for this data. Must include the final bin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.