Skip to content

Instantly share code, notes, and snippets.

View joefutrelle's full-sized avatar

Joe Futrelle joefutrelle

  • Falmouth, MA
View GitHub Profile
@joefutrelle
joefutrelle / proteomz.py
Last active September 30, 2017 14:43
bokeh plotting of proteomics data (checkpointing)
# coding: utf-8
import pandas as pd
import numpy as np
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource
from bokeh.io import curdoc
from bokeh.layouts import row, widgetbox
from bokeh.models.widgets import Select, Slider, TextInput
from bokeh.models import HoverTool, CustomJS
@joefutrelle
joefutrelle / dir_rate.py
Created August 9, 2017 13:09
computes rate of mods to files in a directory and reports in files/hr
from __future__ import print_function
import os
import sys
DIR=sys.argv[1]
times = []
for fn in os.listdir(DIR):
path = os.path.join(DIR, fn)
@joefutrelle
joefutrelle / roi_features.m
Last active April 28, 2017 19:54
fetch the feature vector for a single IFCB ROI, given its URL
function [ feavec, feanames ] = roi_features ( roi_url )
[dir, file, ~] = fileparts(roi_url);
roi_url = [dir '/' file];
roi_metadata = webread([roi_url '.json']);
bin_url = roi_metadata.binID;
roi_number = roi_metadata.targetNumber;
features_url = [bin_url '_features.csv'];
@joefutrelle
joefutrelle / Vagrantfile
Created April 4, 2017 16:46
IFCB dashboard box install
Vagrant.configure("2") do |config|
config.vm.box = "joefutrelle/ifcb-dashboard"
config.vm.provider "virtualbox" do |vb|
vb.memory="2048"
end
config.vm.network :forwarded_port, host: 8888, guest: 8888
config.vm.provision :shell, inline: <<-SHELL
SHELL
config.vm.provision :shell, run: "always", inline: <<-SHELL
curl -s http://localhost:8888/ > /dev/null
@joefutrelle
joefutrelle / Dockerfile
Created March 29, 2017 16:50
LOBSTAHS deps Docker
FROM debian:jessie
RUN apt-get update
RUN apt-get install -y libnetcdf-dev libssl-dev software-properties-common libcurl4-openssl-dev
RUN apt-key adv --keyserver keys.gnupg.net --recv-key 6212B7B7931C4BB16280BA1306F90DE5381BA480
RUN add-apt-repository 'deb http://cran.rstudio.com/bin/linux/debian jessie-cran3/'
RUN apt-get update
RUN apt-get install -y r-base
WORKDIR /
ADD installLobstahsDeps.r .
RUN R -f installLobstahsDeps.r
@joefutrelle
joefutrelle / portho_ts_profile.py
Created March 11, 2017 19:33
Example DataFrame roundtripping for OrthogonalMultidimensionalTimeseriesProfile
import datetime
import numpy as np
import random
import pandas as pd
# construct fake dataframe
then = datetime.datetime.utcnow()
n_times = 2
@joefutrelle
joefutrelle / fake timeseries profile orthogonal.ipynb
Created March 11, 2017 16:46
impl strategy for orthogonal timeseries profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joefutrelle
joefutrelle / mmp2netcdf.py
Created March 10, 2017 15:54
Convert wire-crawler JSON data to NetCDF
import os
import numpy as np
import pandas as pd
import json
import datetime
from pocean.dsg.timeseries.om import OrthogonalMultidimensionalTimeseries
def from_xdata(j):
df = pd.DataFrame(j)
@joefutrelle
joefutrelle / Dockerfile
Created December 2, 2016 21:46
Test pyifcb in Docker
FROM ubuntu:trusty
RUN apt-get -y update
RUN apt-get -y install python-pip git
RUN pip install functools32
RUN apt-get -y install python-scipy python-pandas python-h5py python-requests python-Pillow
WORKDIR /
RUN git clone https://github.com/joefutrelle/pyifcb.git
WORKDIR /pyifcb
CMD git pull && python -m unittest discover
@joefutrelle
joefutrelle / MBVL bacteria and diatom with VAMPS metadata.ipynb
Created November 1, 2016 17:25
MBVL bacteria and diatom with VAMPS metadata
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.