line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
#Copyright (c) 2010 Joachim Bargsten <code at bargsten dot org>. All rights reserved. |
3
|
|
|
|
|
|
|
package Bio::Gonzales::Align::Jalview; |
4
|
1
|
|
|
1
|
|
871
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Mouse; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
1
|
|
|
1
|
|
437
|
use Bio::Gonzales::Seq; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
345
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.083'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'sequence' => ( |
13
|
|
|
|
|
|
|
is => 'rw', |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub track_marks { |
17
|
|
|
|
|
|
|
#array of coordinate references [start, end, name] |
18
|
2
|
|
|
2
|
0
|
104
|
my ($self,$data) = @_; |
19
|
2
|
|
|
|
|
5
|
my $coords = $data->{track}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
7
|
my $track_prefix = "NO_GRAPH\t$data->{name}\t$data->{description}\t"; |
24
|
2
|
|
|
|
|
14
|
my @track = ('|')x($self->sequence->length); |
25
|
2
|
|
|
|
|
4
|
for my $c (@{$coords}) { |
|
2
|
|
|
|
|
6
|
|
26
|
2
|
|
|
|
|
7
|
$track[$c->[0]-1] = "H,$c->[2],[000000]"; |
27
|
2
|
|
|
|
|
8
|
for(my $i = $c->[0]; $i < $c->[1]; $i++) { |
28
|
2
|
|
|
|
|
6
|
$track[$i] = '|H,[000000]'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
2
|
|
|
|
|
98
|
print STDERR "Track length: " . scalar @track, "\n"; |
33
|
2
|
|
|
|
|
39
|
return $track_prefix . join('', @track) . '|'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub annotation_track { |
39
|
|
|
|
|
|
|
# array [[start,end,name], ...] |
40
|
1
|
|
|
1
|
0
|
49
|
my ($self,$s) = @_; |
41
|
1
|
|
|
|
|
4
|
my $an = "JALVIEW_ANNOTATION\n\n"; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
6
|
$an .= "SEQUENCE_REF\t" . $self->sequence->display_id ."\n"; |
44
|
1
|
|
|
|
|
4
|
$an .= $self->track_marks($s) . "\n"; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
6
|
return $an; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |