<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Tim Poisot :: Updates</title>
 <link href="http://timotheepoisot.fr/atom.xml" rel="self"/>
 <link href="http://timotheepoisot.fr"/>
 <updated>2012-02-19T09:29:55-08:00</updated>
 <id>http://timotheepoisot.frL</id>
 <author>
   <name>Tim Poisot :: Updates</name>
 </author>

 
 <entry>
   <title>How to make the most out of peer-review?</title>
   <link href="http://timotheepoisot.fr/2012/01/29/sign-your-reviews/"/>
   <updated>2012-01-29T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2012/01/29/sign-your-reviews/</id>
   <content type="html">&lt;p&gt;So it seems that the love/hate relationship between science and publishers has &lt;a href='http://innge.net/?q=node/99'&gt;reached its tipping point following the RWA turmoil&lt;/a&gt;, with appeals to boycott major publishers, such as &lt;a href='http://www.researchwithoutwalls.org/'&gt;&lt;em&gt;researchwithoutwalls&lt;/em&gt;&lt;/a&gt; and &lt;a href='http://thecostofknowledge.com/'&gt;&lt;em&gt;thecostofknowledge&lt;/em&gt;&lt;/a&gt;, and &lt;a href='http://cscs.umich.edu/~crshalizi/weblog/864.html'&gt;some of the most eminents members of the scientific blogosphere talking about it&lt;/a&gt;, and using creative metaphors to illustrate &lt;a href='http://www.academicproductivity.com/2012/when-your-users-tell-you-you-are-not-adding-value-boycott-against-elsevier/'&gt;how big of a scam it is&lt;/a&gt;. Specifically, most scientists are publicly stating that &lt;a href='http://jabberwocky.weecology.org/2012/01/27/why-i-will-no-longer-review-for-your-journal/'&gt;they will not review papers anymore&lt;/a&gt;, at least in the case of for-profit editors. Most of the problem lies in the fact that reviewing papers does not grant you any money, yet publishers make &lt;a href='http://michaelnielsen.org/blog/on-elsevier/'&gt;insane profits&lt;/a&gt; based on this use of your government-funded time.&lt;/p&gt;

&lt;p&gt;Scientists feel they are being ripped off by the editors, who are making a lot of money for nothing, and are starting to be vocal about it. As a lot of really smart people have been going into the details of why boycott is a good solution (see the links in the first paragraph), so there is not much value to add to this debate by a young and enthusiastic post-doc (that would be me). I&amp;#8217;m still doing reviews, but I figured that there is no reason why it should not serve me as well as the authors. How do I do this? I sign them.&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t like the asymetry of the review process, in which your papers are under scrutiny (sometimes attack) of people you don&amp;#8217;t know. You can&amp;#8217;t tell if they have a reason to hate you. You can&amp;#8217;t tell if they are really competent in the domain of your paper, or if they have an undisclosed conflict of interest. And worse, when they finally helped you improve your paper to the point where it gets published, you still don&amp;#8217;t know who they are.&lt;/p&gt;

&lt;p&gt;So I now sign my reviews. I invest time in them, I try to be constructive, thorough, comprehensive, and because I take pride in my work, I think it deserves to be recognized. By signing your reviews, if you do them well, you&amp;#8217;ll get recognition from this work. You&amp;#8217;ll get some kudos from your peers, and this might prove usefull later on. This will not give you more money or more time for your research, or put the big publishers on the right path again, but at least you will build a small amount of reputation out of it, and &lt;a href='http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1002108'&gt;this is really important&lt;/a&gt;. By the way, out of the 10 rules for building a good reputation in the linked &lt;em&gt;PLoS Comp Biol&lt;/em&gt; paper, the number 8 is stating my point somewhat more eloquently:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Who is a good reviewer or editor is more than just perception. &lt;strong&gt;Be polite, timely, constructive, and considerate and, ideally, sign your review&lt;/strong&gt;. But also be honest—the most valued reviewers are those who are not afraid to provide honest feedback, even to the most established authors. Editors of journals rapidly develop a sense of who does a good job and who does not. Such perceptions will impact your reputation in subtle ways. The short term gain may be fewer papers or grants sent to you to review, but in the longer term, being a trusted reviewer will reflect your perceived knowledge of the field. &lt;strong&gt;Although the impact of a review is small relative to writing a good paper in the field yourself, it all adds up towards your overall reputation&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;</content>
 </entry>
 
 <entry>
   <title>New paper: measuring ecological specificity</title>
   <link href="http://timotheepoisot.fr/2012/01/19/measuring-ecological-specificity/"/>
   <updated>2012-01-19T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2012/01/19/measuring-ecological-specificity/</id>
   <content type="html">&lt;p&gt;Our paper about measurements of ecological specialization is now available online at the &lt;a href='http://onlinelibrary.wiley.com/doi/10.1111/j.2041-210X.2011.00174.x/abstract'&gt;Methods in Ecology &amp;amp; Evolution&lt;/a&gt; website. You can also download the associated R package from &lt;a href='https://r-forge.r-project.org/projects/esm/'&gt;R-Forge&lt;/a&gt;. As a side note, it is during the conception and redaction of this paper that I started thinking more and more about networks, something which is now occupying a significant part of my time, so I have my co-authors to thank for that.&lt;/p&gt;

&lt;p&gt;Early during my thesis, in between watching episodes of &lt;em&gt;The Big Bang Theory&lt;/em&gt;, I was wondering how we can best measure ecological specialization of parasites, knowing that we would work with very different data sources (field samples, lab systems, and models). After a quick survey of the literature, (i) it was clear that many people developed their own measure of specificity, and (ii) it was not clear what the assumptions of some of these measures were. This appeared to us as the potential for a methodological paper.&lt;/p&gt;

&lt;p&gt;So we went back to basics, and thought about what specificity is. In &lt;a href='http://www.ncbi.nlm.nih.gov/pubmed/21699641'&gt;a previous paper&lt;/a&gt;, we defined it as «displaying differential adaptation to a subset of suitable environments. Whereas specialisation refers to the process or tendency of change, specificity is the state of adaptation to environments at any given time or place». Ideally, a good measure of specificity would match this definition, as for example the &lt;a href='http://onlinelibrary.wiley.com/doi/10.1111/j.0030-1299.2008.16644.x/full'&gt;NODF&lt;/a&gt; measure does for nestedness. This is with this definition in mind that we conceived the &lt;em&gt;Paired Differences Index&lt;/em&gt;; the reasoning behind it is really simple, it measures how fast performance decreases when an organism is moved away from its optimal resource.&lt;/p&gt;

&lt;p&gt;What we&amp;#8217;ve done, is that we examined how different measures of specificity behave with regard to two important informations: (i) the thoroughness of sampling, and (ii) the distribution of links between species that exploit, and resources that are exploited (which is related to the structure of the interaction network). In a nutshell, we found that &lt;em&gt;d&amp;#8217;&lt;/em&gt; and &lt;em&gt;PDI&lt;/em&gt; were highly robust, but only the later is highly informative. So, problem solved? Not really. &lt;em&gt;PDI&lt;/em&gt; is super good at situating species along a continuum of specificity, with the interesting property of returning a value of 0.5 (neither specialist nor generalist) when the perfomances decrease linerarly. But as shown in the figure 1 (reproduced below), it tends to saturate with really high degree of specialization. Other measures, such as &lt;em&gt;CoV&lt;/em&gt;, are less affected by this.&lt;/p&gt;

&lt;p&gt;&lt;img src='http://timotheepoisot.fr/images/pdi_fig1.png' alt='Figure1' /&gt;&lt;/p&gt;

&lt;p&gt;We conclude by providing the following recommandations:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In conclusion, based on our evaluations, we encourage researchers to make use of RR to estimate the specificity of associations (i.e. Schoener’s generality) and PDI to estimate the specificity of impacts (i.e. the skewness of the link strength distribution), with the possibility to use other measures to detect fine-scale variation in specificity among highly specialized species. Previous literature has established that quantitative information on link strength is not necessary for some problems, and in these cases, PDI and RR are equivalent.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The measures described in this paper can be done using the &lt;code&gt;ESM&lt;/code&gt; package mentionned above. Given an object &lt;code&gt;web&lt;/code&gt; with focal species as rows, you can calculate the specificity using &lt;em&gt;PDI&lt;/em&gt; and &lt;em&gt;RR&lt;/em&gt; with the following commands:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='splus'&gt;library&lt;span class='p'&gt;(&lt;/span&gt;ESM&lt;span class='p'&gt;)&lt;/span&gt;

spe_pdi &lt;span class='o'&gt;=&lt;/span&gt; getspe&lt;span class='p'&gt;(&lt;/span&gt;web&lt;span class='p'&gt;,&lt;/span&gt;pdi&lt;span class='p'&gt;)&lt;/span&gt;
spe_rr &lt;span class='o'&gt;=&lt;/span&gt; getspe&lt;span class='p'&gt;(&lt;/span&gt;web&lt;span class='p'&gt;,&lt;/span&gt;rr&lt;span class='p'&gt;)&lt;/span&gt;

