In graduate school I discovered the power of using computers to make my life easier. I’ve been using R since my undergraduate days for data analysis, statistics, and general-purpose programming, but these days I’m more likely to use Python for most tasks.
Below are some examples of code I wrote to do interesting things during graduate school. Now, I mostly tinker with various algorithms I find ad hoc as I read interesting books. For instance: here’s an interesting fractal-like image that comes from a recursive process. By design I’ve outlawed points in the large fish in the center; all the other smaller fish appear in the image as a by-product of the algorithm.
I use OpenCV in Python to track the fish in all my experiments. This makes data collection fast, repeatable, and precise.
The graphic below represents ~3.5 million measurements of fish locations and heading angles for one of my experiments. Darker hexagons represent regions of the tank where the fish spent more time:
I created a GUI python program for coding behavior data for an experiment in the Cummings lab. It allows the user to identify the location of different types of fish in a video and record the number and type of behaviors observed. I also wrote code in R that parses the resulting json data automatically creates various graphs of interest.
I find myself dissatisfied with the plotting defaults and types of plots that can be produced with base R, so I created a plotting package that implements (1) good defaults for various types of graphs and (2) adds new types of graphs with an emphasis on categorical x continuous data. See here for my thoughts and best practices for creating graphics.
For ggplot2 users, you can find a clean theme and some nice color scales here.
I have some experience analyzing data from RNA-seq studies. See the code here.
I’ve written code to do various other tasks, like coordinating two computers to show video on three-four screens simultaneously, brew beer according to a precise temperature series, scramble video stimuli for use in behavior trials (see below), and various other things.
I’ve also authored a personal R package which implements some convenience functions for working with ggplot2, some statistics functions, and automated exploratory data analysis. You can check it out here.