Do you need computational skills in ecology and evolution?
This semester I am teaching an experimental design course.
21 and 2 dimensional sliding window
A blog reader recently asked if the sliding window function could be extended to a matrix; This seemed like something that might be useful so I have provided this extension below. Furthermore, once I looked at the code I realized that I needed to add validation testing and helpful error messages.
8Publons Data - Geographic connections
The Publons blog recently posted an interesting graphic showing the connections among editors and peer reviewers for 28146 reviews. As I started looking at the figures (which are great), I wanted to dig into the data.
converting trees to ms format
As part of a project with an undergrad this summer I am working on a theoretical study that involves simulations of many different tree topologies that include varying amounts and types of geneflow among lineages.
working with Phylota fasta files
I am working on a side project that involves downloading lots of sequence clusters from the phylota website. This is a handy tool and makes it quick and easy to get lots of useful sequence data. However, it also gives you all sequences in genbank for each species.
1Tracking my reading #365papers
For the past couple of years, there have been a small but growing group of people that have wanted to track their reading for a year. For most of us, the idea is that this will push us to read more broadly and more consistently.
1In Defense of Science
I have always intended this blog to serve as a place to chat about fun or interesting things related to my interests in Coleoptera, evolution, coding, and academia.
color palettes and color coding
I'll be giving a job talk in a month or so and I have been meaning to go through my standard slides and make sure that I am using color-blind friendly palettes. For the last year or so everything that I do with R, I tend to do using the viridis package which I know is supposed to be fairly good.
Population genetics teaching application
I am taking the opportunity to sit in Ruth Shaw's quantitative genetics class this semester. I hope that I get to teach this class at some point in the future and I thought it would be great to see how a pro like Ruth teaches this class.
ABBA BABA test and ambiguity in sequence data
First, if you need a quick refresher on what the ABBA/BABA test is you can check out this post: ABBA/BABA
Perhaps one of the simplest tests for introgression is the ABBA/BABA test. I have a couple of versions of this test implemented in my R package EvobiR.
R line styles - lty
Many functions in R that draw lines use arguments supplied to lty to determine the line format. Unfortunately, like so many things I don't seem to use this quite often enough to remember the possibilities. So this post is mainly provided so that I can find it quickly in the future.
Nettie Stevens and Sex Chromosomes!
I don't have time for a full post today but I would be remiss not to bring attention to Google's amazingly awesome doodle for the day.
Nettie Stevens did some of the early landmark research in chromosome biology. I highly recommend reading the recent article on the GSA blog by Cristy Gelling.
Evolutionary Pathways
Today I needed a function to extract all the evolutionary pathways on a phylogentic tree. Basically all the routes from the root to a tip. The key to doing this is just understanding the edge element of a phylo object in R. It is a 2 by X matrix where X is the number of branches in the tree.
Symbols and colors in R - PCH argument
Symbols
The argument pch, an abbreviation for plot character, is the standard argument to set the character that will be plotted in a number of R functions. Values of 0 to 20 specify a symbol the color which is by default black.
Fun Functions in R
Technically today is a holiday in the US... At least I've yet to see anyone else make it into the office. Therefor, it seems like a good time for a couple of less serious R functions that I wrote just for fun.
Extending the threshold model to 3 unordered states
Wright’s population genetic threshold model for discrete traits is an attractive trait model that may be biologically more realistic than alternatives like the Mk model. It assumes that the discrete traits we observe are the expression of an unobserved continuous trait (liability).
1Stochastic rounding or probabilistic rounding
I had an odd problem where I wanted to round numbers probabilistically. As an example if we have the number 7. 5 we should round to 7 half the time and to 8 half the time. This tie breaking method is commonly known as stochastic rounding.
1Plotting Flowers
I have a little side project that necessitated a function that would plot little flowers on a graph. You could do this by accessing a font that has flowers images but this might not work across systems with different fonts.
Software Carpentry Round 1
Last week I taught at my first software carpentry course. I was one of 6 instructors for this course (all first time SWC instructors). My teaching focused on intermediate R applications (documents and slides). Lots of things went really well and lots of things went really poorly.
1366 manuscripts
This post is now a year old! The approach of updating a blog post was a pain and didn't work out. I've got a better apporach planned for this year. Its working well and I'm already 8% of the way done with the year.
U of M EEB seminar - Castoe
Today’s seminar speaker was Todd Castoe from the University of Texas at Arlington where I did my Ph.D. While Todd wasn’t on my committee my office when I was a grad student was directly across the hall from Todd, so it was great to catch up with him.
1U of M - EEB seminar - Lockwood
Today we had an interesting seminar with Julie Lockwood from Rutgers University. Her talk title was Killing the cuddly: Tactics for managing exotic predators to protect their native prey.
1Brownian Motion
If you want to skip all the code and Shiny info you can jump straight to the shiny app: Brownian motion simulator.
In comparative phylogenetics Brownian motion is often either a null model that we compare observations to or is a de facto assumption that our methods depend on.
Ternary Diagram - Working Example
A couple of years ago I posted a bit of code that lets you plot data in a ternary diagram. This is a useful way to display proportion data when proportions are split between three possible states. Unfortunately, my original post included a link to the underlying data in my dropbox account.
Chromosome Evolution Conference
I had the good fortune of speaking at the American Genetics Association president’s symposium last week. There were many things to enjoy at this conference. First the location was Bainbridge Island just across the bay from downtown Seattle.
Hadley and Winston talk about the future of interactive graphics
--> I went to my first R users group meeting in Minnesota and was treated to talks by two R heavy weights.
Beetle behavior - do they avoid, aggregate, or simply wander
I have a student this semester who was interested in determining whether a group of beetles in a confined space (petri dish) avoided each other, aggregated in groups, or perhaps simply wandered randomly. I don’t know of an existing statistical test to determine the answer to this question.
R: concatenate alignments into a supermatrix
Today a friend asked me the easiest way to concatenate several hundred fasta format alignments that include some differences in the species present in each alignment into a single supermatrix.
Recent Publications: Beetle and Otherwise
Haven't had a lot of time for updates to the blog lately. However, I have a few beetle related publications recently.
1) An article that contains a lot of my dissertation research came out this summer in Genetics.
Sliding window analysis
Sliding window analyses are a common approach when examining very large datasets such as genomic data.
10Population Genetics Simulator
There are lots of population genetics simulators available as both standalone programs and online offerings. However, I decided that I wanted to make my own. So here is my Fisher-Wright model basic population genetics simulator.
evobiR
Over the course of the last couple of years I have written quite a few scripts in R. These scripts are more than just my own research, a few I have written for friends, others I wrote tying to understand a topic.
1SPAM: tree ≠ tree
I dont get a lot of spam on my blog and what I do get seems to be quite poorly targeted.
4Green Peas and Hamming Distances
The first problem for today is drawn from Mendel's first rule.
Given: Three positive integers k, m, and n, representing a population containing k+m+n organisms: k individuals are homozygous dominant for a factor, m are heterozygous, and n are homozygous recessive.
Add a comment