RSSAmplifier

Blog

Jonathan Chang

evolutionary biologist

jonathanchang.orgRSS feed ↗30 posts

Latest posts

Generating a triangular navigation mesh from H3 hexagons in R

Introduction A navigation mesh is a data structure used to aid in pathfinding around obstacles. Originally used for video games and robotics, we can also apply the concept of this navigational mesh to the movement of animals through landscape, using methods such as FEEMS . Consider the following landscape 1 : Finding a path from starting point s to goal point t is computationally challenging, as…

Download shapefiles from ESRI ArcGIS Online Story Maps

Recently, we needed to get out some shapefiles from an ArcGIS Online map . It’s immediately clear that there’s a lot of data, and no obvious way to get it from a download or share link anywhere on the app page. The desired solution is anything but taking a screenshot and tracing it in ImageJ, as that’s an absolute last resort. In this post, I’ll walk through how I managed to get those shapefiles…

Deploy your website to Neocities using GitHub Actions

This personal website (and a few of my hobby websites) are hosted on Neocities , a free web host service reminiscent of the now-defunct GeoCities . Neocities makes it incredibly easy to start creating websites right away, even for total beginners , with their web interface. However, I prefer to have all of my websites version controlled with Git and hosted on GitHub. To minimize the amount of…

Three ways to check and fix ultrametric phylogenies

A recent user bug report in my software TACT led me to look into how phylogenetic software varies in the way they determine whether a given phylogenetic tree is ultrametric (where the root-to-tip distance is equal among all tips). If you infer an ultrametric phylogeny using something like BEAST or treePL, your supposedly ultrametric tree can still cause problems for other tools by virtue of not…

Easily showcase your Google Scholar metrics in Jekyll

Whether you’re applying for academic positions, comparing yourself to your colleagues, or determining whether people on Twitter really deserve their grant funding, it’s important to look at scholarly metrics such as h-index , i10-index , and number of citations. However, showing them off directly in your CV is a major bummer, especially when you’re an academic superstar and are too busy to update…

Free yourself from the Spotify desktop client with spotifyd

Electron apps are a plague . If you’ve ever wondered why: your computer chugs to a halt once more than two of {Slack, Discord, Skype, Messenger, WhatsApp, Signal, GitHub Desktop, Steam, VS Code} are open on the same machine scrolling, or playing a GIF or whatever in those apps, is incredibly laggy every app download is now 100MB+ the typing shortcuts you’re used to in macOS Just Don’t Work then…

Continuous integration using GitHub Actions for Homebrew on Linux

Homebrew is arguably the most popular package manager for macOS , but it hosts a small and growing userbase on Linux as well! This blog post will explain how the Homebrew maintainers build binary packages ( bottles ) on Linux. How binaries used to be built on Linux Taps , in Homebrew parlance, are special directories in your Homebrew installation, which contain formulae that describe how to build…

Can we estimate diversification rates on extant phylogenies?

An exciting new paper by Stilianos Louca and Matt Pennell, “Extant timetrees are consistent with a myriad of diversification histories” 1 , is out now in Nature . I think it’s an interesting paper and wanted to quickly jot down my thoughts on it. There’s been widespread use of software tools like BAMM, RPANDA, and SSE-class models to estimate how diversity is generated by varying diversification…

Maintain your own Homebrew repository, with binary bottles

I’ve been using the Homebrew package manager for nearly a decade. After a few years of contributions I was asked to become a maintainer and was recently elected to serve on the Homebrew project leadership committee. Homebrew is an excellent cross-platform package manager, supporting macOS, Linux, and Windows 10. That being said, Homebrew does not package everything. Many things are too niche,…

Introducing fishtree and fishtreeoflife.org

In our recent publication ( Rabosky et al. 2018 ) we assembled a huge phylogeny of ray-finned fishes: the most comprehensive to date! While all of our data are accessible via Dryad , we felt like we could go the extra mile to make it easy to repurpose and reuse our work. I’m pleased to report that this effort has resulted in two resources for the community: the Fish Tree of Life website , and the…

What R package for phylogenetics is the most popular?

While writing my first R package and its associated manuscript, I needed to talk about some other R packages in the phylogenetics research community. The most obvious choice would be to just cite the ones that I actually use, but that doesn’t necessarily mean that other practicing phylogeneticists do the same. I needed to get some stats on which phylogenetics packages were actually popular, but…

Animating and labeling figures with ImageMagick

ImageMagick is an incredible command-line tool that lets you edit and convert images of all sorts. Suppose you wanted to compare some figures that you’ve generated , and label the figures with their respective filenames so that you know which is which. Here’s a quick worked example in R and Terminal that gets you going. First, let’s generate some figures to compare. The latest version of ggplot2…

Removing PAUP's expiration date and version check

Bottom line PAUP* phones home for a version check every time it is started. This function is undocumented and the software itself does not alert the user that this occurs. PAUP* also has an expiration date, set to July 2018 at the time of this writing, after which the program cannot be used. Note: PAUP (as of version 4a166) now no longer expires. The version check still exists, though. I would…

How to partially rasterize a figure plotted with R

If you work with datasets that are big enough in R you will eventually encounter situations where your plots are so complex that they do things like crash Preview.app on macOS. For me this happens a lot when I generate huge scatterplots with very dense overplotting. These don’t add much information to the figure but nevertheless must be rendered by your PDF viewer, slowing it down and generally…

Painless (almost) multiple-choice exams in LaTeX

Worked example files: example.tex Modified mcexam.sty Sign up for Overleaf, an online LaTeX editor, with my referral code! Requirements If you, like me, are interested in writing exams, there is a serious lack of free, quality tools to write exams. In my experience, most instructors that I’ve worked with basically slap something together in Microsoft Word and call it a day. While this is fine for…

