Islamophobia

There was a big English Defence League (EDL) march in Newcastle today. The EDL seems to be a new and pretty offensive anti-Islam movement, populated by British National Party supporters, with a similar ethos to the National Front. I would have liked to have attended the counter-protest by Unite Against Fascism, but I only heard about all this yesterday and didn't get my act together in time. I did go into town this afternoon, but by the time I got there, there was nothing left except for hundreds of police and an empty stage under Grey's Monument. By all accounts, the EDL supporters were outnumbered by UAF supporters, which makes me glad. I worry a little bit about English nationalism in Newcastle. I wonder why the white front door of a flat on Nuns Moor Road, surrounded by Asian businesses, was daubed with red gloss paint a couple of weeks ago, making a huge St. George's flag. I wonder why I had to take an EDL sticker off the door of the squash courts I use last week. Anyway, having missed the marches today, I was reading about them online, and came across this interesting video:

http://www.guardian.co.uk/uk/video/2010/may/28/english-defence-league-un...

To my dismay, I know the EDL supporter interviewed 7mins 36 seconds in. He works for my landlord, who I believe is a Muslim, in the chip shop beneath my flat!

Colonyzer: automated quantification of micro-organism growth characteristics on solid agar

Our article describing a new, sensitive image analysis tool for quantifying the density of micro-organism cultures growing on solid agar plates has been accepted for publication in BMC Bioinformatics, you can access it here.

Colonyzer is largely written in Python using the Python Imaging Library, but also uses the rgenoud genetic optimisation package in R (via RPy).

Colonyzer has a website here and if you want to use or develop the code, it is freely available from its sourceforge page.

DOI: 10.1186/1471-2105-11-287.

Python for Scientists

I will be running a half-day workshop on Python programming for Medical School postgraduate students on Tuesday.

I've written some notes up as a website describing how to install Python on Newcastle University Windows Desktops, how to execute Python scripts, how to install Python packages, a brief introduction to programming, and some examples.

http://www.staff.ncl.ac.uk/conor.lawless/ScientificPython/

I'm trying to make the examples in particular relevant for biological researchers.

Amie knits gorillas

Ageing cured!

Ageing has been solved. We are all out of a job.

Quantitative assessment of markers for cell senescence

Our paper describing the use of a simple, well-parameterised cell population model to compare the usefulness of various cellular markers as indicators of cellular senescence is now available in Experimental Gerontology. We used CaliBayes (published here) to give distributed estimates of the increase in senescent fraction with time in passaged human fibroblasts.

DOI: 10.1016/j.exger.2010.01.018.

Daedalus of DREADCO.

A few weeks ago, I had the very great pleasure of visiting the home of Prof. David Jones to take some photographs of him and some of his creations as promotional material for a documentary about him by Adrin Neatrour. Prof. Jones is probably most famous for writing the Daedalus columns in New Scientist and Nature, but is also well known for building unridable bicycles, investigating Napoleon's death, and building puzzlingly perpetual motion machines.

ProfessorJonesMirror4

Perpetual

DavidProjector

FiveFrames

ChemicalGardenInspection

He is a fascinating, mischevious and inspirational scientist and engineer with a house packed to the brim with amazing tools and gadgets. Prof. Jones showed me a lathe where he had recently carved a set of billiard balls with centres of gravity which were not located at their centres to give to a relative as a christmas present!

Adrin's documentary is really enjoyable, I recommend it to anyone, and it will shown, for free at the Tyneside Cinema at 3pm on Tuesday 16th March 2010 as part of the Newcastle Science Festival 2010.

The documentary is distributed by Galloping Films.

CloseEncounters

I stumbled across the Python winsound module today. It is a standard library on Windows machines and it has a function for controlling the PC speaker. Harf.

Hear it play the music from Close Encounters of a Third Kind from a list of frequencies and durations:

import winsound
from winsound import *
music=((784,1),(880,1),(698,1),(349,1),(523,3))
for x in music:
    Beep(x[0],550*x[1])

A list of frequencies and durations is a simple, computational form of musical notation.

CaliBayes and BASIS: integrated tools for the calibration, simulation and storage of biological models.

Our new article published today in Briefings in Bioinformatics, describing CaliBayes (Bayesian inference for parameter distributions in SBML models, including discrete stochastic models) and BASIS (a tool for simulating cohorts of stochastic simulations from an SBML model and storing the results). Both of these systems are accessible as webservices and there are various convenient Python, Java and R client libraries to make consuming these webservices extremely straightforward. Both systems make significant computing power at Newcastle University publicly available.

Free access to .pdf

The DOI entry for the article is now working:

10.1093/bib/bbp072

Zoom on a Random Walk

After reading Darren's post about the Mandelbrot set I was browsing through the Wikipedia entry on the Mandelbrot set which has a few amazing animations of really deep zooms on the fractal bounded by the set.

