Christina Bergey - Notes & Code

Below are some code snippets and some notes that I thought might be helpful to others. Feel free to contact me if you would like a script modified for your purpose.

Bioinformatic Scripts

GitHub Repositories - All new bioinformatic code is now hosted in GitHub repositories. A few private ones will be released upon publication, but others are visible throughout.

RAD-seq Primates - The analysis pipeline for RAD-seq data that was used in Bergey et al. 2013 for five primates.

VCF-tab to FASTA - Perl script that concatenates all SNPs in a VCF tabular file (output from the vcf-to-tab utility of VCFtools) to make a FASTA alignment.

BSNP-to-FASTA-via-BED - Perl script that takes a file of SNPs from the program BSNP and a BED file of intervals and outputs a FASTA file of sequences for each of those intervals.

Pull Gene FASTAs out of GenBank File with BioPython - Python script that uses BioPython to split a GenBank file into a bunch of small FASTAs, one per gene.

Ape Genome Phylogeny Figure - I inferred the phylogeny of the great apes at several thousand loci. For most loci, the best supported tree showed humans and chimps closely related. This figure shows which locations supported each hypothesis.

Primates in GenBank - I wrote a BioPerl script to report how many primate sequences were in GenBank by genus. Here are the results.

Retrieve FASTA - A very short BioPerl script to grab a sequence from GenBank. You provide the accession number and it outputs the sequence in FASTA format.

Generating Graphics from NEXUS Files - A Python script that makes a graphic of a DNA alignment given a NEXUS file input.


Data Visualization

Primate Body Mass Visualization - A quick visualization of primates' body mass using D3.js. It's a nice illustration of just how large the subfossil lemurs were (R.I.P.).

Primate Journal Impact Factor - How primate journals' impact factors have changed over time.

Where Primate Pets are Legal - Map of state laws regulating the keeping of non-human primates as pets.

Google WebGL Globe Visualization of World Tree Cover - A 3D globe showing world tree cover using HTML5 and WebGL.

U.S. National Parks Map with Google Chart Tools - A quick test of Google Chart Tools' geochart map. Also, the discovery of a way to export geographic coordinates as KML files from Wikipedia pages.

Web History Visualization in R - Visualization of web browsing history in R, using data from Chrome web browser. Involves connecting to local SQLite database with R and ggplot2.

Maps of Primates on IUCN Red List - Threatened primates of the IUCN Red List 2008 mapped by country using R.

Map of Collaborations Among Primatologists - A visualization of collaborations among primatologists writing in the American Journal of Primatology, made using Perl, Gelphi, and SeaDragon.

Network of Collaborators Visualization - An interactive graph of the people with whom I've co-authored papers.

Interactive Primate Tree - An interactive primate evolutionary tree made to try out the JavaScript InfoVis Toolkit (JIT).

Google Similar Image Search Photomosaic - I took The Scream, cut it up into tiles, and searched the web for a images similar to each tiny bit. I then stitched the similar images back together, making a video.

Darwin Primate Mosaic - A photomosaic of Darwin made of thousands of primate pictures. Prints available for sale with a portion of the proceeds going to the Wildlife Conservation Society.

Map of ISIS Zoo Animals - I created a Google map of mammals in zoos listed with the ISIS, which might be useful for people looking for samples.

Primate Range Finder - I wondered if you could get an accurate picture of the ranges of wild primates by looking at the geographic distribution of their geotagged photos on Flickr. Here are the results.

Primate Orbit Explorer - A few interesting figures from a study on the primate orbit shape.


Miscellaneous Projects

Should I Buy a Slow Loris? (.com) - A single serving website that answers the question, should you get a slow loris as a pet?

Drawing Hats on Monkeys with Mechanical Turk - I paid strangers on the Internet to draw hats on a monkey.

GoPro Video of Squirrels near NYU - Testing out a GoPro with some close-ups squirrels in Washington Square Park.

Dog's Eye View - I put a GoPro on my long-suffering dog.

Preparing an Academic CV in LaTeX using Mendeley - An example of a CV created with LaTeX. Papers' bibliographic info, exported from Mendeley in BibTeX format, can be quickly added.

Stuff I Routinely Forget How to Do - A growing list of code snippets and computer tricks that constantly slip my mind.

Geometric Line Designs in R - Pretty, simple line art using R.

High School Bioinformatics Course Site - During summers, I taught a course on bioinformatics for NYC high school students with the Harlem Children's Society. Here's the class website, with Python code snippets suitable for beginners

Markov Text Generator - Using Markov chains to generate text similar to a sample set, I made some fake Darwin, Foucault, Frost, baboon research abstracts, and e-mail spam.

Narrated Slideshow Generator - I wrote a program to quickly make narrated informational slideshow videos for YouTube, and I'm looking for people to try it out.

Excel Mosaics - Wanting to learn the xlwt library for writing to spreadsheet files, I wrote a script to convert image files into mosaics using the cells of an Excel worksheet.

Fractal Leaf Generator - A bit of Python to generate Barnsley fern fractal images.

Sierpinski Triangle Generator - More fractals! Generate Sierpinski triangles using the chaos game method.

Repetition Encoder Illustration - An example of using redundancy to correct errors over a binary symmetric channel, illustrated with a drawing of a monkey.

Adding Masked Image with PIL - A Python script that pastes a masked image (in this case, a squirrel) in front of the background of your choice.

NetLogo Obstacle Avoidance Model - A NetLogo model of obstacle avoidance and flocking.

CSHO Human Evolution Explorer - An interactive timeline of human evolution, programmed in Flash.

Text Memorization Aid - A Perl script that aids the user in reviewing memorized texts, such as poetry.

Flash Map of South America - From a class on New World monkeys, here's an interactive Flash map with satellite imagery overlaid with World Wildlife Federation ecoregions.

Kid's Flash Game - For the Elmwood Park Zoo in Norristown, PA, I created several educational Flash games for the pre-kindergarten visitor.