FastTree 2: Timing runs

In order to to see how quickly FastTree runs for me I need some automated method of timing it. While some programs like phyML return a runtime at the end FastTree doesn’t seem to. So I searched the web and found bits of perl code to put a script timer together.

I have uploaded the relevant script ( to my repository website. It seems to work well for me but test it for yourself. Since it is based on POSIX I think it will only run on *nix systems (like Linux and MacOSX) although it can be made to work on Windows too perhaps (see here).

It has some placeholder code that prints out stuff and reports back how long it has taken. All the section between # Script goes here # and # Script ends here # can be deleted and replaced with the appropriate commands. So to run FastTree include a line like this-
system (FastTree -nt alignment_file > tree_file);

The system command however is also *nix specific I think. Sorry Microsoft guys I’ve never run perl on a Windows machine. There must be an equivalent way to launch external programs if you are working in e.g. ActivePerl.

I think the above command without ./ prefix depends on FastTree being installed in the correct location. This is usr/bin on my system.
Type the command: which perl
You should probably get: /usr/bin/perl
Move to the level above: cd /usr/bin
Copy the FastTree application to here: sudo cp path_to_application ./
Enter password when asked. If you don’t want to type out the path to the application you can (in OSX) just drag and drop the application into the terminal window after you have typed the sudo cp part, and it will paste in the location of the file you have dropped.

You should then be able to launch FastTree by giving the FastTree command wherever you are, without having to cd and move to the directory containing the application.

I have posted the FastTree application I described in the previous post at my file repository site, in case you don’t want to install developer tools and mess around with malloc errors.

3 Comments Add yours

  1. Frédéric Mahé says:

    Hello,Have you tried the Unix command time?


  2. Dave Lunt says:

    I wrote this script a few months ago. My first attempts use the time command and then I swapped to posixtime. Stupidly I didn’t write down why I swapped and can’t exactly remember now. Both should work fine though.


  3. Anonymous says:

    Hi,Thank you very much for your very helpful instructions for getting FastTree to run on Mac OS X. You are right that it is nice to have something like this documented online!Is there any chance you could compile Fast Tree 2.0? My Mac OS X disks with the developer tools are not on the same continent as I am, and I would love to be able to use this.thank you!KW


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s