The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...' --Isaac Asimov
That’s Funny… random header image

Predicting the height of a saturated peak on an electropherogram

May 6th, 2009 by eric
Respond

One way to assess the microbial community structure in an environment is to use a ‘fingerprinting’ technique, like T-RFLP or ARISA, to interrogate the ’species’ living there as determined from their 16S rRNA genes or some functional gene like amoA. Here’s an example of a T-RFLP electropherogram from sea ice:
examplecsv0

You can see that most of the signal in this sample is contained within a few peaks. Sometimes those peaks saturate (max-out, overblow) the detector, which is bad if I am interested in comparing the heights of the peaks (a controversial subject, I should note I am only doing bulk, not individual, comparisons). Of course, I could just add less DNA and run it again, except that then I would be liable to lose some of the smaller peaks (also, it’s not practical for me to re-run these specific samples). So I’ve written a script in the open-source statistical package R to estimate the heights of the saturated peaks by fitting a Gaussian function of the form

f(x) = y_0+\dfrac{b\sqrt{2/\pi}}{d}*e^{-2\left(\dfrac{x-x_0}{d}\right)^2}

where ‘y_0′ is the y-minimum, ‘x_0′ is the center of the peak, ‘b’ is a scaling factor, and ‘d’ is related to the standard deviation of the distribution.

You can download the script here: gaussfit.r

The figures below show (A) a fitted regular-sized peak, and (B) a fitted saturated peak. In my case, the fitted function has a maximum that is 1.6 ± 2.5% of the observed maximum for regular-sized peaks.

examplecsv1examplecsv2

Tags:   · · · · · · No Comments.

Using Bazaar version control system for my Ph.D. Thesis

April 30th, 2009 by eric
Respond

I wrote my last paper in LaTeX and the submitted file was named ‘paper_v26′. Various other files with similar names are floating around and it is a chore to keep up with which is the latest version when they are split between two computers and three operating systems. For my thesis I decided to make things easier. I tried using subversion. I really did. But it just wasn’t doing it for me. So I tried Bazaar and got it to work intuitively in just a few minutes. So that’s what I’m going to start using now. To help get you (and me) started, here’s a distilled version of this tutorial and this user guide). Requirements for my setup: 1) unfrightened by the command line; 2) SSH daemon running on central repository host.

Briefly, the way it works is that you set up a central repository for your files, preferably on some computer that is connected to the internet all the time, even better if it has a static domain name. Into this repository you place the files you want to be version controlled. This works best for plain text files (like LaTeX source files) because it is simple to compare versions if necessary, but it will also work for binary files like OpenOffice documents (which have built-in version control, if you didn’t know) and images. If you are working on the computer with the central repository, great, just make sure to update the files each time before you work on them and commit them each time you are done. You could probably write a cron job to do this for you if you are liable to forget. If you are working on a different computer, you just have to ask the central repository for the files and it will give you the latest versions. After you edit them you have to commit the changes to a local repository, which can then be merged with the central repository.

To get started:

  • Install bzr
  • Make a new directory and copy the files you’ll be starting with into it. If you’re using LaTeX, you’ll probably only want the files that are not compiled, e.g. *.tex, *.bib, *.bst and NOT *.aux, *.log, etc.
  • Tell bzr who you are:
    bzr whoami "me <me@me.com>"
  • Initialize tracking in this directory:
    bzr init
  • Add all the files in the directory, recursively:
    bzr add
  • Commit the files to the first revision. Make sure to add a message (-m), or you might find yourself in ‘vi’ (shudder). Do this after every work session.
    bzr commit -m "very important message"
  • Next time you work from this computer with the central repository, make sure you are using the most recent version:
    bzr update
  • The first time you work on your project from a different computer, pull a new copy via ssh from that computer:
    bzr branch sftp://user@host.domain:port/location/to/remote/files /new/local/location
  • In future sessions, pull new edits from the central repository before working on them:
    bzr merge sftp://user@host.domain:port/location/to/remote/files
    bzr commit -m "merge from parent"
  • To submit edits to the central repository, first commit them locally, then push edits via ssh to that computer:
    bzr commit -m "local changes"
    bzr push sftp://user@host.domain:port/location/to/remote/files

Some further usage, much of which is intuitive because it works just like regular unix commands:

  • Clean up a directory by deleting non-versioned files and reloading the last commit:
    bzr commit
     rm *
    bzr revert
  • Make a new versioned subdirectory:
    bzr mkdir ./newdirectory
  • Add a new file to the repository:
    bzr add ./newfile.txt
  • Remove a file from the repository:
    bzr rm ./oldfile.txt
  • Rename or move a file or directory in the repository:
    bzr mv oldfile.txt newfile.txt

Tags:   · · 1 Comment

Generic Ubuntu/Kubuntu problem resolution post

April 15th, 2009 by eric
Respond

Fixed “current dist not found in meta-release file” on upgrade to Kubuntu Jaunty 9.04″
The first time it ran I was within the university wifi network and the upgrade script downloaded the login page rather than the meta-release file. I corrected it by removing the incorrect file and trying it again:

rm ~/.update-manager-core/meta-release

Fixed Audigy 2ZS sound problem in Kubuntu!
Finally figured out that I had to MUTE the Analog/Digital Output Jack, and that’s it! Do it either in kmix or alsamixer, it doesn’t matter.

Tags: No Comments.

Cell counting helper program

March 17th, 2009 by eric
Respond

bacteria, archaea, and viruses from Arctic winter sea ice

bacteria, archaea, and viruses from Arctic winter sea ice

For those of us still doing microscope counts at the microscope, I offer CellCounting, a program to help make it easier. It’s written in Perl so just run it from the command line and count your cells as usual, but reward yourself with a tab-delimited output file for all your hard work!

Tags: No Comments.

ARB install on Kubuntu 8.10

January 26th, 2009 by eric
Respond

I added the following lines to my ‘/etc/apt/sources.list’

deb http://techno.mikro.biologie.tu-muenchen.de/debian intrepid non-free
deb http://techno.mikro.biologie.tu-muenchen.de/debian hardy non-free

and installed the packages arb (base installation), transfig (something to do with LaTeX), xfig (for exporting trees), and libmotif3 (for library libXm.so.3)

sudo apt-get install arb transfig, xfig, libmotif3

More info here: http://techno.mikro.biologie.tu-muenchen.de/

Tags:   · · No Comments.