plot&lt;span class='p'&gt;(&lt;/span&gt;spe_pdi&lt;span class='p'&gt;,&lt;/span&gt;spe_rr&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The code is also being ported to Python and MatLab, but more on that later&amp;#8230;&lt;/p&gt;

&lt;p&gt;For the record, the code for this paper was developed entirely in R. The simulation of incomplete sampling took forever (a couple of days), because I was too lazy to write a parallel version of it (that, and it&amp;#8217;s basically a mess of nested for statements). The network generation routine is based on the same logic that something published by &lt;a href='http://schamberlain.github.com/2011/01/ecological-networks-from-abundance/'&gt;Scott Chamberlain&lt;/a&gt;, if you have any interest in doing such things.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Science in the age of social coding</title>
   <link href="http://timotheepoisot.fr/2012/01/06/science-age-social-coding/"/>
   <updated>2012-01-06T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2012/01/06/science-age-social-coding/</id>
   <content type="html">&lt;p&gt;I started using version control a little more than 6 months ago, when working on my dissertation. Not only it allowed me to have a backup of my chapters somewhere else than on my hard drive, but I could also revert back to a previous version of some paragraphs I liked better. Sometime during the summer, I discovered GitHub, and thought that I can give it a try. A few months later, I&amp;#8217;m wondering what I would do without it.&lt;/p&gt;

&lt;p&gt;The idea of GitHub is simple: &lt;a href='http://radar.oreilly.com/2009/01/github-making-code-more-social.html'&gt;&lt;em&gt;social coding&lt;/em&gt;&lt;/a&gt;. As in, everyone can work on your code, and contribute some new things to it. This blog is powered by Jekyll, many features of which originate from the community. In a way, social coding is open source logic pushed to its maximum: everyone can copy (fork) your code, work on it, and give you back the features they added, or the bugs they fixed, or whatever you can think of. Scientists would gain a lot by getting to know these tools.&lt;/p&gt;

&lt;h1 id='it_will_make_us_better_coders'&gt;It will make us better coders&lt;/h1&gt;

&lt;p&gt;During the last few weeks, I&amp;#8217;ve been taking a very informal programming course. And I&amp;#8217;ve realized something: most of the code I write is horrible. It does the job, but it&amp;#8217;s not written the way it should be. I don&amp;#8217;t think it is a problem, given any code doing what I want it to do is good enough for me. But sometime, knowing how things actually work can make your program run faster, or do more advanced things. So there is a positive correlation between the time you will spend hacking around, and what you will be able to achieve. The only question is to maximize your benefit for every hour spent working on your programming skills. I found that social coding and version control helped me a great deal in this matter.&lt;/p&gt;

&lt;p&gt;The first reason why is simple; it made me bolder. I used to write the basic layout of a program, then fix it by changing one line at a time. Now, I have the assurance that any revision of my code is available. Essentially, version control eliminated the question of &amp;#8220;If I break it, will I be able to fix it back?&amp;#8221;. I can delete lines by the hundred, and rewrite them from the ground up, sometimes with a completely different logic. And I have the assurance that I can revert back to the previous version in case things go wrong. And much to my surprise, I&amp;#8217;ve only rarely reverted back to previous versions. By taking advantage of the safety net that previous commits represent, it is possible to try new things, make drastic changes, with absolutely zero negative consequences (well, except for the time you will invest doing these changes).&lt;/p&gt;

&lt;p&gt;In addition, GitHub has this bizarre effect of exposing any user to &lt;em&gt;a lot&lt;/em&gt; of code, if you are curious and check out what other people are doing. There are a host of cool projects to explore, and when I see one with a specific feature, I can just check the source, and see how it&amp;#8217;s done. I prefer learning things by myself (I&amp;#8217;m yet to buy a book about Python or R, despite the fact that I use both of them on a daily basis), but now I have the opportunity to see directly what more experienced coders are doing in the real world. This is not something to neglect, and I&amp;#8217;m not only thinking about ecology-related projects. Just looking at the way people deal with different kind of data can give you ideas. GitHub is a great generator of serendipity, and serendipity is awesome because it brings you solutions to problems you didn&amp;#8217;t even knew you had!&lt;/p&gt;

&lt;h1 id='it_will_give_us_access_to_more_techniques'&gt;It will give us access to more techniques&lt;/h1&gt;

&lt;p&gt;One of the coolest things that can happen is that more and more scientists will use GitHub (or GoogleCode, or Bitbucket, which I use for stuff that I don&amp;#8217;t want you to see just yet) to post their code. I&amp;#8217;m not saying it &lt;em&gt;will&lt;/em&gt; happen, though &lt;a href='http://innge.net/?q=node/19'&gt;the young crowd is certainly doing it&lt;/a&gt; – but I definitely think it &lt;em&gt;should&lt;/em&gt; happen, and I play my part as an evangelist as often as I can. We are now sharing an increasing amount (and variety) of data (species distributions, functional traits, sequences, trophic interactions, and what not), but strangely, there is no global code repository that I know of. Let me put it another way: finding the raw material is becoming less and less of an issue, yet very few people seem to be actively thinking about how to share the &lt;em&gt;tools to analyze these data&lt;/em&gt;. This is too bad, for a whole lot of reasons.&lt;/p&gt;

&lt;p&gt;First, it&amp;#8217;s time consuming to re-write an algorithm from the ground up, simply because the original code was not shared. Describing a kick-ass analysis is not really useful if nobody can do it. It&amp;#8217;s not useful for your community, which will be unable to do what you propose. Even though some people will &lt;em&gt;want&lt;/em&gt; to do the analysis, they might be unable to do it because they don&amp;#8217;t know any programming or scripting language, or have no resident geek in their lab who can write it up for them. And more importantly, an analysis that no one can replicate is not useful for you, because no one will cite your paper.&lt;/p&gt;

&lt;p&gt;Second, we are subjected to the limitations of existing software. I&amp;#8217;ve been discussing this matter with non computer-minded people working on pyrosequencing. The discussion went something like &amp;#8220;Hey, it would be super cool if you were able to do [so and so] !&amp;#8221;. To which they replied &amp;#8220;Yeah, but we can&amp;#8217;t, because it&amp;#8217;s not in [whatever program we are using]&amp;#8221;. Should the code be public, it would be a simple matter of forking it, and adding this new functionality. Given the way GitHub works, this modification could even one day make it into the main release, which will bring you some kudos among your peers for making everyone&amp;#8217;s life a little easier.&lt;/p&gt;

&lt;p&gt;And finally, there is one additional impact of an increased availability of the code: people will develop more integrated tools. Part of my motivation for writing &lt;a href='http://tpoisot.github.co/bipy/'&gt;bipy&lt;/a&gt; was to have an integrated way to work with bipartite ecological networks, to do a bunch of different analysis in a common environment. The folks at &lt;a href='http://ropensci.org/'&gt;ROpenSci&lt;/a&gt; are doing an impressive job of stitching together a lot of different databases, and their project is a prime example of what we can do with open source. Similarly, &lt;a href='http://weecology.org/resources'&gt;Weecology&lt;/a&gt; is publishing both code and data. By merging these tools together, it&amp;#8217;s increasingly likely that people will stumble across new analyses, think &amp;#8220;Hey, that&amp;#8217;s cool, I&amp;#8217;d like to do it&amp;#8221;, and increase the diversity of methods in different fields.&lt;/p&gt;

&lt;h1 id='where_to_start_'&gt;Where to start ?&lt;/h1&gt;

&lt;p&gt;As Nick Barne put it, &lt;a href='http://www.nature.com/news/2010/101013/full/467753a.html'&gt;&lt;em&gt;publish your code, it&amp;#8217;s good enough&lt;/em&gt;&lt;/a&gt;. Open an account somewhere, and try pushing a random file around. GitHub makes everything public by default, unless you pay, but &lt;a href='https://bitbucket.org/'&gt;BitBucket&lt;/a&gt; will allow you up to 5 privates repositories (I you want version control for something you are currently working on, and although you may not now it yet, you do want it — a lot). Then spread the world. Give the URL to your repository in the methods or acknowledgements of your papers, put the URL in slides at conferences, and so on.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Simulated phylogenetic trees and community assembly</title>
   <link href="http://timotheepoisot.fr/2012/01/05/a-python-class-for-phylogenies/"/>
   <updated>2012-01-05T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2012/01/05/a-python-class-for-phylogenies/</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m working on a toy model of community assembly in Python, and I thought it would be cool to have an easy way to keep track of the phylogeny. To do so, I&amp;#8217;ve conceived two classes for the easy handling of phylogenetic structure. They are available on GitHub in the &lt;a href='https://github.com/tpoisot/PyCoPhy'&gt;&lt;code&gt;PyCoPhy&lt;/code&gt; repository&lt;/a&gt; (Python Community Phylogenetics), and check also the &lt;a href='http://timotheepoisot.fr/code/'&gt;code page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The general idea behind them is quite easy to understand. A phylogenetic tree is a list of branchings. A branching is the junction of two objects, which I called &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt;. Each of these objects can be an identifier (i.e. a leaf of the tree), or a reference to another branching (i.e. a node). It&amp;#8217;s as complicated as it gets.&lt;/p&gt;

&lt;p&gt;Once &lt;code&gt;PyCoPhy&lt;/code&gt; is loaded, to create a new tree with a species called &lt;code&gt;ancestor&lt;/code&gt;, just type:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;iTree&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PhyloTree&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;ancestor&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='n'&gt;iTree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The output of this command should be &lt;code&gt;(root, ancestor)&lt;/code&gt;. The &lt;code&gt;root&lt;/code&gt; is created by default to ensure that the most basal node is a branching. The interesting thing is that it&amp;#8217;s now relatively easy to add and remove species. The &lt;code&gt;PhyloTree&lt;/code&gt; class has the &lt;code&gt;speciate&lt;/code&gt; method, who takes two arguments: the name of the ancestor, and the name of the daughter species. Calling it will go through the tree, and replace the ancestor by the (ancestor, daughter species) branching. Let&amp;#8217;s try with:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;iTree&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PhyloTree&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;iTree&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;speciate&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0_0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='n'&gt;iTree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;which results in the following tree: &lt;code&gt;(root,(0,0_0))&lt;/code&gt;. And I know this is not the way speciation works, so there is also a &lt;code&gt;split&lt;/code&gt; method, which will replace one ancestral species by two new species:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;iTree&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PhyloTree&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;iTree&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;split&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;2&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='n'&gt;iTree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;will result in &lt;code&gt;(root,(2,1))&lt;/code&gt;. This is all made possible by the &lt;code&gt;extinct&lt;/code&gt; method, by the way, which will remove from the tree the species whose name is given in argument:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;iTree&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PhyloTree&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;iTree&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;split&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;2&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;iTree&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;extinct&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;2&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='k'&gt;print&lt;/span&gt; &lt;span class='n'&gt;iTree&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;will result in &lt;code&gt;(root,1)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Although these classes are really basic at the moment, they allow me to easily keep track of who is related to who in my simulations. I&amp;#8217;ll most likely add a way to keep track of branch lenghts at some point in the near future.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Goodbye Wordpress, hello Jekyll!</title>
   <link href="http://timotheepoisot.fr/2012/01/01/migration-to-jekyll/"/>
   <updated>2012-01-01T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2012/01/01/migration-to-jekyll/</id>
   <content type="html">&lt;p&gt;A few weeks ago, I discovered &lt;a href='https://github.com/mojombo/jekyll'&gt;Jekyll&lt;/a&gt;. In a nutshell, Jekyll is a static site generator who promised me I&amp;#8217;ll be able to &lt;a href='http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html'&gt;blog like a hacker&lt;/a&gt;. This site is now hosted on GitHub, and &lt;a href='https://github.com/tpoisot/tpoisot.github.com'&gt;both the template and the content can be forked&lt;/a&gt;, so everything is basically open source.&lt;/p&gt;

&lt;p&gt;Jekyll is a lot of fun to use, especially because all of the content reside in &lt;em&gt;static text files&lt;/em&gt; instead of a database. It&amp;#8217;s also fully compatible with the &lt;a href='http://daringfireball.net/projects/markdown/'&gt;markdown&lt;/a&gt; format, which is a lot easier to write than html. For example, writing a simple text in bold in markdown is done through&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='bash'&gt;**text in bold**
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;rather than the equivalent html&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='nt'&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;text in bold&lt;span class='nt'&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So a less lot keys to press (especially on my new QWERTY keyboard). The fact that Jekyll uses the &lt;a href='https://github.com/Shopify/liquid/wiki'&gt;Liquid&lt;/a&gt; templating language also make the overall design process &lt;em&gt;fun&lt;/em&gt;. In addition, the whole system is working on GitHub, so I have complete version control on everything. This is so awesome!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>The aggregate function in Python</title>
   <link href="http://timotheepoisot.fr/2011/12/01/the-aggregate-function-in-python/"/>
   <updated>2011-12-01T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2011/12/01/the-aggregate-function-in-python/</id>
   <content type="html">&lt;p&gt;One thing I love the most about R is the &lt;a href='http://stat.ethz.ch/R-manual/R-devel/library/stats/html/aggregate.html'&gt;aggregate&lt;/a&gt; function, which (in a nutshell) summarizes a data frame according to one or more columns, and perform some operations on the aggregated values. If, for example, you have a data frame with a treatment and a response, and want to calculate the mean and standard deviation of the response by level of treatment, then aggregate is usually the way to go.&lt;/p&gt;

&lt;p&gt;I wanted to do a quick &lt;a href='http://pyx.sourceforge.net/examples/graphstyles/errorbar.html'&gt;plot with errorbars using PyX&lt;/a&gt;, and I though that having a python version of aggregate would be really nice. Here is the complete code to do so&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;numpy&lt;/span&gt; &lt;span class='kn'&gt;as&lt;/span&gt; &lt;span class='nn'&gt;np&lt;/span&gt;
&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;scipy&lt;/span&gt; &lt;span class='kn'&gt;as&lt;/span&gt; &lt;span class='nn'&gt;sp&lt;/span&gt;  

&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;MSD&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;vec&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
	&lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;mean&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;vec&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;&lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;std&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;vec&lt;/span&gt;&lt;span class='p'&gt;)]&lt;/span&gt;  
&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;aggregate&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;df&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;by&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;to&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;func&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;sum&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
	&lt;span class='n'&gt;Dat&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[]&lt;/span&gt;
    &lt;span class='n'&gt;ColBy&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;df&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;T&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;by&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
    &lt;span class='n'&gt;ColTo&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;df&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;T&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;to&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
    &lt;span class='n'&gt;UniqueBy&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;sort&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;unique&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;ColBy&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
    &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;ub&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='n'&gt;UniqueBy&lt;/span&gt;&lt;span class='p'&gt;:&lt;/span&gt;
    	&lt;span class='n'&gt;uTo&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;ColTo&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;ColBy&lt;/span&gt;&lt;span class='o'&gt;==&lt;/span&gt;&lt;span class='n'&gt;ub&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
    	&lt;span class='n'&gt;Out&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;func&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;uTo&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    	&lt;span class='n'&gt;Dat&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;append&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;concatenate&lt;/span&gt;&lt;span class='p'&gt;(([&lt;/span&gt;&lt;span class='n'&gt;ub&lt;/span&gt;&lt;span class='p'&gt;],&lt;/span&gt;&lt;span class='n'&gt;Out&lt;/span&gt;&lt;span class='p'&gt;)))&lt;/span&gt;
    &lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='n'&gt;Dat&lt;/span&gt;  
    
