Ralph Haygood

Ralph Haygood

Software developer and biologist


I design and develop software. More specifically, I make beautiful modern web applications, for both desktop and mobile devices. For example, I created DUGSIM, a laboratory information management system (LIMS) for the Duke University Genome Sequencing Shared Resource. My primary tools are Ruby on Rails, Sencha Ext JS, and Meteor. I’ve done many other kinds of programming too, including compilers, numerical analysis, and simulation, in languages including C, FORTRAN, and Python.

I study evolution, ecology, and genetics. In particular, I’m fascinated by evolutionary adaptations — the traits that enable organisms to survive and reproduce in such diverse and remarkable ways — including ecological factors that shape them and genetic factors that underlie them. My approaches are mathematical, computational, and statistical, but I often collaborate with experimenters. I’m familiar with many different kinds of genetic and genomic data and methods for analyzing them.

I’m potentially available either for employment as a regular employee or for contracting via my company Haygoodness L.L.C.


Here are three software systems I’ve made or contributed to:

  • DUGSIM is a laboratory information management system (LIMS) for the Duke University Genome Sequencing Shared Resource, which serves customers both at Duke and around the world. It enables customers to get self-serve estimates, request quotes from staff, place orders, download results, and receive invoices. It enables staff members to prepare quotes, process orders, schedule and track library preparations and sequencing runs, distribute results, and issue invoices. It has been in use since May, 2013 and has handled over 1700 orders as of September, 2014.

    Before DUGSIM, the facility made do with an expensive but unsatisfactory off-the-shelf LIMS, an assortment of spreadsheets, and other ad hoc measures. Because I tailored DUGSIM to their needs, it has made life much easier for both staff members and customers.

    DUGSIM is built with Ruby on Rails, Sencha Ext JS, MySQL, Phusion Passenger, and Apache.

  • Evarium was a Facebook application that did animated simulations of evolution under sexual selection and conflict, a topic on which I’ve done research (Haygood, 2004). It was described in the Facebook applications directory as follows: “Sex, death, and evolution on Facebook! Colorful critters mingle, males and females check each other out, and when a couple like each other, they mate. Children take after their parents, with occasional mutations to keep life interesting. Some critters are more popular than others, but popularity has its price: the more a critter mates, the sooner it dies.”

    At its peak, Evarium had several thousand users. Unfortunately, continual changes to Facebook’s platform made maintaining it burdensome, so I retired it. Eventually, I plan to revive it as a stand- alone web application.

    Evarium was built with Ruby on Rails, ActionScript/Flash, MySQL, Mongrel, and Nginx.

  • SICStus Prolog is a full-featured and widely used implementation of the Prolog programming language from the Swedish Institute of Computer Science. Many people have contributed to it over many years. My own contributions were mainly to compiling Prolog to machine code for several instruction set architectures. I published an article about this work (Haygood, 1994).

    Prolog and its compilation may seem esoteric to people outside communities where Prolog is popular (e.g., research in natural language processing), but some of the same techniques are now used to compile other traditionally interpreted languages such as JavaScript, Python, and Ruby.

    SICStus Prolog is built with Prolog, C, and several assembly languages.

Other projects include CardVine, an experiment in replacing business cards with a web application; iFavr, a Facebook application that let users “favrite” things outside Facebook before Facebook introduced its own “like” buttons; Aquarius Prolog, a testbed for Prolog compilation techniques; and the software used in much of the biological research described below.

I’m particularly knowledgable in three areas:

  • Web applications — I’m fluent in HTML, CSS, and JavaScript and experienced with Ruby on Rails, Sencha Ext JS, Sencha Touch, Meteor, Node.js, jQuery, Bootstrap, MySQL, MongoDB, and Memcached. The pace of change in techniques, libraries, and frameworks for web development is fast, so I’m continually reading about and experimenting with new ones. Since 2013, I’ve been especially interested in cryptography and other aspects of security for web applications.
  • Scientific programming — I’m experienced with numerical analysis, particularly of dynamical systems and partial differential equations; statistical analysis, particularly using linear regression, ANOVA, ANCOVA, regression trees, and meta-analysis; and bioinformatics, particularly for wrangling DNA sequences, aligning homologous sequences, and characterizing sequence evolution. I’ve programmed for these purposes in C, FORTRAN, Python, R, and Ruby.
  • System administration — Although I’m not an expert all-around sysadmin, I’m experienced with system administration as it pertains to web applications, such as configuring DNS, SSL/TLS, and servers including Apache, Nginx, and Phusion Passenger. I’m familiar with a wide array of standard tools in Linux and Unix environments and knowledgable about many aspects of computer architecture, operating systems, and networking.


Here are three research projects I’ve done or contributed to:

  • Gene expression variation, developmental robustness, and evolvability (Garfield et al., 2013). Colleagues and I measured and analyzed variation in skeletal elements of sea urchin larvae reared in our laboratory and in gene expression throughout a network of genes underlying skeletal development. The primary goal was to elucidate how organisms develop reliably despite genetic variation, which is abundant within the species we examined. A secondary goal was to elucidate how development remains evolvable despite this buffering against variation.

    Early in development, we found mostly qualitative, switch-like regulation of one gene by others, whereas later, we found mostly quantitative, graded-response regulation. The former tends to buffer variation in gene expression, hence it tends to promote the accumulation of hidden genetic variation that can become exposed to natural selection through sufficiently drastic environmental changes, potentially yielding developmental evolution. The predominance we found of such regulation early in development is intriguing, although the generality of this pattern remains to be seen.

  • Adaptive noncoding changes during human evolution (Haygood et al., 2007 and 2010). Colleagues and I analyzed publicly available human, chimpanzee, and macaque DNA sequences of non-protein-coding regions adjacent to protein-coding regions, the former being rich in elements affecting transcription of the latter. We found evidence for adaptive changes in such noncoding regions during human evolution since the most recent common ancestor with chimpanzees, particularly noncoding regions adjacent to coding regions for proteins known to be involved in neural development and function.

    Subsequently, we conducted a meta-analysis of surveys of either noncoding or coding regions for adaptive changes during human evolution. We found that noncoding surveys often indicate adaptive changes near coding regions for proteins known to be involved in neural development and function, whereas coding surveys seldom indicate adaptive changes within such regions.

    These findings are consistent with a long-standing conjecture that human cognition evolved mainly through changes in gene regulation.

  • Protein evolution under sexual selection and conflict (Haygood, 2004). I modeled the evolution of a pair of proteins, one of males or sperms and the other of females or eggs, whose interaction modulates the frequency of mating or fertilization in male–female or sperm–egg encounters. The model assumes sexual conflict, in that higher frequencies are better for males, but higher frequencies are eventually worse for females, due to polyspermy, for example. This assumption was motivated by data on sea urchins and abalones, which are broadcast spawners in which such conflict may well exist.

    I found that whether multiple variants of the proteins can coexist indefinitely depends on the dominance relationships among the variants (even without overdominance, which is well known to promote polymorphism). This finding may be relevant to the contrast between the sea urchin sperm protein bindin and the abalone sperm protein lysin and its egg receptor VERL. All these proteins are highly divergent between species, with evidence that the divergence is driven by selection, while bindin is highly polymorphic within several species, with evidence that the polymorphism is maintained by selection, whereas lysin and VERL are nearly monomorphic within species.

Other projects are presented in the publications listed below.

I’m particularly knowledgable in three areas:

  • Population and quantitative genetics — Most of my research is in this field, that is, the nature, causes, and effects of genetic variation. I’m familiar with all the major concepts and methods of the field. I’ve taught population genetics to undergraduate students at the level of J. H. Gillespie, 2004, Population genetics: A concise guide and quantitative genetics to graduate students at the level of M. Lynch and B. Walsh, 1998, Genetics and analysis of quantitative traits.
  • Statistics applied to genetics and genomics — In addition to the statistical apparatus of quantitative genetics, I’m experienced with, for example, Markov-chain modeling of DNA sequence evolution (Haygood et al., 2007), regression-tree modeling of gene expression vs. promoter sequences (Babbitt et al., 2010), and support-vector-machine modeling of allelic expression imbalance vs. assorted genomic features (Tung et al., 2009).
  • Formulating, analyzing, and interpreting quantitative models — I’m conversant with many approaches to quantitative modeling of biological processes, from differential or difference equations to individual-based simulations. Importantly, I understand not only how but also when to use various techniques, depending on what’s known or knowable about a situation and what kinds of findings would be interesting or useful.

Collaboration and communication

I can work effectively in teams, including multidisciplinary teams. For example, my contributions to SICStus Prolog (see above) involved active collaboration with other programmers, and the coauthors of my publications (see below) include anthropologists, ecologists, geneticists, and statisticians, among others.

I can communicate well with both scientists and non-scientists. For example, in addition to publishing in many scientific journals (see below) and speaking at many scientific conferences, I’ve taught biology, mathematics, and physics to students ranging from freshmen to doctoral students. My English, both spoken and written, is excellent.


C. C. Babbitt, R. Haygood, W. J. Nielsen, L. W. Pfefferle, J. Horvath, O. Fedrigo, and G. A. Wray. The impact of positive selection on gene expression during human evolution. In preparation.

D. A. Garfield, D. E. Runcie, C. C. Babbitt, R. Haygood, W. J. Nielsen, and G. A. Wray, 2013. The impact of gene expression variation on the robustness and evolvability of a developmental gene regulatory network. PLOS Biology 11:e1001696.

