Skip to content

Instantly share code, notes, and snippets.

View olgabot's full-sized avatar

Olga Botvinnik olgabot

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@olgabot
olgabot / ipynb_slides_live_code.md
Created July 16, 2014 19:41
IPython Notebook slideshows with live code

Clone the slideshow template to where you will be making your IPython notebook slideshows. You need style.css and talktools.py specifically.

Clone this repo to your equivalent of:

~/.ipython/nbextensions/

then, for whichever profile you use, in my case "customcss," edit the file:

~/.ipython/profile_customcss/static/custom/custom.js
@olgabot
olgabot / pcaplot.py
Last active August 29, 2015 14:04
groupby-centric PCA
from sklearn.decomposition import PCA
from sklearn.decomposition import RandomizedPCA
def pcaplot(df, sample_id_to_label, pivot_kw=None, x_pc=1, y_pc=2, distance='L1',
whiten=True, num_vectors=10, label_to_color=None,
title='PCA', show_vectors=True,
show_vector_labels=True, T=False,
fillna=False, dropna=False,
pca_type='PCA', s=100, text_group=None,
three_d=False):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@olgabot
olgabot / split_track_hubs.py
Created August 1, 2014 01:05
split up track hubs into chunks so UCSC doesn't get mad
def single_track(track):
within_track = False
lines = []
with open(track) as f:
for line in f:
# print line,
if line.startswith('track') and within_track:
within_track = False
yield lines
lines = [line]
import pandas as pd
mini_summary = pd.read_csv('https://www.dropbox.com/s/elv636x7wma51zd/mini_summary.csv?dl=1')
test_groupby = {'P4_11': 'test1',
'P8_10': 'test1'}
index_cols = ['million_reads', 'splice_type', 'event_name']
for pair_name, df1 in mini_summary.groupby(test_groupby):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.