&lt;span class='n'&gt;test_df&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;np&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;loadtxt&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;#39;tes1-output.dat&amp;#39;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;  
&lt;span class='n'&gt;Agr&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;aggregate&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;test_df&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;15&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;18&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;MSD&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;sp&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;savetxt&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;aggr.dat&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;Agr&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;  
&lt;span class='kn'&gt;from&lt;/span&gt; &lt;span class='nn'&gt;pyx&lt;/span&gt; &lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt;  
&lt;span class='n'&gt;g&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;graph&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;graphxy&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;width&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;8&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;g&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;plot&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;graph&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;data&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;file&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;aggr.dat&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;x&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;y&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;2&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;dy&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;3&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;
	&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;graph&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;style&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;symbol&lt;/span&gt;&lt;span class='p'&gt;(),&lt;/span&gt; &lt;span class='n'&gt;graph&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;style&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;errorbar&lt;/span&gt;&lt;span class='p'&gt;()])&lt;/span&gt;
&lt;span class='n'&gt;g&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;writePDFfile&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;errorbar&amp;quot;&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As you can see, it is really straightforward. The aggregate function needs four arguments: the data frame (in this case, a numpy array with two dimensions), the column for the group to aggregate, and the column for the response. The last argument is obviously the function which will be applied, in this case a simple mean ± standard deviation. In 30 lines of code, you can easily aggregate your data using python. Of course there is room for improvement, but this is already working quite well.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Get your lab on twitter!</title>
   <link href="http://timotheepoisot.fr/2011/11/19/get-your-lab-on-twitter/"/>
   <updated>2011-11-19T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2011/11/19/get-your-lab-on-twitter/</id>
   <content type="html">&lt;p&gt;More and more scientists are taking advantage of social networking tools to talk about their research. This trend was even deemed worthy of &lt;a href='http://www.nature.com/naturejobs/science/articles/10.1038/nj7371-141a'&gt;a paper in &lt;em&gt;Nature&lt;/em&gt; this week&lt;/a&gt;. I&amp;#8217;ve read this paper, and I had mixed feelings about it. On one hand, it was good to see the use of social medias showcased in such a prestigious journal. On the other hand, I felt it came out of nowhere, and was too descriptive. I was left wondering, if I were not already using twitter and other similar things (partly) for scientific purposes, would this article have changed my habits? Maybe not.&lt;/p&gt;

