Our daily bread, equivalent of 11-37 kg of batteries

A back of the envelope calculation on how many kilograms of lithium-ion batteries we would have to carry around to power us for a day — until the next nightly recharge.

Depending on age and sex, about 8-13 MJ energy are needed for a day’s existence, assuming light work. Lithium-ion batteries are widespread in smart phones, electric cars and other electronics not least because of their relatively large specific energy of 0.3-0.7 MJ/kg.

Given this, our battery pack would weigh between 11 and 37 kg for once-a-day recharge.

Having calculated this, how about body fat, our own kind of storage medium? Population average body fat content is around 20 %, and about 10 % body fat is essential. Assuming a body weight of about 80 kg, this leaves about 8 kg storage fat per person or 8 kg * 39.5 MJ/kg = 316 MJ stored energy.

Even in the best case, that are 451 kg batteries to carry.

Newton stood on the shoulders of 14 m tall giants (or less)

If I have seen further it is by standing on the shoulders of giants.

(Newton in a letter to Robert Hooke)

From this we can calculate the giants to be at most 14.3 m tall, assuming they are human-shaped. This is because for seeing further Newton’s eyes must be higher than the eyes of the giant, i.e. his eye height, standing, must be larger than the shoulder-eye-distance of the giants. Sir Isaac is reported to have been five feet six inches (UK) which is about 167.6 cm. Using present-day median values for eye height and shoulder height (see below) for approximate proportions, his eyes were at 155.1 cm. Using this as the shoulder-eye-distance for the giant, by proportions it follows that the giant is at most about 9.198-times taller than Newton, that is about 14.3 meters tall.

FInishing, it is is worth considering that as giants are taller they are probably also proportionately wider and thicker than Newton, so that at maximum they are 778 times heavier than him. When proportionately scaling up body sizes the weight scales by cubes but bone cross section area, which determines their maximal load, only by squares. If giants are subject to biological limits of bone strength, then their bones have at worst only a tenth of the relative strength of Newton’s. Thus such giants can probably best bear their body weight (and Newton’s) when standing neck-deep under water. That however would defeat the purpose.

AVERAGE HUMAN (50th percentiles, in cm)
eye height = 163.26
shoulder height = 144.18
shoulder-eye-distance = 19.08
total height = 175.49
EH:TH = 0.93031
SE:TH = 0.10872414

NEWTON (see here and more here)
with some likelihood five feet six inches  = 167.64 cm, then eye height by proportion = 155.9572

shoulder-eye-distance < 155.9572 then total height by proportion <1434.43.

Filter FASTA files by sequence id using a regular expression

Use a regular expression for filtering sequences by id from a FASTA file, e.g. just certain chromosomes from a genome. There are other tools as part of bigger packages to install (and no regex support), mostly awk-based awkward (sorry for the pun) bash solutions, and scripts using packages that one needs to install and with still no support for regular expressions. This however is a simple, straightforward little python script for a simple task. It doesn’t do anything else and doesn’t need anything but a stock python installation. Based on the FASTA reader snippetContinue reading

A script for qPCR analysis in R

An R script for those who like to be close to their qPCR data and catch problems early. It takes export files (multicomponent data, text format, “across columns”) of Life Technologies StepOne machines.

A standard analysis can be done in less than 5 minutes. It consists of these steps:
– plotting of the raw signal (and saving of the result) to catch odd amplification and strong offsets
– baseline correction
– magnified plotting (and save) to check correction and drift in signal
– cycle estimation by using a threshold
– tabulation of the results

Continue reading

If Nature did the maths

Nature reports on a new, enzymatic assay of Mycobacterium tuberculosis, or more accurately of mycobacteria almost in general. The test delivers a result in half an hour and does not need PCR, prolonged bacterial culture or microscopy which current standard methods require. It is also sensitive: in a test it flagged all samples positive which microscopy found. Microscopy missed 50% of all positive samples, but even of those missed by microscopy the new method flagged 80% positive. Overall then 90% of the Tb+ cases are recognised as such.

Nonetheless, this is not yet a promising method. It has a 27 % false positive rate, i. e. it flags a quarter of all tested persons as positive even though they do not have any Tb-causing bacteria in them. This is a problem, because only 2-400 / 100 000 get tuberculosis in any country of the world (World Bank). The new test flags about 27 000 positive out of those 99 600 healthy persons in the population. Continue reading

A Quine, suitable for birthdays

A program that emits its own python source code when run, i.e. a Quine.

a="a= ;print a[0:2]+chr(34)+a+chr(34)+a[3:]#Another happy return!";print a[0:2]+chr(34)+a+chr(34)+a[3:]#Another happy return!

A version in particular for biologists with added emphasis on the cycle of life:

a="a= ;print a[0:2]+chr(34)+a+chr(34)+a[3:]#Keep studying the miracle of life!";print a[0:2]+chr(34)+a+chr(34)+a[3:]#Keep studying the miracle of life!



Setting the lower cutoff of a miniprep

It maybe a less known fact that the lower cutoff of PCR cleanup and other DNA minipreps may be dialed in by appropriately diluting the binding buffer with water. PCR cleanup kits usually don’t bind fragments below 50-100 bp, depending on the manufacturer. Using water, dilution of the chaotropic salts in the binding buffer sets this limit higher. DNA smaller than the new limit runs through the coloumn, while higher MW DNA adsorbs as before. This can sometimes save the effort of gel purification. Continue reading

Javascript date calculation

A little contribution to make the Genetics Department fly facility media ordering system more user friendly. This snippet calculates the earliest possible delivery date to be used as default delivery time. The challenge was of course writing it without a single comparison or [if] clause. It ran for a while until Sysadmin Ian decided that he wanted one with more functionality.

var asap = new Date(new Date().getTime()+129600000);
asap.setTime(asap.getTime()+86400000*((asap.getDay()+1)%5)*(Math.exp(0, (asap.getDay()%6))));

(Tomorrow, if it is before 12 o’clock, otherwise the day after tomorrow, but either only if that day is not a day of the weekend. In that case the Monday after.)

Squiggle: visualise cave surveys in 3D

I wrote Squiggle, a little set of scripts that produces animated 3D views of cave surveys natively in web browsers. Squiggle is based on the javascript library three.js.

squiggleCheck out this small survey or this cave system (this one might crash browsers on older machines). The controls are as usual: drag for rotating, scroll for zoom. The surveys were made by the Cambridge University Caving Club (CUCC)‘s Austria expeditions, and over time, Squiggle will be used to preview them. Thanks to Wookey for his help in making and testing Squiggle.

Let me know if you would like to use Squiggle to visualise your data.