[BioC] FlowViz log ticks trick

Davide Rambaldi davide.rambaldi at ifom-ieo-campus.it
Wed Feb 23 16:42:22 CET 2011


Hi, I was unable to find a emthod/parameter to draw tickmarks corriesponding to LOG decades for flow-cytometry data.

I have then implemented my method (is brutal but seems effective). 

RESULT: http://img510.imageshack.us/i/pkhlinear.png/

CODE:

# SET number of channels and log decades
channels <- 65535
decades <- 4

plot(mData[[1]], "PE", breaks=256, col="orange", ylim=c(0,2500), main="PKH26", axes=F)
axis(2)

# calculate the main tickmarks
my.fact <- channels / decades

# main ticks
axis(1, at=c(0,my.fact,my.fact*2,my.fact*3,my.fact*4), labels=c(expression(10^0), expression(10^1), expression(10^2), expression(10^3), expression(10^4)))

# small ticks
decade.one <- log(2:9)
decade.one.log.ticks <- c(round((decade.one*my.fact)/max(decade.one)))
axis(1, decade.one.log.ticks, labels=FALSE)
decade.two.log.ticks <- decade.one.log.ticks + round(my.fact)
axis(1, decade.two.log.ticks, labels=FALSE)
decade.three.log.ticks <- decade.two.log.ticks + round(my.fact)
axis(1, decade.three.log.ticks, labels=FALSE)
decade.four.log.ticks <- decade.three.log.ticks + round(my.fact)
axis(1, decade.four.log.ticks, labels=FALSE)


It is this code correct? There is a better way to do this?

Best Regards

Davide Rambaldi


More information about the Bioconductor mailing list