&lt;p&gt;However, there are a number of different reasons for which getting involved in social networks is a wise decision for a researcher or a lab, and I will highlight those who seem the most relevant. Obviously, social media presence goes beyond having a twitter account. This is why, at &lt;a href='http://twitter.com/#!/INNGEcologist'&gt;INNGE&lt;/a&gt; and the &lt;a href='http://www.sfecologie.org/'&gt;French Ecological Society&lt;/a&gt;, we have a facebook page. This is why my former group has a blog to talk about the new papers, and this is also why I have a blog. Taken all together, these tools offer an incredible potential for scientists to engage in the discussion, and we should all work actively to use them.&lt;/p&gt;

&lt;h1 id='cut_the_middle_man'&gt;Cut the middle man&lt;/h1&gt;

&lt;p&gt;It&amp;#8217;s often tempting to complain about the fact that Science (not the journal, the discipline) is hard to spread from within the community to a broader audience. Short of some really stunning results, which may or may not be stunning science but are appealing in terms of communication, the general public is left relatively uninformed about what happens in the labs. The reason is simple: channel through which we can communicate scientific informations are relatively few, and it can be tedious to write a press release. Or to talk with journalists, which &lt;a href='http://cscs.umich.edu/~crshalizi/weblog/838.html'&gt;may be tempted to slightly arrange your sayings&lt;/a&gt;, due to a mis-understanding of the subject, or the necessity to fit some editorial format.&lt;/p&gt;

