Please donate for the Haiti earthquake

After the recent tragic events in Haiti, it is a priority to help doctors without borders as much as possible. Please donate, even a small amount from a lot of people can make a sizable difference.

How I ate Fugu and survived to tell the tale

Some time ago I had Fugu, or puffer fish, a highly poisonous fish with no known antidote. Here is a picture to document the fact

Well, it could just be me in front of something that looks like fish, and I’m not going to eat it anyway, but trust me, I had it. Yes, I wanted to take the risk of dying from tetrodotoxin poisoning. After all, we live only once (very appropriate), and since I’m here, why not try it out? Also, note the smile of a sushi lover dream come true.

So, how does Fugu work ? A specialized chef prepares the puffer fish with a proper cutting process, removing all parts containing poison, and leaving only the edible ones. In particular, the liver is among the deadly parts, and is therefore removed completely. Other parts, like the meat, the fins, parts of the head, are safe to consume, all going into a rather particular dinner. Unfortunately I was not able to watch the cutting process: the chef was behind a bench (you can see him in the picture), but apparently he did a proper job, since I am still alive.

Why is puffer fish so poisonous? The culprit is a substance it accumulates, tetrodotoxin, probably obtained from diet or produced from symbiotic bacteria ingested by the fish. This molecule disrupts nerve signal transmission leading to body paralysis, starting from the lips and tongue, then the hands, then to all the rest, including the diafragm. With no control on the diafragm, the victim is unable to breathe, and dies of asphyxiation. During the whole process, which occurs in a matter of hours, the victim is fully conscious and awake, just unable to move, speak, and (in the end) breathe. This is because tetrodotoxin is not able to enter the brain, leaving its nerve tissues unscathed. Scary isn’t it ? The poison is so powerful that 1 milligram (the quantity you can put on the tip of a pin) is enough to kill a human. A single pufferfish contains enough poison to kill tens of people. If you are taken early, kept breathing and get the toxin removed from your body, you can survive the poison and recover completely.

Nerve signal transmission is actuated by an exchange of sodium and potassium ions on the two different sides of the nerve cell membrane. The different ion concentration gives rise to a difference of potential, maintained at the expense of energy. There is an enzyme, known as the sodium-potassium pump, on the surface of the nerve cell membrane, with the task of keeping this unbalance by actively carrying three sodium ions outside the cell, and two potassium ions inside the cell at every cycle. The nerve cell stays “loaded and ready” to transmit the signal. When a signal transmission is triggered, sodium ions are allowed to flow back into the cell in a cascade event, trying to re-establish the equilibrium and suppress the gradient. This is made possible by another enzyme, a sodium transport channel. Tetrodotoxin binds strongly with this channel, thus preventing the sodium to enter the membrane. In some sense, it acts like a cork. Without this mechanism in place, the signal is no longer able to travel along the nerves down to the muscles, and paralysis ensues.

Is eating fugu really so dangerous? According to this site,  incidents are approximately less than 100 per year, with a 10 to 50 % mortality. Most, probably all, of these cases are untrained people eating their own catch. The probability of dying from a certified, experienced Fugu chef are close to negligible, and probably your life is more in danger while driving to the restaurant.

The price for a Fugu dinner is high: 30.000 Yen (230 Euro) for a full course dinner for me and my host, and it is definitely not worth it. The consistency remembers rubber band, and the taste is basically neutral. The dinner therefore focuses on additional herbs, sauces and preparation to please your senses, with the fish as an additional, risky business. Definitely interesting once in a lifetime, as a “been there, done that” story, but for a much lower price I can have a delicious Italian meal where my taste buds really get involved the right way.

References

Image self consistency from xkcd

I love xkcd. A comic combining fun and math by definition has to be good and geeky and the author, Randall Munroe, is a real genius on this. The latest comic is pretty interesting

See xkcd for alt text

xkcd, by Randall Munroe

The image is self-descriptive, meaning that each graph represents information about the image itself. For example, the first panel contains a pie chart which says how many pixels are either white or black on the image. Clearly, the relative amount of black pixels in the image depends on the size of the slice of that piechart representing the amount of black pixels, a “chicken-egg” kind of problem. It is apparently difficult to obtain such image, because the plotted data must be consistent with themselves via the graphical representation. This kind of problems, where the solution depends on itself, is quite common in many scientific problems, and it’s solved through self-consistency.

The trick is as follows: we start with a first, approximate solution, called a guess, and we apply a method that gives us a result depending on this guess. Then, we take this newly obtained result, and reapply the method again, to obtain a new result, and then again, and again, until, hopefully, the input and the output of the method are the same. When this occurs, we solved our problem via self-consistency. Of course, this convergence is not guaranteed to occur, but if it occurs, we found a solution (there could be more than one).

Let’s see it in action in a simplified form. I wrote two small python programs. They use matplotlib and the Python Image Library. The first (called piechart.py) creates a pie chart from a given data input

import sys
from matplotlib import pyplot

white = int(sys.argv[1])
black = int(sys.argv[2])

pyplot.pie([white, black], colors=('w', 'k'))
pyplot.savefig(sys.argv[3], format="pdf")

If we call this program specifying two values (the absolute values are not important, as the pie chart shows relative amount), it draws the pie chart accordingly:

python piechart.py 100 400 piechart_100w_400b.pdf
convert -geometry 210x158 piechart_100w_400b.pdf piechart_100w_400b.png
Starting guess

Starting guess

This creates a pie chart where white is 1/5 of the pie chart area and black is 4/5. Please note that due to a setup problem of my matplotlib I can only create pdf, so I convert the pdf into png of defined size, in our case, 210×158, using the convert program. The total size of the image is of course important, having an influence on the total number of pixels. I chose a good value for presentation purposes which guarantees quick convergence.

The second program is called imagedata.py and extracts size and number of white and black pixels from an image.

import sys

from PIL import Image

im = Image.open(sys.argv[1])
white = 0
black = 0
for i in im.getdata():
  if i == (255,255,255):
    white += 1
  else:
    # we assume black everything that is not white:
    black += 1
print im.size[0],im.size[1],white,black

If we run this program on the png image, it will tell us how many pixels are white, and how many are black.

$ python imagedata.py piechart_100w_400b.png
210 158 23988 9192

Of the 33.180 pixels defining the full image above (border included, not only the pie chart circle), 23988 are white (72%), and 9192 are black (28%). Hence the image is not representing itself: the plot represents our initial values of 20 % white and 80 % black.

Now we create a new image, in agreement with the iterative procedure, passing the most recently obtained values

python piechart.py 23988 9192 piechart_23988w_9192b.pdf
convert -geometry 210x158 piechart_23988w_9192b.pdf piechart_23988w_9192b.png

and repeat the process. This becomes tedious very soon, so I wrote a driver (driver.sh) to perform the process for me

# generates the starting guess
python piechart.py 100 400 iter_0.pdf
convert -geometry 210x158 iter_0.pdf iter_0.png 

# iterative process
echo "step w   h  white black"
step=1
while true;
do
 data=`python imagedata.py iter_$(($step-1)).png`
 echo "$step - $data"
 python piechart.py `echo $data|awk '{print $3}'` `echo $data|awk '{print $4}'`  iter_$step.pdf
 convert -geometry 210x158 iter_$step.pdf iter_$step.png
 step=$(($step+1))
done

If we run it, we immediately see a very interesting result:

step w   h  white black
1 - 210 158 23988 9192
2 - 210 158 29075 4105
3 - 210 158 30551 2629
4 - 210 158 30977 2203
5 - 210 158 31108 2072
6 - 210 158 31158 2022
7 - 210 158 31164 2016
8 - 210 158 31169 2011
9 - 210 158 31172 2008
10 - 210 158 31172 2008
11 - 210 158 31172 2008
12 - 210 158 31172 2008

The number of black pixels decreases, and the number of white ones increases. At every step, the image slightly changes, until it reaches a point where it does not change anymore: it achieved self-consistency, and it is representing itself. This is a movie of the various steps until convergence

Piechart convergence

Piechart convergence

