-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.pl
executable file
·60 lines (48 loc) · 1.22 KB
/
plot.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env perl
my $target = $ARGV[0];
open ANS, "ans.txt" or die $!;
my $start;
my $end;
my $zeb_chr;
my $zeb_start;
while (<ANS>) {
my @slice = split(/\s+/);
my $cne = $slice[0];
if (not ($cne eq $target)) {
next;
}
my $zebcoord = $slice[1];
my $human_chr = $slice[2];
my $human_start = $slice[3];
my $human_end = $slice[4];
my $anscoord = $slice[5];
@slice = split(/\=|\:|\-/, $zebcoord);
$zeb_chr = @slice[0];
$zeb_start = @slice[1];
my $zeb_end = @slice[2];
@slice = split(/\=|\:|\-/, $anscoord);
my $ans_chr = @slice[0];
my $ans_start = @slice[1];
my $ans_end = @slice[2];
$start = $ans_start - $zeb_start;
$end = $start + $ans_end - $ans_start;
# print "found cne $cne $start $end\n";
last;
}
print "graphing $target...\n";
close ANS;
open (GNUPLOT, "|gnuplot");
print GNUPLOT "s(x) = x > $start && x < $end ? 4 : 0\n";
print GNUPLOT <<EOPLOT;
set terminal postscript enhanced "Courier" 14 linewidth 1 rounded
set style line 1 lc rgb '#000000' lt 1 lw 1
set style line 2 lc rgb '#ad0000' lt 1 lw 2
set output "$target.eps"
set size 1 ,1
set nokey
set xlabel "alignment"
set title "$target, $zeb_chr:$zeb_start (danRer5)"
set grid xtics ytics
plot "tmp.dat" w lines ls 1, s(x) ls 2
EOPLOT
close(GNUPLOT);