Geller Lab Home Jump pass to content National Heart, Lung, and Blood Institute
Developmental Neurobiology
Jump pass to links
[Border]  
Table image of part of Helix NHLBI Home NHLBI Labs    
arrow image to point to Nabel Lab splash page[Nabel Lab Home]arrow image to point to in the lab page[In the Lab]arrow image to point to in the lab members page[Lab Members]arrow image to point to publications page[Publications]arrow image to point to Contact page[Contact Us]arrow image to point to lab location page[Location]arrow image to point to Favorite Journals[Favorite Journals] arrow image to point to Lab Methods[Lab Methods]

 

{Comet moment macro V1.0 9/5/97
by Herbert M. Geller,

Macro to compute comet moment from single cell gel electrophoresis data. Coment moment is computed as the integrated density in the comet tail multiplied by the distance from the center of the nucleus to the center of mass of the tail.

The macro requires manual intervention. It assumes all tails are going to the left of the image.

Steps:
1) Rotate the comet if necessary with "R".

2) Duplicate a rectangular selection containing the entire nucleus and the comet.

3) Go to the new window and change the color from grey scale to color with "P" to more easily identify the boundaries of the nucleus.

4) Draw a vertical selection with the measurement tool across the width of the nucleus and hit "N" to locate the center and radius of the nucleus. The macro will draw a circle which should cover the nucleus. Repeat if not correct.

5) Make a rectangular selection isolating the comet tail and hit "C". The macro will then subtract the background and compute the comet moment.

6) Please note that this definition of comet moment is not normalized to the total amount of DNA, as we find that with 8 bit grey scale, the dynamic range is not sufficient to capture both the tail and the nucleus, so we normally let the center of the nucleus become saturated. }

var xcenter,ycenter,radius:integer
Macro 'Change to Palette Color [P]';
Begin
SetPalette ('Spectrum');
End;

macro 'Rotate Comet [R]';
var x1,x2,y1,y2,dx,dy,width,degrees,height:integer;
theta,pi:real;
begin
pi:=3.1419265;
GetLine(x1,y1,x2,y2,width);
if x1<0 then begin
PutMessage('Please draw a line from the center of the nucleus along the comet.');
exit;
end;
dx:=x1-x2;
dy:=y1-y2;
if dx=0 then begin
if dy>=0 then theta:=pi/2 else theta:=3/2*pi
end
else
begin
theta:=arctan(dy/dx);
if dx<0 then theta:=theta+pi;
end;
degrees:=-theta*180/pi;
if degrees>180 then degrees:=-degrees-360;
{ PutMessage(dx,' ',dy,' theta ' ,theta,' ',degrees); }
SelectAll;
ScaleAndRotate(1,1,degrees);
end;
end;

macro 'Nucleus Center [N]';
var
x1,x2,y1,y2,top,left,width,height:integer;
begin
GetLine(x1,y1,x2,y2,width);
if x1<0 then begin
PutMessage('Please draw a line across the nucleus width.');
exit;
end;
xcenter:=x1+(x2-x1)/2;
ycenter:=y1+(y2-y1)/2;
radius:=sqrt(sqr(x2-x1)+sqr(y2-y1))/2;
MakeOvalROI(xcenter-radius,ycenter-radius,radius*2,radius*2);
clear;
MakeOvalROI(xcenter-5,ycenter-5,10,10);
fill;
KillRoi;
end;

macro 'Comet Dimensions [C]';
var
left,top,width,height,pixel:integer;
x,y,txval,tyval,tpix,CometXPos,CometYPos,CometLen:integer;
n,mean,mode,min,max:integer;
moment:real;
begin
SetUser1Label('Comet Length');
SetUser2Label('Moment');
SetOptions('Area,Mean,Min/Max,User1,User2');
SetPrecision(2);
GetRoi(left,top,width,height);
if height=0 then begin
PutMessage('Please select the comet tail area');
exit;
end;
width:=xcenter-(radius+left);
MakeRoi(left,top,width,height);
Invert;
SubtractBackgound('2D Rolling Ball (faster)',50);
Measure;
GetResults(n,mean,mode,min,max);
txval:=0;
tyval:=0;
for x:=left to left+width-1 do begin
for y:=top to top+height-1 do begin
pixel:=GetPixel(x,y);
txval:=txval+ pixel*(x);
tyval:=tyval+pixel*(y);
end;
end;
tpix:=n*mean;
CometXPos:=txval/tpix;
CometYPos:=tyval/tpix;
CometLen:=sqrt(sqr(CometXPos-xcenter)+sqr(CometYPos-ycenter));
rUser1[rCount]:=CometLen;
moment:=n*mean*CometLen;
rUser2[rCount]:=moment;
UpdateResults;
Dispose;
end;

Table image of part of HelixTable image of Helix

 

Dr. Herbert Geller, Head
Developmental Neurobiology, NHLBI, NIH
Building 10, Room 8C-213, 10 Center Drive, MSC-1650
Bethesda, MD 20892-1650
Email: gellerh@nhlbi.nih.gov

NHLBI HomeLabs at the NHLBIContact the NHLBIAbout NHLBISearch NHLBI
Table image of Helix

 

 

Accessibility Policy | Privacy Statement
Health Information | Scientific Resources | Research Funding
News and Press Releases | Committees, Meetings, Events | Clinical Guidelines
Studies Seeking Patients | Labs at the NHLBI | Technology Transfer


Logo DHHS
Logo NIH
Logo NHLBI

Partners logo Cardiovascular Health Partners
Healthy People 2010

Please send us your feedback, comments, and questions
by using the appropriate link on the page, Contact the NHLBI.

Note to users of screen readers and other assistive technologies: please report your problems here.