What if we started from the other direction, namely, with a guess containing zero as the number of black pixels? The result would have been the same

1 - 210 158 31750 1430
2 - 210 158 31320 1860
3 - 210 158 31221 1959
4 - 210 158 31184 1996
5 - 210 158 31178 2002
6 - 210 158 31174 2006
7 - 210 158 31172 2008
8 - 210 158 31172 2008
9 - 210 158 31172 2008

Again, even with a different starting guess, we obtain the same result, here depicted as a movie

Piechar convergence 2

Piechar convergence 2

I hope this gave a brief explanation on how Randall achieved the self-consistent image. His case was more complex, having three plots. Also, the comic is scribbled, so either he drew it by hand,  approximating the  computed result, or he performed some scribble-like transformation preserving the pixel count. I assume it is the former.

How much statistics should one know ?

I just wrote an answer to this very interesting question on Stackoverflow. Now, as a disclaimer, I’m not an expert in statistics, but I did enough statistics to “know the beast”, or at least what are the dangers. I will rearrange my answer for this post, to address the more general case.

The main issue is “How much statistics should any person know?”. In our life, we all deal with statistics, willful or not. Polls, weather forecast, drug effectiveness, insurances, and of course some parts of computer science. Being able to critically analyze the presented data gives the line between picking the right understanding out of them or being scammed, tricked, or misdirected.

Technically, the following points are important:

All these points are critical if you want to interpret anything with a grain of salt. Yet, they are not the whole story. Let’s face it. Statistics needs understanding before anything can be inferred, otherwise wrong conclusions will be obtained. I will give you some examples:

  • The evaluation of the null hypothesis is critical for testing of the effectiveness of a method. For example, if a drug works, or if a fix to your hardware had a concrete result or it’s just a matter of chance. Say you want to improve the speed of a machine, and change the hard drive. Does this change matters? you could do sampling of performance with the old and new hard disk, and check for differences. Even if you find that the average with the new disk is lower, that does not mean the hard disk has an effect at all. Here enters Null hypothesis testing, and it will give you a probability, not a definitive answer, like: there’s a 90 % probability that changing the hard drive has a concrete effect on the performance of your machine. Depending on this value, you could decide to upgrade hard drives to all 10.000 machines in your server farm, or not.
  • Correlation is important to find out if two entities “change alike”. As the internet mantra “correlation is not causation” teaches, it should be taken with care. The fact that two random variables show correlation does not mean that one causes the other, nor that they are related by a third variable (which you are not measuring). They could just behave in the same way. Look for pirates and global warming to understand the point. A correlation reports the possible presence of a signal, it does not report a finding.
  • Bayesian inference. We all know Bayesian-based spam filter, but there’s more, and it’s important to see how human decisions and mood can be influenced by a clear understanding of data analysis. Suppose someone goes to a medical checkup and the result tells him/her has cancer. Fact is: most people at this point would think “I have cancer” without any doubt. That’s wrong. A positive testing for cancer moves your probability of having cancer from the baseline for the population (say, 12 % of women have the chance for breast cancer) to a higher value, which is not 100 %. How high is this number depends on the accuracy of the test. If the test is lousy, you could just be a false positive. The more accurate the method, the higher is the skew, but still not 100 %. Of course, if multiple independent tests all confirm cancer, then it’s very probable it is there, but still it’s not 100 %. maybe it’s 99.999 %. This is a point many people don’t understand about bayesian statistics.
  • Plotting methods. That’s another thing that is always left unattended. Analysis of data does not mean anything if you cannot convey effectively what they mean via a simple plot. Depending on what information you want to put into focus, or the kind of data you have, you will prefer a xy plot, a histogram, a violin plot, etc… Each data insight has a different preferred plot, exactly as each conversation has a different appropriate wording.

Statistics enter our lives every time we have to distill an answer or compare numerical (or reduced to numerical) data from unreliable sources: a signal from an instrument, a bunch of pages and the number of words they contain and so on. Think for example to the algorithm to perform click detection on the iphone. You are using a trembling, fat stylus (also known as finger) to point to an icon which is much smaller than the stylus itself. Clearly, the hardware (capacitive touchscreen) will send a bunch of data about the finger, plus a bunch of data about random noise from the environment. The driver must make sense out of this mess and give you a x,y coordinate on the screen. That needs a lot of statistics.

