my $input_gene_file;
my $input_config_file;
my $output_file;
-my $apply_paralog_heat = 0;
+my $apply_homolog_heat = 0;
my $remove_lit = 0; # flag to remove literature and lit references
my $use_symbols = 0; # flag to indicate use of provided gene symbols
my $verbose = 0; # flag for verbose output
my %swap_genes; # original and swapped genes
my $gpml_doc; # imported GPML data for manipulation and output
my %unmapped_genes; # original genes not mapped to homologs
+my %gradient; # blue-red gradient used for opt. heat map box-coloring
$Data::Dumper::Pad = "... ";
}
}
case "s" { $use_symbols = 1; }
- case "h" { $apply_paralog_heat = 1; }
+ case "h" { $apply_homolog_heat = 1; }
case "L" { $remove_lit = 1; }
case "v" { $verbose = 1; }
case "G" { $doc_mode = 1; }
. "Output File: $output_file\n"
. "\n"
. "Use provided gene symbols? " . ($use_symbols ? "Yes" : "No") . "\n"
- . "Provide paralog heat-map? " . ($apply_paralog_heat ? "Yes" : "No") . "\n"
+ . "Provide homolog heat-map? " . ($apply_homolog_heat ? "Yes" : "No") . "\n"
. "Remove literature references? " . ($remove_lit ? "Yes" : "No") . "\n"
. "Running in verbose mode? " . ($verbose ? "Yes" : "No") . "\n"
. "Running in document mode? " . ($doc_mode ? "Yes" : "No") . "\n"
}
+# ---------------------------------------------------------------------------
+=item B<void set_gradient()>
+Sets the blue-red gradient
+=cut
+# ---------------------------------------------------------------------------
+sub set_gradient($)
+{
+ my @blue_red_array;
+ for (my $i=0; $i<256; $i++) {
+ push @blue_red_array, [$i, 0, (255-$i)];
+ }
+
+ # print Dumper(@blue_red_array) . "\n\n";
+
+ register_gradient("blue_red",\@blue_red_array);
+
+ # print "[Available Gradients]";
+ # print Dumper(available_gradients()) . "\n\n";
+ # print Dumper(gradient("blue_red")) . "\n\n";
+
+ my %blue_red_gradient;
+
+ my $max_grad = $_[0];
+ my $inc = sprintf("%.2f", 1/$max_grad);
+ my $count = 1;
+ # print "Increment: $inc\n";
+ for (my $i=$inc; $i<=0.99; $i=$i+$inc) {
+ #print "$i\n";
+ #print grad2rgb("blue_red",$i) . "\n";
+ my $tmp_hex = grad2rgb("blue_red",$i);
+ $tmp_hex =~ s/\#//;
+ $blue_red_gradient{$count} = $tmp_hex;
+ $count++;
+ }
+ # print "[My Gradient Hash]\n";
+ print Dumper(%blue_red_gradient) . "\n\n";
+
+ return %blue_red_gradient;
+}
+
# ---------------------------------------------------------------------------
=item B<void import_data()>
close(GENE_FILE);
+ # initialize the blue-red gradient for heat mapping
+ if ($apply_homolog_heat)
+ {
+ %gradient = set_gradient($max_homolog_count);
+ }
+
print "Opening GPML pathway file and reading data...\n\n";
my $parser = new XML::DOM::Parser;
$curr_graphics->setAttribute("Color",$configs{"BoxBorder"}); }
# add "heat" to genes with multiple paralogs
- if ($apply_paralog_heat && ($gene_suffix_counter > 0))
+ if ($apply_homolog_heat && ($gene_suffix_counter > 0))
{
- $curr_graphics->setAttribute("FillColor","cc0000");
+ $curr_graphics->setAttribute("FillColor",$gradient{$gene_suffix_counter});
}
else
{
# ---------------------------------------------------------------------------
init;
-
-print "[Available Gradients]"
-print Dumper(available_gradients()) . "\n\n";
-exit
-
import_data;
show_input;
swap_genes();