R and XCMS in Kubuntu

(*Note: A new version of this post following my switch from Ubunto to OpenSuse can be found here).

For my thesis, I will be using the statistics environment and programming language “R” (r-project.org), and XCMS, which is a framework for mass spectra analysis. I had some trouble getting XCMS running. Hopefully, this will save someone some trouble:

On the webpage where you can download XCMS , it simply states:

To install this package, start R and enter:
source(“http://bioconductor.org/biocLite.R”)
biocLite(“xcms”)

You can try that, but it did not work in my case, anyway (This might just have been due to dependencies, and might have worked after the first step below, I don’t think I tested that). In any case, this is how I eventually did get it to work:
(Note: This assumes R is already installed and working. That part should go without a hitch, using e.g. the Adept installer, as the R packages are in the Ubuntu repos).

  1. First, get the NETcdf-library from here.
    Install it as follows :


    tar -xzf netcdf.tar.gz
    #Replace * with version number here:
    cd netcdf-*
    #"--prefix..." is optional # (installs in a
    # directory other than the current):
    ./configure --prefix=/usr/local
    make
    sudo make install

  2. Now start R. To select a download-site near you, enter:
    chooseCRANmirror()
  3. To choose from a list of repositories, enter the following and select “BioC Software” in addition to the standard “CRAN”:
    setRepositories()
  4. You should now be able to find and download XCMS. To install it, enter:
    install.packages("xcms")

That should do it! To check that you can access it, enter the following in R:

library(xcms)
search()

You should now see “package:xcms” somewhere in the list of active packages.

Hope this is useful to someone! 🙂

Advertisements

About kjartanl

Systems Developer working near Bergen, Norway.
This entry was posted in Science & tech. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s