The good/bad thing about fractals is that as you magnify them, the pattern and resulting image that you see is in some way similar to patterns you saw at lower magnifications. So the zooms are in some sense self-similar.

It occurred to me that viewing random walks at different magnifications should have a similar property. You should not be able to tell what magnification you are looking at, since the average trajectory should be random, regardless of the scale of the trajectory. As long as you are away from the scale at which you can observe any discrete steps making up the walk, that is.

So, we should be able to make semi-infinite zooms of random walks, in which all magnifications look believably random and as if they were generated from the same process but without any repeating or recurring patterns. I think the random walks are quite pleasing to look at. It is a bit tricky to create this zoom though, since I can't think of any cunning way to step from one magnification to another by "filling in" the gaps in the walk that have just come into view. So I have to create a massive random walk image, and progressively resize and crop it to achieve the zoom. Also, the PyGame code I posted a while ago is too slow for generating a massive random walk. However, there's no need to see the walk being generated in this case, so we can just colour pixels black and anti-alias during image resize (using the Python Imaging Library) instead of doing it in real-time.

Deep zooming is cool anyway as you can see in the amazing Powers of Ten video by Charles and Ray Eames.

So, here's a zoom on a random walk that I made (approximately 100 times zoom, made on a 32-bit machine with 3.5Gb RAM):

Zoom on a Random Walk

The frames were generated with the Python code below. If you have a more powerful computer than me to hand, you can generate a deeper zoom! Just increase the width and height parameters until you run out of memory or patience. I patched the output images together and created a .gif animation using the amazing VirtualDub.

import PIL,random,math,os
from PIL import Image,ImageDraw
 
# Define screen size and initialize
size=width,height=3500,3500
plot=Image.new("L",(width,height),'white')
pix=plot.load()
 
# Output Frame size
wf,hf=250,250
# Zoom parameters
zmax,zno=1.0,700
 
# Start at centre of image
x,y=width/2,height/2
pix[x,y]=0
 
# Prepare to find the bounding box for the walk
xmin,ymin,xmax,ymax=x,y,x,y
pcount=0
 
# Start walking until we hit the edge
while 1<=x<width-1 and 1<=y<height-1:
        # Generate new steps
        xnew=x+random.randint(-1,1)
        ynew=y+random.randint(-1,1)
        x,y=xnew,ynew
        pix[x,y]=0
        pcount+=1
        if x<xmin:xmin=x
        if x>xmax:xmax=x
        if y<ymin:ymin=y
        if y>ymax:ymax=y
 
# Crop to the walk      
plot=plot.crop((xmin,ymin,xmax,ymax))
 
# Rotate if necessary to make image wider than tall
if xmax-xmin<ymax-ymin:
        plot=plot.rotate(90)
(w,h)=plot.size
 
# Set minium zoom to just capture entire walk
zmin=float(wf)/float(w)
 
# For geometric zooming:
# zoom(z) = a*pow(phi,b*z)
# insist that zoom(0)=zmin, zoom(zno)=zmax
phi=10.0
a=zmin
b=math.log(zmax/zmin,phi)/zno
 
for z in xrange(0,zno+1):
        zoom=a*pow(phi,b*z)
        print "FRAME: ",z, zoom
        blank=Image.new("L",(wf,hf),'white')
        if z>0 and z%50==0:
                # Throw away pixels to achieve deeper zoom with set memory
                cz=float(hf)/float(hnew)
                xa=max(0,int(round(float(w)/2.0-cz*float(w)/2.0)))
                ya=max(0,int(round(float(h)/2.0-cz*float(h)/2.0)))
                xb=min(w,int(round(float(w)/2.0+cz*float(w)/2.0)))
                yb=min(h,int(round(float(h)/2.0+cz*float(h)/2.0)))
                plot=plot.crop((xa,ya,xb,yb))
                (w,h)=plot.size
        wnew=int(round(zoom*float(w)))
        hnew=int(round(zoom*float(h)))
        # Resize the frame
        small=plot.resize((wnew+1,hnew+1),Image.ANTIALIAS)
        # This crop is to trim grey lines which appear
        small=small.crop((1,1,wnew+1,hnew+1))
        xmin=int(round(float(wnew)/2.0-float(wf)/2.0))
        ymin=int(round(float(hnew)/2.0-float(hf)/2.0))
        xmax=int(round(float(wnew)/2.0+float(wf)/2.0))
        ymax=int(round(float(hnew)/2.0+float(hf)/2.0))
        if wnew<wf or hnew<hf:
                frame=Image.new("L",(wf,hf),'white')
                px=int(round(float(wf-wnew)/2.0))
                py=int(round(float(hf-hnew)/2.0))
                frame.paste(small,(px,py))
        else:
                frame=small.crop((xmin,ymin,xmax,ymax))
        fname="FrameL%05d.png"%z
        frame.save(fname)
 
print "Zoom: ",1.0/zmin
print "Steps: ",pcount
Syndicate content