D. Garfield, R. Haygood, W. J. Nielsen, and G. A. Wray, 2012. Population genetics of cis-regulatory sequences that operate during embryonic development in the sea urchin Strongylocentrotus purpuratusEvolution and Development 14:152–167.

O. Fedrigo, A. D. Pfefferle, C. C. Babbitt, R. Haygood, C. E. Wall, and G. A. Wray, 2011. A potential role for glucose transporters in the evolution of human brain size. Brain, Behavior and Evolution 78:315–326.

T. A. Oliver, D. A. Garfield, M. K. Manier, R. Haygood, G. A. Wray, and S. R. Palumbi, 2010. Whole-genome positive selection and habitat-driven evolution in a shallow and a deep-sea urchinGenome Biology and Evolution 2:800–814.

R. Haygood, C. C. Babbitt, O. Fedrigo, and G. A. Wray, 2010. Contrasts between adaptive coding and noncoding changes during human evolutionProceedings of the National Academy of Sciences of the United States of America 107:7853–7857.

C. C. Babbitt, J. S. Silverman, R. Haygood, J. M. Reininga, M. V. Rockman, and G. A. Wray, 2010. Multiple functional variants in cis modulate PDYN expressionMolecular Biology and Evolution 27:465–479.

L. R. Warner, C. C. Babbitt, A. E. Primus, T. F. Severson, R. Haygood, and G. A. Wray, 2009. Functional consequences of genetic variation in primates on tyrosine hydroxylase (TH) expression in vitroBrain Research 1288:1–8.

J. Tung, O. Fedrigo, R. Haygood, S. Mukherjee, and G. A. Wray, 2009. Genomic features that predict allelic imbalance in humans suggest patterns of constraint on gene expression variationMolecular Biology and Evolution 26:2047–2059.

R. Haygood and M. Turelli, 2009. Evolution of incompatibility-inducing microbes in subdivided host populationsEvolution 63:432–447.

J. L. Walters, E. M. Binkley, R. Haygood, and L. A. Romano, 2008. Evolutionary analysis of the cis-regulatory region of the spicule matrix gene SM50 in strongylocentrotid sea urchinsDevelopmental Biology 315:567–578.

C. C. Babbitt, R. Haygood, and G. A. Wray, 2007. When two is better than oneCell 131:225–227.

R. Haygood, O. Fedrigo, B. Hanson, K.-D. Yokoyama, and G. A. Wray, 2007. Promoter regions of many neural- and nutrition-related genes have experienced positive selection during human evolutionNature Genetics 39:1140–1144.

B. W. Spitzer and R. Haygood, 2007. Migration load and the coexistence of ecologically similar sexuals and asexualsAmerican Naturalist 170:567–572.

Sea Urchin Genome Sequencing Consortium, 2006. The genome of the sea urchin Strongylocentrotus purpuratusScience 314:941–952.

R. Haygood, 2006. Mutation rate and the cost of complexityMolecular Biology and Evolution 23:957–963.

R. Haygood, 2004. Sexual conflict and protein polymorphismEvolution 58:1414–1423.

R. Haygood, A. R. Ives, and D. A. Andow, 2004. Population genetics of transgene containmentEcology Letters 7:213–220.

R. Haygood, A. R. Ives, and D. A. Andow, 2003. Consequences of recurrent gene flow from crops to wild relativesProceedings of the Royal Society of London Series B, Biological Sciences 270:1879–1886.

R. Haygood, 2002. Coexistence in MacArthur-style consumer–resource modelsTheoretical Population Biology 61:215–223.

R. Haygood, 1994. Native code compilation in SICStus Prolog. P. Van Hentenryck (editor), Proceedings of the Eleventh International Conference on Logic Programming, MIT Press, pp. 190–204.

B. K. Holmer, B. Sano, M. Carlton, P. Van Roy, R. Haygood, W. R. Bush, A. M. Despain, J. M. Pendleton, and T. P. Dobry, 1990. Fast Prolog with an extended general purpose architecture. Proceedings of the 17th International Symposium on Computer Architecture, IEEE Computer Society Press, pp. 282–291.


Founder, Haygoodness L.L.C., 2012 –present.
Freelance development of web applications.

Founder, CardVine, 2009 –2011.
Development, promotion, and operation of a web application replacing business cards.

Postdoctoral fellow, Biology Department, Duke University, 2005–2009.
Research in evolution, ecology, genetics, and genomics.
National Science Foundation Postdoctoral Fellowship in Biological Informatics, 2005–2006.

Postdoctoral fellow, Department of Zoology, University of Wisconsin, 2002–2004.
Research in evolution, ecology, and genetics.

