January 2011
1 post
A small utility for repeatedly running grep on the... →
September 2010
2 posts
If you disagree, I’d appreciate either a reference or an implementation;...
– Daily Life in an Ivory Basement: Assembly is hard because it’s not decomposable
If you are not paying for it, you’re not the customer; you’re the...
– User-driven discontent | MetaFilter
July 2010
1 post
Furthermore, for many [E. Coli] cells the only source of some proteins is those...
– E. coli, What a Noisy Bug — Tyagi 329 (5991): 518 — Science
June 2010
2 posts
May 2010
6 posts
Newick TreeVisitor cheat sheet
pre_visit_tree(t) — callback called before exploring (sub-)tree t.
post_visit_tree(t) — callback called after exploring (sub-)tree t.
pre_visit_edge(src, bo,le, dst) — callback called before exploring an edge. Here src is the source node and dst is the destination node, bo is the bootstrap support of the edge and le is the length of the edge.
post_visit_edge(src, bo,le, dst)...
We hypothesize that the presence of a rare codon, marked by the synonymous...
– A “silent” polymorphism in the MDR1 gene changes substrate specificity [Science. 2007] - PubMed result
FORA.tv - Sage Commons: Josh Sommer, Chordoma Foundation via Cameron Neylon / Deepak Singh : “The one video every life scientist should watch”
Python for Chemistry →
slides from a talk by Noel O’Boyle
April 2010
3 posts
March 2010
5 posts
LG Electronics [fridges] were found to contain an illegal device that activates...
– LG fridges: life’s not so good
Here’s my point: businesses don’t get to pick the timetable for when their...
– kung fu grippe Entitled to Care
Somehow a highly-trained group of scientists at the start of the 20th century...
– Scott and Scurvy
February 2010
2 posts
Get the absolute path of a file (e.g. to email it...
alias ww 'readlink -f'
January 2010
2 posts
If you get this error when trying to use the —home option when installing a custom Python module:
error: must supply either home or prefix/exec-prefix -- not both
then this might be because of default setting for prefix. This will work:
python setup.py install --home=~ --prefix=''
[The HMMER3 tblout format is] a whitespace delimited file for the first 18...
– Sean Eddy Therefore: don’t rely on the format of the table, it will break in some cases. Rather, split the lines with a regex or something.
September 2009
1 post
So often people are working hard at the wrong thing. Working on the right thing...
– Caterina Fake, also pointing to Watson & Crick who discovered the structure of the DNA not working 24/7.
August 2009
1 post
Handle non-UTF8 character in Perl
use Encode;
decode("utf8", $line, Encode::FB_HTMLCREF);
June 2009
1 post
Genes do not respect disciplinary boundaries.
– Lawrence Hunter in his talk at ISMB/ECCB 2009. Some genes that have been studied in certain clinical areas might be relevant in other areas as well, e.g. relaxin I.
April 2009
1 post
You can predict the neural activity in your brain when you think about a word...
– Tom M. Mitchell in a most excellent Google Tech Talk: Brains, Meaning and Corpus Statistics.
March 2009
1 post
migrate to Django 1.0 with sed
Doesn’t cover everything, but works for me:
find -name '*py' | xargs sed -i -e 's/maxlength/max_length/' -e 's/FloatField/DecimalField/'
January 2009
4 posts
Date regex for grep
(January|February|March|April|May|June|July|August|September|October|November|December) *([1-9]|[1-3][0-9]), *[12][0-9][0-9][0-9]|([1-9]|[1-3][0-9]) *(January|February|March|April|May|June|July|August|September|October|November|December) *[12][0-9][0-9][0-9]
This matches dates like:
12 October 1993 29 June 1982 31 March 2008 4 July 1980 April 21, 2008 February 12, 2007 March 31, 2008 May 27,...
Test if file exists and is not empty (for...
In case some of your scripts in a Makefile silently fail (e.g. because they’re running on a cluster):
test -s file
(file exists, not empty)
December 2008
1 post
stripping HTML tags in Python
from BeautifulSoup import BeautifulSoup
''.join(BeautifulSoup(page).findAll(text=True))
source: Euan
November 2008
10 posts
Let’s put someone else’s money where your mouth it.
– ibid.
Physicists are really clever, unlike biologist.
– Luca Turin (tongue in cheek) in an entertaining talk about the molecular mechanisms of the sense of smell. (Though I’d still call BS on his theory.)
Clean up whitespace in LaTeX
Correct whitespace around abbreviations and references (on a Mac). Don’t hyphenate “p-value(s)”.
sed -inplace -E -e 's/ \\(ref|cite)/~\\\1/g' -e 's/(e\.g\.|cf\.|et al\.|i\.e\.) /\1\\ /g' -e 's/([^{])(p-values?)([^}])/\1\\mbox{\2}\3/g' *.tex
You can only do two things a day, one before lunch and one after.
– Roland Krause, attributed to a German scientist.
Use Mac OS X 10.5 screen sharing for any VNC
Finder, Go: Connect to server
vnc://server:590x
where x is the display port
Ignore tweets from Friendfeed in Twitterific
defaults write com.iconfactory.Twitterrific \ tweetTextFilter -string 'ff\.im'
Ugly hack to fold path names into file names
I want to go from
../www.fda.gov/medwatch/SAFETY/2003/03AUG_PI/Advair Diskus_PI.pdf
to
2003_-_03AUG_PI_-_Advair Diskus_PI.pdf
I came up with this hack:
find ../www.fda.gov/ -name '*_PI*pdf' > names_a
find ../www.fda.gov/ -name '*_PI*pdf' | \
sed -e 's/.*safety\/\(.*\)/\1/gi' -e 's/\//_-_/g'> names_b
paste names_a names_b | ~/src/misc/to_tsv.py -0 \' | \
xargs -l1 ln
(The to_tsv.py...
prototype-based classification
(or: prototype-based active classification by Uni Konstanz)
Take large unbiased data to find new components of well-studied pathways
– Nevan Krogan, 4th EMBO Conference: From Functional Genomics to Systems Biology, referring to Roguev et al. (Science, 2008)