Network Navigation Output for $orf
\n";
print "Description
\n";
print "
\n";
if (($cgi->param('new_dataset'))&&($cgi->param('new_data')))
{
$description = $cgi->param('new_dataset');
print "";
print "New Dataset: | ";
print "$description |
\n";
}
print "Dataset: | $dataset_description[0]";
for($i=1;$i<$k;$i++)
{
print " && $dataset_description[$i]";
}
print " |
\n";
$description=$cgi->param('ORF_name');
print "Search for: | ";
print "$description |
\n";
print "Number of Interactions | ";
print "$length |
\n";
print "
\n";
print '
Click here to get SGD annotation for '."$orf"."
";
print '
Return to the main menu';
print OUTPUT "ORF";
for ($i=0; $i<$k; $i++)
{
print OUTPUT "\t$dataset_description[$i]";
}
print OUTPUT "\n";
for $group(keys %nei)
{
print OUTPUT "$group";
for ($i=0; $i<$gnum; $i++)
{
print OUTPUT "\t$nei{$group}[$i]";
}
print OUTPUT "\n";
}
close(OUTPUT);
close (DATASET);
# draw the graph
#==============================
if ($length==0)
{
print "
No interactions found for $orf
";
exit;
}
$total_level=int(log($length/5)/log(2))+2;
my $total_x = 180 * $total_level;
my $total_y = 200 * $total_level+100;
$total_x=(($total_x < 400)?400:$total_x);
$total_y=(($total_y < 400)?400:$total_y);
my $center_x= $total_x/2;
my $center_y= $total_y/2+80;
$orf=$cgi->param('ORF_name');
print '
'."\n";
print 'You can also choose to display the result in a table (recomended when too many interactions)
';
print '';
print '';
sub min
{
my $a=shift;
my $b=shift;
return (($a>$b)?$b:$a);
}
sub find_level_num
{
my $level=shift;
if ($level>0)
{
for ($i=0; $i<$level; $i++)
{
$level_num[$level]+=$level_num[$i];
}
}
else
{
$level_num[$level]=5;
}
return($level_num[$level]);
}
sub draw_pie
{
my $x=shift;
my $y=shift;
my $sector_num=0;
my $angle_start;
my $angle_end;
my $angle_elem;
my $i=0;
my $j=0;
my $cut_x;
my $cut_y;
my $cut_angle=0;
my $fill_x;
my $fill_y;
my $fill_angle;
my $radius=5;
my $pi=atan2(1,1)*4;
my $piover180=$pi/180;
$im->arc($x, $y, 20, 20, 0, 360, $colors[1]);
for ($i=0; $i<$gnum; $i++)
{
$sector_num+=$data[$i];
}
$angle_elem=360/$sector_num;
for ($i=0; $i<$gnum; $i++)
{
if ($data[$i])
{
$angle_start = $j * $angle_elem;
$angle_end = ($j+1) * $angle_elem;
$cut_angle = $angle_end;
if ($sector_num>1)
{
$cut_x = $x;
$cut_y = $y-10;
$im->line($x, $y, $cut_x, $cut_y, $colors[1]);
$cut_x = $x + 10 * sin($cut_angle * $piover180);
$cut_y = $y - 10 * cos($cut_angle * $piover180);
$im->line($x, $y, $cut_x, $cut_y, $colors[1]);
}
$fill_angle = ($angle_start + $angle_end)/2;
$fill_x = $radius * sin($fill_angle * $piover180);
$fill_y = $radius * cos($fill_angle * $piover180);
$fill_x = $x + $fill_x;
$fill_y = $y - $fill_y;
$im->fill($fill_x, $fill_y, $colors[$i+2]);
$j++;
}
}
}
close(FILE);
exit;