An additional issue is sampling. Sampling actually comes first than statistical analysis: you collect a sample, reduce it to a number, and perform statistics on this number (among many others). Sampling is a fine and delicate art, and no statistics will correct, or even point out at an incorrect sampling, unless you act smart. Sampling introduces bias, either from the sampler, the sampling method, the analysis method,  the nature of the sample, or the nature of nature itself. A good sampler knows these things and tries to reduce unwanted bias as much into a random distribution, so to treat it statistically.

As a closing remark, statistic is among the most powerful allies we have to understand the noisy universe we live in, but it’s also a very dangerous backstabber enemy, if not used properly. Willfully misusing it is definitely evil.

Periodic table of videos

I found this very interesting site about the periodic table of elements, from the University of Nottingham. For each element, there’s a video showing the characteristics of the element, and a brief commentary. Worth checking out if you always had some curiosity about the chemical elements, what they look like, and how they behave.

They also have a youtube channel for even more interesting short movies about chemistry and physics.

Nonlinear optics with polymers

Of the many things I posted, I never had the chance to write something about my direct scientific activity. Recently I worked on optical properties of polyenes. A paper has been published recently on Journal of Chemical Physics. Another one is submitted right now, and a third is in preparation.

Molecules interact with light. This should come to no surprise, as (for example) the whole world of colors depends on this effect. The most trivial interaction between the light and a molecule is normally absorption of one photon followed by emission of the same photon. Nothing changes in terms of energy of the photon. A given wavelength enters, the same wavelength leaves. The molecule is unchanged and unaffected by the event, except for a brief excitation of the electrons cloud. This event is typical linear optics behavior.

However, if we increase the photon density enough, two photons can be absorbed at the same time by the same molecule. After this event takes place, the molecule has many choices to return to electronic ground state. One is to re-emit two photons again. Nothing changes, still a linear optics effect.

A green laser pointer (from Wikipedia, user flip619)
A green laser pointer (from Wikipedia, user flip619)

However, the molecule could also release a single photon, whose frequency is derived by the total amount of energy provided by the two original photons. In other words, a photon of frequency twice the original will be emitted. This is called Second Harmonic Generation and if you have seen a green laser pointer, you directly experienced this effect: the green laser diode is in reality a very strong infrared laser diode covered with a crystal of potassium titanyl phosphate. The infrared photons are absorbed and doubled by the crystal into the green wavelength we see. Exactly the same phenomenon is used with blue lasers used for Blu-ray technology.

Frequency doubling is just one of the non-linear optics effects. There are many more, and they are promising to develop optoelectronic devices, where we control light with an electric field. Unfortunately, in most cases the intensity of non-linear effects is very, very small. You need a very strong laser emission to reach a sufficient photon density for the phenomenon to be appreciable (or used for pratical, non purely instrumental purposes). Moreover, we are using inorganic crystals at the moment, but crystals are fragile, tend to degrade as they are under thermal and optical stress, and they cost a lot. As a consequence, research focused on organic compounds, carbon-based molecules able to produce sizable non-linear optics effects at a fraction of the price, better mechanical properties, and less degradation. Having a polymer able to produce strong non-linear effects would dramatically reduce the cost and increase the life of these devices.

Exploring the chemical space of organic compounds in the “wet lab” is demanding, polluting, and in some cases unachievable, so we simulate the lab on a computer, running a computational method that predicts the intensity of the non-linear effects of a molecular structure of our choice. Our task is therefore to produce a lot of molecules, feed them into this computational machinery, get the evaluation of the non-linear behavior, and try to spot some rules to guide us in maximizing the characteristics we are interested in. As it frequently happens, there’s no “perfect compound”. Instead, there’s a good trade-off, but we are interested in devising rules, not finding the perfect molecule with a brute force approach (which is unachievable, there are simply too many compounds possible out of carbon, hydrogen, nitrogen, oxygen and sulphur: infinite).