Graduate student, Section of Evolution and Ecology, University of California, Davis, 1997–2002.
Coursework, research, and teaching in evolution, ecology, and genetics.
Merton Love Award for best dissertation on ecology, ethology, or evolution at UC Davis in 2002.

Analyst, Hydrologic Consultants, Inc., 1996–2000.
Statistical and numerical analyses of surface-water and groundwater flows.
(This position was part-time, supplementing my graduate-student stipend.)

Graduate student, Department of Mathematics, University of California, Davis, 1994–1997.
Coursework and teaching in mathematics.
(I fulfilled all the requirements for a Ph.D. in mathematics except the dissertation before transferring into population biology.)

Guest researcher, Swedish Institute of Computer Science, 1992–1994.
Research and development in compilation techniques for logic programming languages.

Consultant, Department of Electrical Engineering, University of Southern California, 1991–1992.
Research and development in compilation techniques for logic programming languages.

Programmer/Analyst II, Division of Computer Science, University of California, Berkeley, 1988–1991.
Research and development in compilation techniques for logic programming languages.

Graduate student, Department of Physics, University of California, Santa Barbara, 1986 –1988.
Coursework and teaching in physics.


Ph.D., Population Biology, University of California, Davis, 2002.
Merton Love Award for best dissertation on ecology, ethology, or evolution at UC Davis in 2002.

M.A., Physics, University of California, Santa Barbara, 1988.

B.S., Physics and Mathematics, University of California, Irvine, 1986.

Q & A

There are several questions I get asked recurrently.

Q1: Why did you leave academia?

A1: I didn’t have to. My position at Duke was “soft money” but in no immediate danger. I’d applied for several faculty jobs, done one interview, and scheduled another. Deciding to leave wasn’t easy, but after considering it for quite awhile, I concluded that although I’d been a mostly happy and fairly productive student and postdoc, I’d almost surely be neither happy nor productive, in any sense that matters to me, as a faculty member.

The crux of the matter is that faculty members at major universities are now employed not so much to do research as to manage it and, above all, to get money for it. As Paul Graham observed, "Professors nowadays seem to have become professional fundraisers who do a little research on the side." Ultimately, there are several reasons why, including a decline in federal research funding precipitated by the end of the Cold War, so-called tax revolts that have left state universities cash-strapped, and other trends in American society and government. Proximately, the driving force is that in many fields, the available dollars have been dwindling for years, at least per researcher, if not for the field as a whole. As the pie has gotten ever smaller, professional survival has demanded ever more strenuous efforts to get a piece of it. I foresaw a future in which however much I struggled to concentrate on science, my thoughts would be dominated by money and its concomitants, politics and bureaucracy.

And I foresaw that the resulting science — steered by me but largely done by my students and postdocs — would probably be, like most academic science, of little consequence. Thomas Merton remarked, “There is always a temptation to diddle around in the contemplative life, making itsy-bitsy statues.” It isn’t only in the contemplative life. Most academic research is of marginal interest even when it’s first published, let alone 10 or 20 years later. Many academic publications aren’t cited even a dozen times. Genuinely innovative thinking is never easy, but certain characteristics of academia make it harder. Money, politics, and bureacracy are severely distracting. Moreover, as Stuart Rojstaczer observed, “With so little money available, funding agencies have become very cautious in the type of work they are supporting. They want ‘proven results’ [and] a ‘high probability of success’ for their money.” So they fund proposals that go just a little bit beyond what’s already been done.

I don’t consider myself to have abandoned science by leaving academia. Indeed, I’ve continued to collaborate and contribute. At present, I’m mainly occupied with software development, but I’m determined to return to science in due course. People who doubt the feasibility of high-quality basic research outside academia should recall that Charles Darwin was never a faculty member, Albert Einstein did much of his best work while employed by the Swiss patent office, etc. Of course, I’m not claiming to be the next Darwin or Einstein. I may never do any science of much interest outside academia. However, I think I stand a better chance outside than I would inside. That may well not be true of other people — some people are better at fighting off distractions, and some kinds of science need more institutional support — but I’m pretty sure it’s true of me.

Q2: Given your background, why haven’t you started a biotech company?

A2: I’ve thought about it but decided against it, at least for now. Biotech companies tend to need several years and several million dollars to develop a product. I’m not terrifically patient, and having to sell an idea to venture capitalists before even starting to realize it sounds an awful lot like the grant grind I left academia to get away from (see Q1).

Q3: Were you involved in that boating disaster in the Gulf of California?

A3: Yes. It was an ecological research expedition in March, 2000. I was in a small boat that capsized in a wind-driven swell. Of my eight companions, five died, including the leader of the expedition. I could easily have died too, but with help from another survivor, I got to shore.