Login  Register

Re: gel analysis

Posted by Peter Frenzel on Feb 14, 2006; 11:04am
URL: http://imagej.273.s1.nabble.com/gel-analysis-tp3703740p3703742.html

Thanks, Gabriel!

Arbitrary rotation works fine!

About interfacing to R: a real "interface" may be beautiful but not
necessarily what's needed. A compact *.csv file for importing to R would be
enough. There are routines available for importing *.csv-files recursively,
but analysis is less error prone if only one file has to be handled. I'll
come back to these analyses in March, so if somebody is interested, I can
share the R-code.

Regards,

Peter

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of
Gabriel Landini
Sent: Dienstag, 14. Februar 2006 11:19
To: [hidden email]
Subject: Re: gel analysis


On Tuesday 14 February 2006 08:29, Peter Frenzel wrote:
> I’m analysing DGGE-gels but doing the numerical analysis (baseline
> subtraction, peak detection etc) externaly using R
> (http://cran.r-project.org/).

Hm... I have been wondering about how to interface IJ with R. If you can
give
some hints, I would be interested.

> (i) If the lanes are not perfectly perpendicular to the edge of the image,
> I rotate the image accordingly before analysis.
> A solution like that in Photoshop would
> be great (in Photoshop: draw any line with the Measure-Tool, do
> Image-Rotate-Arbitrary, and the deviation of the arbitrary from a
> horizontal line is offered as default for rotation).

This is quite easy:
First draw a line, then run this macro:

---------------------8<-----------------------
//Rotate_from_line.txt
//G. Landini 14/Feb/2006
//
// Rotates an image using a line selection as reference.
// The direction of the line selection is considered the "horizontal"
// and the image is rotated accordingly.
// The first point drawn on the line is considered the
// origin point to calculate the angle (so one line can produce 2
// different rotations depending on how it is drawn).

getLine(x1, y1, x2, y2,lineW);
if (x1!=-1){
 a=-atan2( (y2-y1),(x2-x1))*(180/PI);
 //print(a);
 run("Arbitrarily...", "angle="+a+" interpolate  fill");
}
---------------------8<-----------------------

Cheers,

Gabriel