My work was focused on polyenes. It’s a nice class of compounds with a nice single-double bond alternation. This allows “almost free” flow of electrons through this kind of molecular wire.

Polyene chain
Polyene chain

We know that non-linear optics properties are influenced by

  • The length of the polyene chain. Longer chains give higher values, with a behavior which can be approximated as a power law for short chains.
  • The substituents groups we put at the ends of the chain (marked as black dots in the picture). Different groups produce different molecules, and therefore, different non-linear properties.

We explored what happened to the non-linear properties as we increase the length of the chain, and at the same time, we include different combinations of end-caps substituents groups. We chose four critically important substituents: two electron donors, one strong (NH2), one weak (OH), and two electron acceptors, one strong (NO2) and one weak (CN). In addition, we used the neutral substituent H. Results were very interesting, and in some cases unexpected. Among many other things, we found that the presence of two substituents can be approximated, in some cases, as a simple addition of two single substitutions, meaning that for certain lengths of the chain, the interaction of the two groups vanishes and they behave as they are isolated.

We also found that the presence of these groups distorts the molecule from its linear, rod-like shape to a C-shaped or S-shaped chain, depending on their nature. This is rather remarkable finding, as there was no computational report for this and very scarce experimental report only on a similar class of compounds. The shape of the molecule has both an effect on the non-linear properties, and on how the polymer crystallizes (depending how good is the packing of the various chains). A new paper on the Journal of Physical Chemistry A has just been accepted on these findings, and it will be published as soon as the editorial process is performed.

So I have something to celebrate tonight. I think I’ll go out for a nice sushi!

Something very humbling is out there

On a dark, clear night, if you walk far away from the city lights, you will be probably able to see a magnificent strike of light we call “the milky way”, our galaxy. It looks like this:

The Milky Way

The Milky Way, from Wikipedia

Our sun is a small, insignificant star, sitting on one of the arms of this magnificent spiral of stars and gas clouds. Any star you can see clearly with your naked eye belongs to the Milky Way, and it’s generally very close to us: hundreds or thousands of light years, small amounts when compared with the 26.000 light years that separates us from the galactic center.

Between October 2007 and August 2009, Alex Mellinger traveled around the globe taking incredible high resolution pictures of the Milky Way. Chunk by chunk, he produced one of the most stunning visual representations of our galaxy. The image can be zoomed, panned, explored. Play with it, I’ll wait right here.

Our galaxy is definitely not alone in the dark void of the universe. On the bottom right of the image you can enjoy the vision two nearby companions, the Large Magellan Cloud and the Small Magellan Cloud. They are smaller, irregular, and quite close to us. People living in the southern hemisphere enjoy these two objects of the night sky.

If you shift your attention to the left of the picture, you will probably notice a small diagonal bit of yellow light, just a little below the Milky Way. Zoom in, it’s a good friend the Andromeda galaxy:

Andromeda galaxy by John Lanoue

Andromeda galaxy by John Lanoue

The Andromeda galaxy can be seen with the naked eye on a clear night. It’s quite far: 2.2 millions light years, but still pretty close. Its shape is close to the Milky Way’s one. Being so far, the photons we see today left the galaxy 2.2 millions year ago, and traveled since then to finally reach our eyes. This means that what we see right now it is the Andromeda galaxy as it was 2.2 millions years ago. Those photons left those stars when humanity was just leaving the trees.

There are other galaxies around in the sky. Each one is full of stars, each star probably full of planets. Each one far from us, the farther they are, the more back in time we look. We developed powerful telescopes in the last decades. One of them is probably the most well known, and the one that returned the most humbling and amazing images: the Hubble Space Telescope. Far high above the turbulent atmosphere, the HST has the best view of the sky we can ask for. So one day we point it at a patch of sky no larger than a pin, and slowly accumulate the photons hitting the detector. One photon after another, an image is formed. It is the Hubble Deep Field.

Hubble Deep Field

Hubble Deep Field

