7
Circos::URL - URL routines for PNG in Circos
11
This module is not meant to be used directly.
15
Circos is an application for the generation of publication-quality,
16
circularly composited renditions of genomic data and related
19
Circos is particularly suited for visualizing alignments, conservation
20
and intra and inter-chromosomal relationships. However, Circos can be
21
used to plot any kind of 2D data in a circular layout - its use is not
22
limited to genomics. Circos' use of lines to relate position pairs
23
(ribbons add a thickness parameter to each end) is effective to
24
display relationships between objects or positions on one or more
27
All documentation is in the form of tutorials at L<http://www.circos.ca>.
31
# -------------------------------------------------------------------
41
use Carp qw( carp confess croak );
44
use Params::Validate qw(:all);
46
use lib "$FindBin::RealBin";
47
use lib "$FindBin::RealBin/../lib";
48
use lib "$FindBin::RealBin/lib";
50
use Circos::Configuration;
52
use Circos::Constants;
55
#use Circos::Image qw(!draw_line);
60
for my $f ( qw ( ) ) {
65
# given a url (although the function can be applied to any string)
66
# replace all instances of [PARAM] with the value of the parameter
67
# named PARAM extracted from the elements passed in the param_path
69
# e.g. format_url(url=>"www.domain.com/param=[ID]",param_path=>[$datum,$data]);
71
my $delim_left = "\Q[\E";
72
my $delim_right = "\Q]\E";
74
return unless defined $url;
76
while ($url =~ /$delim_left([^$delim_right$delim_left]+)$delim_right/g) {
79
if(exists $args{param_path}[0]{data}[0] &&
80
defined $args{param_path}[0]{data}[0]{$param}) {
81
$value = $args{param_path}[0]{data}[0]{$param};
83
$value = seek_parameter($param,@{$args{param_path}});
85
printdebug_group("url","format_url",$url,$1,$value);
86
if (! defined $value) {
87
if ($CONF{image}{image_map_missing_parameter} eq "exit") {
88
fatal_error("map","url_param_not_set",$url,$param);
89
} elsif ($CONF{image}{image_map_missing_parameter} =~ /removeurl/) {
90
# there is no value for this parameter, so return an empty url
92
} elsif ($CONF{image}{image_map_missing_parameter} =~ /ignoreparam/) {
93
$ignore_param->{$param}++;
94
} elsif ($CONF{image}{image_map_missing_parameter} =~ /removeparam/ || 1) {
95
printdumper($args{param_path});exit;
96
# not defined - removeparam by default
97
error("warning","general","You have tried to use the URL $url for an image map, but the parameter in the url [$param] has no value defined for this data point or data set. This parameter is being removed from the URL of this element. Use the image_map_missing_parameter setting in the <image> block to adjust this behaviour.");
98
$url =~ s/$delim_left$param$delim_right//g;
101
$url =~ s/$delim_left$param$delim_right/$value/g;
104
printdebug_group("url","format_url_done",$url);