Splitting a concatenated RAxML-style PHYLIP file

I’ve written a little script in Python 3 that will unconcatenate a RAxML-style PHYLIP + partitions file. I’ve used it recently to do a gene tree-species tree analysis for phylogenetic inference. It’s a little slow since it doesn’t manage file handles well (or at all), but it should use very little memory and therefore be able to handle very large concatenated alignments. Here’s a short worked…

Pushing to someone else's pull request on GitHub

If you’re a maintainer of an open source repository on GitHub, you often want to make a small change to a pull request but don’t want to wait for the original author to make changes or open a brand new pull request. GitHub now allows upstream maintainers, with permission, to push to downstream forks , but the provided instructions don’t meet my needs. Specifically, I don’t want to have to re-clone…

Updating Homebrew formulae when your software gets a new version

To get bioinformatics software on my Mac I rely on the Homebrew package manager . Unfortunately, the Brewsci/bio tap , where most biology software lives, doesn’t always update right after a new version is released. While you could wait for someone to update it for you, it’s faster and more fun to do it yourself, and you also get to learn about contributing to Homebrew! I’ve written a brief…

Setting up Samba home folder shares for a CentOS 7 server

CentOS 7 has made life so much easier compared to the last time . All of the following commands need to be run as the superuser. yum install samba samba-client samba-common systemctl enable smb systemctl enable nmb setsebool -P samba_enable_home_dirs on firewall-cmd --permanent --zone = public --add-service = samba firewall-cmd --reload You might also need to set your Samba password depending on…

Snow Leopard Server with Mavericks clients, and why to avoid Mac Server

Note: the below text was written in 2014 but never posted. I have kept the same tense since I don’t want to rewrite it. Our lab has a setup where we have multiple workstation iMacs that connect to a Mac Mini server, with network accounts stored on the server. Previously, both server and clients were running Snow Leopard, but I’ve just upgraded two of the clients to Mavericks while keeping the…

SICB 2015 presentation slides!

I presented my crowdsourced morphometrics work with the Encyclopedia of Life at the Society for Integrative and Comparative Biology last month! I got some great feedback, both in person and via Twitter. Check out the slides via the link below! Chang, Jonathan (2015): Crowdsourced morphometric data are as accurate as traditionally collected data. figshare.…

Setting up Samba home folder shares for a CentOS 6 server and Mac OS X client

Update : Setting up home directory shares is now much easier on CentOS 7 . On Mac OS X if you want to share your home folder over the network with authentication, you only have to tick a check box in System Preferences and It Just Works™. On CentOS Linux? Well… Today I wanted to access my home folder on our Linux analysis machine over the network on a Mac OS X client. Although I could have just…

Using RMarkdown, knitr, and pandoc in TexShop on Mac

Most people will use RStudio for this sort of workflow, but I use TeXShop because I prefer the side-by-side editing view with plain text on the left and the formatted version on the right. I don’t think RStudio supports it. Also, TeXShop feels like a native OS X application. RStudio can’t really shed its Qt roots no matter how hard it tries. Here’s how to get TexShop working with your RMarkdown…

Fixing pandoc "out of memory" errors on Windows

Recently I’ve been using the rmarkdown + knitr + pandoc workflow to write manuscripts. Markdown with Pandoc is roughly a million times easier to use than the equivalent LaTeX workflow. With the addition of RMarkdown and knitr included in RStudio, you can also weave R plots and output directly into your manuscripts. I was inspired to do this by Carl Boettiger’s online lab notebook and Rich…

How accurate are crowdsourced morphometricians?

Previously: Building a web-based image markup system One of the main goals of my Encyclopedia of Life project is to speed up the collection of phenotypic data through crowdsourcing. However, we cannot expect that the typical crowdsourced worker has the same domain-specific knowledge that an expert scientist has. But does this make a difference when digitizing the shape of fishes? To look for a…

Count missing characters in FASTA files with a shell one-liner

One of the best things about working with FASTA and PHYLIP files is they are relatively simple file formats and thus are easy to parse with command-line tools. There are certainly a lot of negatives to these file types but it is handy for certain types of tasks. I needed to find out how much missing data were in our FASTA and PHYLIP multiple sequence alignments. While it would be straightforward…

Building a web-based image markup system

A web-based service like Amazon Mechanical Turk needs a web-based interface for turkers to crowdsource data on fish shape. Existing software to digitize images requires a separate download, and most of it runs only on Windows. Distributing this software to hundreds of crowdsourced workers and ensuring it works on their computers can be quite a challenging task. To that end, we’ve had to develop an…

Evolution 2013 presentation, notes and slides

Our pilot study worked! Over a dozen Mechanical Turk workers helped to digitize our pilot study sample of fishes. For more details and results, check out the slides I presented at Evolution . This was my first year attending Evolution, and it was exciting showing my work with the Encyclopedia of Life to an amazing group of scientists. I got lots of great feedback from people interested in my idea…

Encyclopedia of Life Rubenstein Fellowship: Crowdsourced morphology

This is a rather late announcement, but my project proposal, “ Using massively crowd-sourced data to examine morphological impacts of extinction risk in ray-finned fishes ”, was selected for the 2013 Rubenstein Fellows Program . I’m happy to announce that the first pilot study of my project is starting today. These first steps are the result of much preparation with my collaborators, Dan Rabosky…

Some utilities for dealing with character data

Concatenation Concatenating character matrices seems like it ought to be easy, but I’ve had far too many issues with data formats to naively make that kind of statement. Mesquite never seemed to give output that could be consumed by other programs, Geneious had import issues, and all of my own hand-rolled techniques would always seem to hit edge cases. SequenceMatrix is quite a robust little piece…