Every bit of light in this image is a galaxy. A full galaxy, full of stars. And they are far. The more far we look, the more we approach the time of the Big Bang. So we continued looking, deeper and deeper. The Hubble Deep Field South, the Ultra Deep Field. More galaxies. Everywhere we point our telescope, in bits of sky no larger than pin tips, we find galaxies, more galaxies, again galaxies. Galaxies everywhere, with stars, some of them with planets for sure.

We pushed even more. This image has been taken a few days ago, again from Hubble

Hubble Space Telescope WF3

This image contains galaxies whose light left for its quest of reaching us 13 billion years ago. Yes, some of these galaxies were there after just 600 million years after the Big Bang, dated by WMAP measurements 13.7 billion years ago. They are the oldest galaxies ever seen.

This is just the beginning. We continue taking pictures of other parts of the sky. More galaxies. Very soon we are sending up a new space telescope, the James Webb telescope. We want to see more, we want to peek back in time and approach those crucial moments where everything we know began. We explore it from the immense big of the sky, and from the immense small of the Large Hadron Collider. From our tiny, insignificant water-covered rocky planet, we need to understand, we need to see, and we need to find the truth. And it will happen in our lifetime.

Norwegian spiral sets the news ablaze

You have probably read or heard about the Norwegian spiral and you have probably also seen it somehow. Of course, what’s the best answer to an unexplained phenomenon ? UFOs, aliens, black holes! I won’t link any material, you can find it everywhere. I will instead link the only rational analysis of the phenomenon. Thanks to Phil Plait, which is always a pleasure to read.

So, what was it? the spiral pattern is interesting, and the fact that it was only visible from Norway as well. The first fact indicates something that rotates while ejecting something, producing therefore a spiral. The second fact indicates something that is quite low in orbit, otherwise it would have been visible from many other places. The brightness of the observed fact is due to the sun.

Ok so, a rotating object ejecting something that brightens up in sunlight and it’s quite low in altitude… something like, a spent rocket?

But no! Both Norway and Russia deny any rocket launch. Of course they are telling the truth, so it must be alien technology! Of course… yeah, right…

Update: ok, so apparently it was confirmed and known that a rocket launch was to occur. Here is a link to a NAVTEX message about a rocket launch occurring in the area.

A comparison of CMS/EPortfolio/Social Network solutions

I am currently looking for a good choice of Content Management System/EPortfolio/Social Network tool to start the activity on wavemol.org . I don’t know exactly what kind of information wavemol will provide, although I know the argument: theoretical and computational chemistry. I believe that the main objectives of wavemol should be:

  • Provide community tools like a blog to communicate the recent news and facts about the community
  • A wiki to provide documentation
  • The possibility to login and have a personal page/blog
  • … store relevant files (such as pdf)
  • …. and keep in touch with people through workgroups, and forums
  • It must support LaTeX formula editing and display.
  • It must be easy (to use, and to administer)

So long for the features, but I ask for more

  • It must be opensource
  • It must run on PHP/MySQL
  • Should have good themes. CSS is not my favourite tool, and my sense of style is horrible.

I will update this post as I try more and more. Stay tuned. At the end, I will choose what I consider the best option from the ones I tried. All my experiments were made in one hour of tinkering (for some, a bit more). Although some would consider this time probably not enough, I want to have something easy with a gradual learning curve. If the developers had this focus in mind, it gives me a clear impression of the kind of care I can find in the product.

I will update this post as I try more solutions, stay tuned.

Read More »

Successfully obtained “primordial RNA” in lab conditions

A groundbreaking paper “Generation of long RNA chains in water” from Costanzo, Pino, Ciciriello and Di Mauro on Journal of Biological Chemistry proposes conditions for the obtainment of complex RNA chains from cyclic nucleotides. The proposed conditions are typical for the pre-biotic Earth: hot springs and puddles with water at moderate temperature (40 to 90 C), without any organic or inorganic catalysis, with simply obtainable cyclic nucleotides. This allowed the formation of long RNA chains carrying the first genetic information, starting the natural selection process of improvement. The results on this paper propose an effective and important advancement for the last piece of the puzzle of evolution: how everything started.

InspectorWordpress has prevented 1 attacks.