popgen is an R package that implements some statistical
and population genetics methods.
A poster presented at SMBE 2003 conference which describes the package
can be downloaded here.
The package is available from CRAN
AnalyzeFMRI is an R package that
provides I/O, visualisation and
analysis of functional Magnetic Resonance Imaging (fMRI) datasets
stored in the ANALYZE image format. The package supercedes the packages
AnalyzeIO and AnalyzeRead (described below).
- Datasets can be read into R in several different ways i.e. one
slice, one time series, whole dataset etc and displayed quickly and
simply using a tcl/tk GUI (Graphical User Interface).
- Arrays from within an R session can also be written out into the
ANALYZE image format.
- A simple spectral summary of the dataset can be quickly
- Spatial ICA (Independent Component Analysis) can be applied to
the dataset. This provides a decomposition of an fMRI dataset into
spatially independent components, if they exist. If not the algorithm
returns the Projection Pursuit directions i.e interesting projections
of the multivariate dataset. In this way the Spatial ICA algorithm
provides an extremely useful way of exploring large fMRI datasets.This
is applied to the dataset using C code written for the fastICA package
(see above). There is a tcl/tk GUI that allows Spatial ICA to be
applied quickly and simply. The output can be saved to a series of jpeg
files for compact storage of the decomposition.
- Functions for linear and non-linear smoothing of an array.
- Functions to fit a mixture model (1 Normal and 2 Gamma
components) to an fMRI t-statistic image. Includes, an implementation
of the spatial mixture modelling approach of Hartvig and Jensen (2000)
- Functions that simulate Gaussian and Gamma random fields and
estimate the smoothness of a given field.
- Functions for calculating Bonferroni, False Discovery Rate and
Random Field Theory thresholds for fMRI statistic maps.
More functionality will be slowly added.
An S-PLUS version will appear when i get some more time (although
more likely to do it soon if someone wants to use it!)
Please let me know if you use this package and have suggestions for
functionality that you would find useful.
The package is available from CRAN
You can download an example datasaet from
The gzipped tar archive contains 4 files described below
 jm2.null.mc.img - null fMRI dataset with
 jm2.null.mc.hdr - header file for 
 jm2.null.mc.mask.img - mask for  which is 1
for voxels inside the brain and 0 outside.
 jm2.null.mc.mask.hdr - header file
fastICA is a an R, Splus (5.x, 6.x) and C implementation of the
algorithms developed by Aapo
Hyvarinen et al at the Neural
Centre , Laboratory of Computer and
Information Science, Helsinki University of Technology. Independent
Component Analysis (ICA) is a method of decomposing a multi-dimensional
dataset into a set of statistically independent non-gaussian variables.
The method is based upon a generative model in which measured signals
are constructed from linear mixtures of unknown latent variables or
These sources are assumed to be statistically independent and
ICA attempts to unmix the measured signals and recover the sources.
The method relies upon the fact that mixtures of independent
variables tend to become more gaussian in distribution when they are
linearly (by the Central Limit Theorem). Thus in order to recover
the independent sources we should maximise some measure of
The FastICA algorithm (as its name suggests) is designed to provide
a computationally quick method of estimating the unobserved independent
components. The algorithm iteratively maximises an approximation to
the negentropy of the projected data. Negentropy is based on the
quantity of (differential) entropy which measures the "randomness" of
an observed variable. Since gaussian variables have the largest entropy
among all random variables of equal variance entropy can be used to
a measure of non-gaussianity i.e. negentropy. In practice this quantity
can be time consuming to calculate. This led to the development of the
fast and robust approximations implemented in the FastICA algorithm.
algorithm has been implemented by the original authors in MATLAB .
In the absence of a generative model for the data the algorithm can
be used to find Projection Pursuit directions. Projection Pursuit is a
technique for finding 'interesting' directions/projections in
multi-dimensional datasets. These projectoins and are useful for
visualising the dataset and in density estimation and regression.
Interesting directions are those which show the least Gaussian
distribution, which is what the FastICA algorithm does.
The fastICA package contains both R/Splus and C code to implement
the FastICA algorithm. The R/Splus code is included for clarity whereas
the C code allows
the method to be run much faster. When the package is compiled the code
linked to optimized BLAS routines if they are present on your machine.
not then unoptimized BLAS routines are compiled separately, which makes
code faster than the R code but not as fast as it could be. Most of the
code included in the package was written by Chris Heaton who is a
summer research student at the Department of Statistics, University of
Oxford (see this
The R package is available from CRAN
The Splus library source code is available from the following link
Installation instructions )
A pre-compiled binary for Splus 6.0 for Windows has been made available
by Professor B D Ripley at
A standalone C version of the code is also available fastiCa.tgz
is essentially the same as that used in the R and Splus
packages described above but uses the ranlib RNG library. Please read
the README file included in the directory for instructions on
compilation. I have successfully compiled this code on my Linux machine
but thats about it so far. The code is distributed under the GPL
license (for details see the file COPYING). An static executable of
this code is available at fastiCa
GWApower is a R package for assessing the power of genome-wide
association studies using commercially available genotyping chips. The
package encapsulates extensive simulation results generated by our
and described fully in the paper
Spencer, C., Su, Z., Donnelly, P. and Marchini, J. (2008) Designing
Genome-Wide Association Studies: sample size, power, and the choice of
genotyping chip. submitted.
Download : GWApower_1.1.tar.gz
An R package where i put all my miscellaneous stuff
JMisc_0.1-2.tar.gz ] [Windows pre-compiled binary
- Bootstap test for multimodality of a sample of data
- MCMC methods for simulating from a 2D Ising model
- Demonstration of the Central Limit Theorem.
- HTH vs HTT coin tosing simulation
- Demonstrate the Law of Large Numbers.
- Simulation of a simple 2 state Markov chain.
- Simulation of a 1D random walk