Skip to main content

Posts

Showing posts from April, 2010

crontab

What you need to know: Either use the minute hour day month day-of-week format, or shortcuts like @daily . The script should be placed in /etc/cron with permission to be executable, i.e. 755.

Simple website redirect with perl

For when you're too lazy to fiddle with mod_rewrite, you can use a simple Perl script to redirect file a.pl to b.pl. Upload a file a.pl with the following content: chmod a.pl with the right permissions - and, of course, make sure, Perl is supported.

Setting up remote git repository

On your remote machine, create a new directory and start a new git repository. On your local machine, or wherever you have the files, start a git repository, add the files you need, and commit them. Now you have your files under revision control, but only locally, which is bad if your hard drive breaks or if you work from more than one machine. So add the repository on the remote machine as another remote directory and push to it. To get the files on another machine, do

converting files to .ps

You can use Preview -> print -> Save as PostScript to turn a pdf or jpg into ps. Only problem is, that the new image is the size of the paper you printed to, not the original image size. As on the picuture below, there's extra space added at top and bottom of the picture.

The edges of understanding, Arthur D Lander

"A culture’s icons are a window onto its soul. Few would disagree that, in the culture of molecular biology that dominated much of the life sciences for the last third of the 20th century, the dominant icon was the double helix. In the present, post-modern, 'systems biology' era, however, it is, arguably, the hairball ." -- doi:10.1186/1741-7007-8-40

A study of scientific publication ethics

Just went to a great talk about publication ethics. The next time you review a paper, use this easy tool ( eTBLAST ) to check for plagiarism. Just copy and paste the abstract to it. "Identification of duplicate citations in the bio-medical literature The project aims at identified highly similar citations (based on their abstract) to flag potential cases of unethical publications, using a text comparator algorithm named eTBLAST." Right now it only searches medical databases (Medline, Pubmed, NASA, ...) but it will search the arXiv soon!

Can a Systems Biologist Fix a Tamagotchi?

Here 's a great paper that humorously lays out the challenges of reverse engineering. "Another common inspection tool in biology is gene perturbation experiments. As already mentioned, this technique can provide useful information, but it is also used more blindly, e.g., by deleting in turn every single gene in an organism to see what happens. In software engineering, no one has ever seriously proposed to remove each instruction in a program in turn to see what breaks. One might have a slightly better chance of acquiring useful knowledge by removing all pairs or triplets of instructions, but this immediately becomes unfeasible."

Merging multiple files columnwise

Here's a little parser script, to merge multiple files. Each file has a header and a time course. I need all time courses in a single file, next to each other. basedir = "./MassSpectrum/" allData = [] # ms data from all files filelist = Dir.new(basedir).entries filelist.each {|f| if f !~ /\.txt/ # f is not a data file next end data = [] # ms data from this files massToCharge = 50 readData = false # set to true once we are reading in ms data File.open( basedir+f).each { |line| case line when /^SPECTRUM/ next when /raw/ data.push line.chop.rstrip puts ":#{line.chop.rstrip}:" next when /^Mass/ puts "starting" readData= true next end if readData # we are reading ms data, should go from 50 to 650 arr = line.split while arr.first.to_i != massToCharge # a mass to charge ratio was skipped data.push 0 massToCharge = massToCharge + 1 end

Publishing your Thesis

Dear Igor, no thank you, my (not yet written) thesis should not be published as a book. The individual sections have been published in different magazines, so it is available to a "wider audience" already. Let's save some trees and not turn every collection of written words into a book. FH Dear Hinkel Franz, I am writing on behalf of the International publishing house, Lambert Academic Publishing. In the course of a research on the The Department of Mathematics at Virginia Tech, I came across a reference to your work in the field of Mathematics. We are an International publisher whose aim is to make academic research available to a wider audience. LAP Publishing would be especially interested in publishing your dissertation in the form of a printed book. Your reply including an e-mail address to which I can send an e-mail with further information in an attachment will be greatly appreciated. I look forward to hear from you. Kind regards, Igor Mano

Vim Spellchecking

Vim 7 has built in spellchecking. You can turn it on and off with and F11 and F10 . To add a word to your dictionary, use zg . But even better, to delete a word from the dictionary, use zw (for w rong word). You can also manually edit your dictionary, it is in .vim/spellfile.add.

Caption before Label

If you need to reference a table in a latex document, make sure you set the caption before the label, otherwise the table will be incorrectly referenced as the section it is in. \begin{table} \begin{center} \begin{tabular} {|l|r|} \hline Protein & number of functions\\ \hline Cln3 & 1\\ MBF&5\\ SBF&5\\ Cln1,2&4\\ Cdh1&15\\ Swi5&17\\ Cdc20\&Cdc14&7\\ Clb5,6&6\\ Sic1&339\\ Clb1,2&64\\ Mcm1/SFF&5\\ \hline \end{tabular} \end{center} \caption{Number of possible functions for each protein} \label{table:numFun} \end{table}

Latex Table with multirow

If you ever have to make a table, where you need multiple lines for one entry, this is one way to do it: \usepackage{multirow} \begin{table} \makebox[\textwidth][c]{ \begin{tabular}{ccccccc c cccc} \multirow{2}{*}{Time} & \multirow{2}{*}{Cln3} & \multirow{2}{*}{MBF} & \multirow{2}{*}{SBF} & \multirow{2}{*}{Cln1,2} & \multirow{2}{*}{Cdh1} & \multirow{2}{*}{Swi5} & Cdc20 and & % This is the part to be split \multirow{2}{*}{Clb5,6} & \multirow{2}{*}{Sic1} & \multirow{2}{*}{Clb1,2} & \multirow{2}{*}{Mcm1/SFF}\\ &&&&&&& Cdc14 \\ % This is the second row \hline 1&1&0&0&0&1&0&0&0&1&0&0\\ 2&0&1&1&0&1&0&0&0&1&0&0\\ 3&0&1&1&1&1&0&0&0&1&0&0\\ 4&0&1&1&1&0&0&0&0&0&