Publications by Samuel Brown

Colour matching feature in R

08.12.2009

I love R. It is an open-source statistical programming language that I found reasonably easy to learn, and find it incredibly versatile and useful. Because it’s open-source anyone can contribute to it, and there are a huge number of packages that extend its capabilities to do pretty much anything.I’ve been using it to do Principal...

1230 sym R (197 sym/1 pcs) 2 img

Transitions and transversions in R

05.01.2010

A couple of months ago I wrote the following R function to calculate the number of transitions and transversions between DNA sequences in an alignment. The function is fairly slow (an alignment of ~100 sequences, 800 bp in length takes around 30 seconds to run) thanks to the double for loop, however in this case I shall plead Uwe’s ...

1454 sym 2 img

Earthquake maps

06.01.2010

There’s been a number of earthquakes in the Solomon Islands over the past few days, including one that caused a tsunami to partially destroy the village of Baniata on Rendova, Western Provence. You can see exactly how many earthquakes have occurred there by heading over to http://maps.google.com and pasting into the search box this url: http://...

1409 sym 2 img

Haplotype names in R

21.01.2010

Emmanuel Paradis, the mastermind behind ‘ape‘ has struck again. This time he brings us the ‘pegas‘ package, the Population and Evolutionary Genetic Analysis system. This package has a function that collapses the haplotypes (unique DNA sequences) in a DNA alignment, something which is extremely useful in various analyses and in...

1509 sym

Interrupting R processes in Ubuntu

16.03.2010

It’s funny how things happen. Yesterday I was working away on a project in R and the unenjoyable happens—the process hangs for longer than desired. I operate R in the standard GNOME terminal in Ubuntu and the only way I knew was to close the entire application getting rid of all objects at the same time. Not cool. Thirty minutes o...

1935 sym

Transitions in R redux

28.04.2010

Previously, I shared with the world a function to create a pairwise matrix of the number of transitions and transversions between two DNA sequences. Klaus Schliep kindly pointed out the possibility of a bug in the function and offered a faster, more accurate version. Thanks Klaus!titv mat res for(i in 1:(dim(mat)[1] – 1)){ for(j...

1033 sym

Downloading DNA sequences into R

15.08.2010

A while ago, a friend of mine needed to download a number of different DNA sequences from Genbank, the online repository for the vast majority of DNA sequences read from all organisms by labs all over the world. This is not a problem. The “ape” package in R has a nifty function, read.GenBank(), that downloads the sequences identif...

2421 sym

Phylogenetic trees online

20.08.2010

The other day, an article was published in PLoS One describing a newly developed JavaScript library to visualise phylogenetic trees online: jsPhyloSVG. It’s pretty nifty, and there’s some pretty cool functionality that you can build into the trees. It’s all based on the PhyloXML standard for describing phylogenetic trees and net...

1444 sym

apply functions in R

31.08.2010

Getting to know the “apply“s in R is extremely handy for using the language efficiently and effectively. Unfortunately, the help files tend to be rather information-dense and are fairly overwhelming for newcomers. A recent blog post by Neil Saunders provides a thorough overview and tutorial of the apply family, illustrated by simp...

836 sym

Canterbury Earthquake

06.09.2010

4:35 am on Saturday morning, I was woken up by a 7.1 magnitude earthquake, the epicentre being approximately 30 km west of where I live in Christchurch, New Zealand. The earthquake was one of the largest that New Zealand has experienced, and has been the most destructive one since the earthquake that struck Napier in 1931. Thankfully,...

3077 sym 6 img