&lt;p&gt;Using social media will effectively result in the elimination of the middle man. Scientists can be in charge of their communication, and reach out to the greatest audience available. The part about being in charge is especially important: in a few clicks, you can have a &lt;a href='http://wordpress.com/'&gt;wordpress&lt;/a&gt; or a facebook page up and running, and &lt;em&gt;you&lt;/em&gt;, the researcher, will be able to talk directly about your work. This will require a short time of adaptation, as the general tone of a blog post is not one of a paper (unless I&amp;#8217;m wrong either in the way I write papers or blog posts!), and the degree of precision differs. But once this is done, you may even find the exercise enjoyable!&lt;/p&gt;

&lt;h1 id='help_your_ideas_invade'&gt;Help your ideas invade&lt;/h1&gt;

&lt;p&gt;Probably the best advice I received about what science is about comes from one of my collaborators, who interrupted our burger-seeking walk to tell me that ideas are like populations, and if I want to be a good researcher, I have to make my ideas invade the resident community. Shortly thereafter, we found a burger place, which only makes the memory more enjoyable. Invasion is about two things. Either you have a high fitness, or you &lt;a href='http://en.wikipedia.org/wiki/Allee_effect'&gt;benefit of an Allee effect&lt;/a&gt;. Being present on social networks will help you achieve the later.&lt;/p&gt;

&lt;p&gt;For this reason, we owe journals like &lt;em&gt;&lt;a href='http://api.twitter.com/#!/ecologyletters'&gt;Ecology Letters&lt;/a&gt;&lt;/em&gt; or &lt;em&gt;&lt;a href='http://twitter.com/#!/methodsecolevol'&gt;Methods in Ecology &amp;amp; Evolution&lt;/a&gt;&lt;/em&gt; a big thank you, because they mention every new paper on twitter (well, that, and they&amp;#8217;ve also accepted papers of mine, so you know&amp;#8230;). Some papers get retweeted, and benefit from a terrific, instantaneous exposure. I&amp;#8217;ve seen a few instances of one of the authors getting involved in the discussion, and it was all very stimulating.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not aware of any studies establishing a correlation (or the lack thereof) between the number of times a paper is mentioned on social networks and its number of citations (my guess is that it will help citations happen sooner, not necessarily increase them – although good papers may be retweeted more frequently, so there are confounding effects here). But it definitely will not harm you to see a lot of people talking about your work.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update on Jan. 21, 2012&lt;/strong&gt; — I became aware of this &lt;a href='http://blogs.bmj.com/bmj-journals-development-blog/2012/01/06/twimpact-factors-can-tweets-really-predict-citations/'&gt;blog piece at BMJ Web Development&lt;/a&gt;, with a link to a paper showing that the number of tweet is a fairly good predictor of the number of citations. &lt;a href='http://twitter.com/signup'&gt;Here you, go, now&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id='the_permanent_conference'&gt;The permanent conference&lt;/h1&gt;

&lt;p&gt;A while ago during a discussion about social media, someone mentioned to me that the kind of interactions established on twitter resemble the ones established during a conference, albeit soberer. I have to agree with this. Just look at the incoming tweets, or facebook updates, and you&amp;#8217;ll see what everybody is up to. What they write about on their blogs. What kind of webpages they are reading.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s not necessarily about science, and you&amp;#8217;ll probably find yourself bonding with people, which may at some point become collaborators. This is one of the strongest points to me, the ability to be permanently in touch with your community. Even though it&amp;#8217;s not always productive, it&amp;#8217;s always good fun. But it can become very interesting. You can ask for advice. You can get feedback, ideas, suggestions. And a lot of things which would have gone completely under your radar suddenly become accessible to you. Just for this, it is definitely worth the few minutes a day that you&amp;#8217;ll soon find yourself putting into the exercise.&lt;/p&gt;

&lt;h1 id='all_the_cool_kids_do_it'&gt;All the cool kids do it!&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;ve tried to make the point that being active on social networks can help you take control of what is said about your science, will let other spread your ideas, and will make you feel as if you were in contact with everyone at once. But more importantly, it&amp;#8217;s cool. Wicked cool. Hype.&lt;/p&gt;

&lt;p&gt;Basically, it will give you two things. Visibility, and the image of an engaging researcher / group of people. Students will actually look for these traits, so being easy to reach may attract people to your lab. It&amp;#8217;s also why you should not use Word to do your lab webpage (unless you are so good and attractive and awesome that it stops mattering), by the way.&lt;/p&gt;

&lt;p&gt;And the best part is, it&amp;#8217;s free (as in beer)! And should you want to get started, I&amp;#8217;m sure you&amp;#8217;ll find plenty of people willing to help you, and set things up for you, and introduce you to these tools. I&amp;#8217;m confident that they will become an increasingly important part of the daily routine of scientists in the near future (which is why we use them so much at INNGE), so don&amp;#8217;t miss up this opportunity.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A model of population dynamics in Python</title>
   <link href="http://timotheepoisot.fr/2011/11/14/a-model-of-population-dynamics-in-python/"/>
   <updated>2011-11-14T00:00:00-08:00</updated>
   <id>http://timotheepoisot.fr/2011/11/14/a-model-of-population-dynamics-in-python/</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been using &lt;a href='http://python.org/'&gt;Python&lt;/a&gt; more and more to do various things. When compared to &lt;a href='http://cran.cict.fr/'&gt;R&lt;/a&gt; (which I use a lot), Python is not more difficult to write, and a whole lot faster. I&amp;#8217;ve started exploring tools to use Python for ecological simulations, and specifically the &lt;a href='http://www.scipy.org/'&gt;scipy&lt;/a&gt; library. In R, my usual tool is the &lt;a href='http://simecol.r-forge.r-project.org/'&gt;simecol&lt;/a&gt; package, which implements a lot of numerical integrators, and most notably &lt;a href='http://www.oecd-nea.org/tools/abstract/detail/uscd1227'&gt;&lt;code&gt;LSODA&lt;/code&gt;&lt;/a&gt; (which is awesome for many many reasons, including but not limited to its ability to switch between stiff and non-stiff problem at each step).&lt;/p&gt;

&lt;p&gt;In simecol, modeling a population dynamics requires to write a function taking as an input a vector of population sizes, some parameters, and the time. The purpose of the package is to provide a wrapper around such functions. After using this package more or less non stop for 3 years, I&amp;#8217;ve become accustomed to this way of writing things, and I was afraid that I may have to change my habits. I was really happy to discover that &lt;a href='http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.odeint.html'&gt;scipy.integrate.odeint&lt;/a&gt; in scipy, was both an implementation of the LSODA, and worked in the exact same way that simecol did.&lt;/p&gt;

&lt;p&gt;To write a simulation of population dynamics (I&amp;#8217;ll use logistic growth as an example), we first import the relevant parts of the scipy library.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;scipy&lt;/span&gt; &lt;span class='kn'&gt;as&lt;/span&gt; &lt;span class='nn'&gt;sp&lt;/span&gt;
&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;scipy.integrate&lt;/span&gt; &lt;span class='kn'&gt;as&lt;/span&gt; &lt;span class='nn'&gt;sp_int&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Next, we write the function modeling the population growth, as a function of two parameters, &lt;em&gt;r&lt;/em&gt; and &lt;em&gt;K&lt;/em&gt;.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='k'&gt;def&lt;/span&gt; &lt;span class='nf'&gt;logistic&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;y&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;t0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;r&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;K&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
	&lt;span class='n'&gt;dY&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;y&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;r&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='n'&gt;y&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;/&lt;/span&gt; &lt;span class='nb'&gt;float&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;K&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt;
    &lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;dY&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The syntax is relatively easy. Note that &lt;code&gt;t0&lt;/code&gt; is not used by the function at any time, but is required by &lt;code&gt;odeint&lt;/code&gt; to do its internal calculations. Note also that y is an array. These two parameters are required, and the other are optional. Next, we fix the values of &lt;em&gt;r&lt;/em&gt; and &lt;em&gt;K&lt;/em&gt;. The required format is a tuple, so you need to be very careful when passing the parameters: they must be in the same order than in the function declaration. Additionally, we&amp;#8217;ll declare a starting population size.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;params&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;0.3&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;10&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='n'&gt;y&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mf'&gt;0.01&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now we will do the actual numerical integration. This is fairly simple.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='n'&gt;log_growth&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;sp_int&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;odeint&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;
	&lt;span class='n'&gt;func&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;logistic&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='n'&gt;y0&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;y&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;
	&lt;span class='n'&gt;t&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='nb'&gt;range&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;600&lt;/span&gt;&lt;span class='p'&gt;),&lt;/span&gt;&lt;span class='n'&gt;args&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;params&lt;/span&gt;
	&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Note that we define an array called &lt;code&gt;t&lt;/code&gt;, in which the times at which integration needs to be performed are stored. The object &lt;code&gt;log_growth&lt;/code&gt; will have all the information required to analyze the simulation results, with the time in the first column, and the population sizes after. This kind of object is fairly easy to plot using, e.g. &lt;a href='http://pyx.sourceforge.net/'&gt;PyX&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although this was a simple example, it illustrates how easy it can be to program a simple simulation using python. I must admit that I was nicely surprised to see the rapidity of the process, and the gain in execution time when compared to R is definitely not something to neglect.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>New paper: morphology and phylogeny in Lamellodiscus</title>
   <link href="http://timotheepoisot.fr/2011/10/12/morpho-phylo-lamellodiscus/"/>
   <updated>2011-10-12T00:00:00-07:00</updated>
   <id>http://timotheepoisot.fr/2011/10/12/morpho-phylo-lamellodiscus/</id>
   <content type="html">&lt;p&gt;The final paper of my master&amp;#8217;s project was &lt;a href='http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0026252
'&gt;published online today in &lt;em&gt;PLoS One&lt;/em&gt;&lt;/a&gt;. It&amp;#8217;s about how species of a fish parasite, which were defined based on morphological features, may not be actual species, as they have no phylogenetic support.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Lamellodiscus&lt;/em&gt; Johnston &amp;amp; Tiegs 1922 (Monogenea, Diplectanidae) is a genus of common parasites on the gills of sparid fishes. Here we show that this genus is probably undergoing a fast molecular diversification, as reflected by the important genetic variability observed within three molecular markers (partial nuclear 18S rDNA, Internal Transcribed Spacer 1, and mitonchondrial &lt;em&gt;Cytochrome Oxidase I&lt;/em&gt;). Using an updated phylogeny of this genus, we show that molecular and morphological evolution are weakly correlated, and that most of the morphologically defined taxonomical units are not consistent with the molecular data. We suggest that &lt;em&gt;Lamellodiscus&lt;/em&gt; morphology is probably constrained by strong environmental (host-induced) pressure, and discuss why this result can apply to other taxa. Genetic variability within nuclear 18S and mitochondrial &lt;em&gt;COI&lt;/em&gt; genes are compared for several monogenean genera, as this measure may reflect the level of diversification within a genus. Overall our results suggest that cryptic speciation events may occur within &lt;em&gt;Lamellodiscus&lt;/em&gt;, and discuss the links between morphological and molecular evolution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Poisot T, Verneau O, Desdevises Y (2011) Morphological and Molecular Evolution Are Not Linked in &lt;em&gt;Lamellodiscus&lt;/em&gt; (Plathyhelminthes, Monogenea). PLoS ONE 6(10): e26252. doi:10.1371/journal.pone.0026252&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>INNGE network : this is on!</title>
   <link href="http://timotheepoisot.fr/2011/07/18/innge-network-this-is-on/"/>
   <updated>2011-07-18T00:00:00-07:00</updated>
   <id>http://timotheepoisot.fr/2011/07/18/innge-network-this-is-on/</id>
   <content type="html">&lt;p&gt;The INNGE network is now officially started, with a short Forum article in the &lt;a href='http://www.intecol.net/'&gt;INTECOL Bulletin&lt;/a&gt; (PDF attached at the end of this post). I&amp;#8217;m obviously very glad to be part of this effort, which seeks to bring early career ecologists together from around the world, thereby strengthening international ties within a growing global community of ecologists.&lt;/p&gt;

&lt;p&gt;The &lt;a href='http://www.sfecologie.org/'&gt;&lt;em&gt;Société Française d&amp;#8217;Ecologie&lt;/em&gt;&lt;/a&gt; is supporting this initiative as well. If you want to know more about this network, or want to get involved, most of us will be attending the &lt;a href='http://www.esa.org/austin/'&gt;ESA meeting in Austin&lt;/a&gt;, this august, do not hesitate to get in touch using our emails, &lt;a href='http://www.facebook.com/groups/254873494526193'&gt;Facebook&lt;/a&gt;, or &lt;a href='https://twitter.com/#!/inngecologist'&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Jørgensen, P. S., et al. (2011). A global network of next generation ecologists. &lt;em&gt;INTECOL Bulletin&lt;/em&gt;, 5 (2), 4-6. &lt;a href='http://www.timotheepoisot.fr/wp-content/uploads/2011/07/J%C3%B8rgensen-et-al.-2011-A-global-network-of-next-generation-ecologists.pdf'&gt;PDF&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Models in Evolutionary Ecology, 2nd edition</title>
   <link href="http://timotheepoisot.fr/2011/07/17/models-in-evolutionary-ecology-2nd-edition/"/>
   <updated>2011-07-17T00:00:00-07:00</updated>
   <id>http://timotheepoisot.fr/2011/07/17/models-in-evolutionary-ecology-2nd-edition/</id>
   <content type="html">&lt;p&gt;The videos of the talks given during the second edition of the &lt;a href='http://www.seminar-mee.org/home/programme'&gt;Models in Evolutionary Ecology&lt;/a&gt; seminar, which I co-organized, are currently being put on-line. &lt;a href='http://www.dailymotion.com/playlist/x1mv7l_mez_en_video_cefe-
colloque'&gt;You can see them on Dailymotion&lt;/a&gt; (my own talk is not online yet). This seminar was organized by french PhD Students, in order to foster interactions between people working on experimental and theoretical aspects of the multiple fields that make evolutionary ecology.&lt;/p&gt;

&lt;p&gt;This year was our second attempt at organizing a seminar. For the first time, we opened registration to doctoral students and post-docs outside from france, and we are happy to have hosted talk by foreign researchers.&lt;/p&gt;

&lt;p&gt;Feel free to see and share the videos!&lt;/p&gt;</content>
 </entry>
 
 
</feed>
