annotate RaGOO/Assemblytics_between_alignments.pl @ 13:b9a3aeb162ab draft default tip

Uploaded
author dereeper
date Mon, 26 Jul 2021 18:22:37 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
1 #!/usr/bin/perl -w
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
2
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
3 # Authors: Maria Nattestad and Mike Schatz
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
4 # Email: mnattest@cshl.edu
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
5
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
6 use strict;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
7 my @chromosome_filter_choices = ("all-chromosomes","primary-chromosomes");
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
8 my @longrange_filter_choices = ("include-longrange","exclude-longrange","longrange-only");
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
9 my @output_file_choices = ("bed","bedpe");
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
10
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
11 my $USAGE = "Usage:\nAssemblytics_between_alignments.pl coords.tab minimum_event_size maximum_event_size [@chromosome_filter_choices] [@longrange_filter_choices] [@output_file_choices] > fusions.svs.bedpe ";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
12
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
13 my $coordsfile = shift @ARGV or die $USAGE;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
14 my $minimum_event_size = int(shift @ARGV);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
15 my $maximum_event_size = int(shift @ARGV);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
16 my $chromosome_filter = shift @ARGV or die $USAGE;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
17 my $longrange_filter = shift @ARGV or die $USAGE;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
18 my $output_file = shift @ARGV or die $USAGE;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
19
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
20
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
21
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
22 # How close do alignments have to be in order to call deletions and insertions? (as opposed to contractions and expansions)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
23 my $narrow_threshold = 50;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
24
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
25
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
26
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
27 # Number of basepairs of distance in either the reference or the query before we call an SV long-range
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
28 my $longrange = $maximum_event_size;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
29
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
30
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
31
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
32 # What is the longest two alignments can map apart in the query before we throw the variant between them away?
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
33 my $max_query_dist = 100000;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
34
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
35
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
36
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
37 my %chromosome_filter_choices_hash = map { $_, 1 } @chromosome_filter_choices;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
38 my %longrange_filter_choices_hash = map { $_, 1 } @longrange_filter_choices;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
39 my %output_file_choices_hash = map { $_, 1 } @output_file_choices;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
40
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
41 if ( $chromosome_filter_choices_hash{ $chromosome_filter } && $longrange_filter_choices_hash{ $longrange_filter } && $output_file_choices_hash { $output_file }) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
42 # All is well with the world
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
43 } else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
44 die $USAGE;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
45 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
46
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
47 if ($longrange_filter ne "exclude-longrange" && $output_file eq "bed"){
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
48 die "Cannot output bed while allowing long-range variants\n$USAGE";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
49 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
50
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
51 # open COORDS, "./bin/show-coords -rclHT $deltafile |"
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
52 # or die "Can't process $deltafile ($!)\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
53
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
54 open COORDS, "$coordsfile" or die "Can't process $coordsfile ($!)\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
55
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
56 ##open COORDS, "show-coords -rclHT $deltafile |"
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
57 ## or die "Can't process $deltafile ($!)\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
58
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
59
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
60
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
61 ## Require the flanking alignments are at least this long to call an SV
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
62 ## Note there is no minimum length for fusions, this is determined by how
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
63 ## the delta file was filtered
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
64
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
65 my $MIN_SV_ALIGN = 100;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
66
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
67
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
68 #my $minimum_event_size = 50;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
69 my $approximately_zero = $narrow_threshold;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
70
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
71
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
72 my %alignments;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
73 my $numalignments = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
74
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
75
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
76 while (<COORDS>)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
77 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
78 chomp;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
79 my @vals = split /\s+/, $_;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
80
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
81 my $rid = $vals[6];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
82 my $qid = $vals[7];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
83
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
84 my $a;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
85 $a->{"rstart"} = $vals[0];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
86 $a->{"rend"} = $vals[1];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
87 $a->{"qstart"} = $vals[2];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
88 $a->{"qend"} = $vals[3];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
89 $a->{"rlen"} = $vals[4];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
90 $a->{"qlen"} = $vals[5];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
91 $a->{"rid"} = $vals[6];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
92 $a->{"qid"} = $vals[7];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
93 $a->{"str"} = $_;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
94
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
95 $a->{"qidx"} = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
96
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
97 $a->{"qrc"} = ($a->{"qend"} > $a->{"qstart"}) ? 0 : 1;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
98
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
99 push @{$alignments{$qid}->{$rid}}, $a; # a is a hash with all the info for one alignment
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
100
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
101 $numalignments++;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
102 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
103
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
104
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
105
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
106 my $candidatefusions = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
107 my $candidatesvs = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
108
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
109 my $sv_id_counter = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
110
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
111 my %svstats;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
112
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
113 foreach my $qid (sort keys %alignments) # query name is the key for the alignments hash
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
114 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
115 my @refs = sort keys %{$alignments{$qid}}; # grab all alignments of that query
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
116 my $numref = scalar @refs;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
117
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
118 ## scan for fusions
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
119 # if ($numref > 1) # if query aligns to multiple chromosomes
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
120 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
121 # my $allrefs = join " ", @refs; # join the names together for output
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
122
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
123 # print "== $qid [$numref] $allrefs\n"; # output the names of the chromosomes
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
124 # $candidatefusions++;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
125
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
126 # my $rcnt = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
127 # foreach my $rid (@refs)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
128 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
129 # print "--\n" if ($rcnt > 0);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
130 # $rcnt++;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
131
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
132 # foreach my $a (@{$alignments{$qid}->{$rid}})
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
133 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
134 # my $str = $a->{"str"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
135 # print "$str\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
136 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
137 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
138
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
139 # print "\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
140 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
141
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
142
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
143 ## Resort the alignments by query sort position
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
144 my @qaligns;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
145 foreach my $rid (@refs)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
146 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
147 foreach my $a (@{$alignments{$qid}->{$rid}})
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
148 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
149 push @qaligns, $a;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
150 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
151 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
152
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
153 ## Now record the index of the sorted query indices
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
154 @qaligns = sort { $a->{"qstart"} <=> $b->{"qstart"}} @qaligns;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
155 for (my $i=0; $i < scalar @qaligns; $i++)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
156 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
157 $qaligns[$i]->{"qidx"} = $i;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
158 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
159
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
160 ## scan for SVs
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
161 my $numalign = scalar @qaligns;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
162
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
163 if ($numalign > 1) # if the query has more than 1 alignment
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
164 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
165 ## note skip first one
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
166 for (my $j = 1; $j < $numalign; $j++)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
167 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
168 my $ai = $qaligns[$j-1];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
169 my $aj = $qaligns[$j];
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
170
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
171 my $istr = $ai->{"str"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
172 my $jstr = $aj->{"str"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
173
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
174 # if ($ai->{"rid"} ne $aj->{"rid"})
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
175 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
176 # ## skip the fusions for now #############################################################################################
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
177 # next;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
178 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
179
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
180 my $rid = $ai->{"rid"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
181
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
182 if (($ai->{"rlen"} >= $MIN_SV_ALIGN) &&
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
183 ($aj->{"rlen"} >= $MIN_SV_ALIGN))
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
184 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
185 ## r alignments are always forward, q alignments may be flipped
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
186
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
187 my $rpos;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
188 my $qpos;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
189 my $rdist = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
190 my $qdist = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
191 my $svtype = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
192
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
193 my $chromi = $ai->{"rid"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
194 my $chromj = $aj->{"rid"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
195 my $posi;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
196 my $posj;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
197 my $strandi;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
198 my $strandj;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
199
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
200 $sv_id_counter++;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
201
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
202 if (($ai->{"qrc"} == 0) && ($aj->{"qrc"} == 0))
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
203 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
204 ## ri: [1 - 1000] | j: [2000 - 3000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
205 ## qi: [1 - 1000] | j: [2000 - 3000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
206
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
207 $svtype = "FF";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
208
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
209 $qdist = $aj->{"qstart"} - $ai->{"qend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
210 $rdist = $aj->{"rstart"} - $ai->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
211
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
212 if ($rdist >= 0) { $rpos = sprintf("%s:%d-%d:+", $rid, $ai->{"rend"}, $aj->{"rstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
213 else { $rpos = sprintf("%s:%d-%d:-", $rid, $aj->{"rstart"}, $ai->{"rend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
214
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
215 if ($qdist >= 0) { $qpos = sprintf("%s:%d-%d:+", $qid, $ai->{"qend"}, $aj->{"qstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
216 else { $qpos = sprintf("%s:%d-%d:-", $qid, $aj->{"qstart"}, $ai->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
217
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
218 # When the alignments are forward-forward, the connection point is at the end of the first (i: rend) and at the beginning of the second (j: rstart)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
219 # i + - j
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
220 # ------> -------->
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
221 $posi = $ai->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
222 $posj = $aj->{"rstart"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
223 $strandi = "+";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
224 $strandj = "-";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
225
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
226 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
227 elsif (($ai->{"qrc"} == 1) && ($aj->{"qrc"} == 1))
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
228 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
229 ## ri: [2000 - 3000] | j: [1 - 1000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
230 ## qi: [1000 - 1] | j: [3000 - 2000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
231
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
232 $svtype = "RR";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
233
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
234 $rdist = $ai->{"rstart"} - $aj->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
235 $qdist = $aj->{"qend"} - $ai->{"qstart"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
236
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
237 if ($rdist >= 0) { $rpos = sprintf("%s:%d-%d:+", $rid, $aj->{"rend"}, $ai->{"rstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
238 else { $rpos = sprintf("%s:%d-%d:-", $rid, $ai->{"rstart"}, $aj->{"rend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
239
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
240 if ($qdist >= 0) { $qpos = sprintf("%s:%d-%d:+", $qid, $ai->{"qstart"}, $aj->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
241 else { $qpos = sprintf("%s:%d-%d:-", $qid, $aj->{"qend"}, $ai->{"qstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
242
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
243 # When the alignments are reverse-reverse, the connection point is at the beginning of the first (i: rstart) and at the end of the second (j: rend)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
244 # j + - i
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
245 # <------- <--------
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
246 $posi = $ai->{"rstart"}; # rstart means first reference coordinate, not with respect to the contig
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
247 $posj = $aj->{"rend"}; # rend means last reference coordinate, not with respect to the contig
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
248 $strandi = "-";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
249 $strandj = "+";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
250 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
251 elsif (($ai->{"qrc"} == 0) && ($aj->{"qrc"} == 1))
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
252 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
253 ## ri: [1 - 1000] | j: [2000 - 3000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
254 ## qi: [1 - 1000] | j: [3000 - 2000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
255
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
256 $svtype = "FR";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
257
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
258 $qdist = $aj->{"qend"} - $ai->{"qend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
259 $rdist = $aj->{"rstart"} - $ai->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
260
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
261 if ($rdist >= 0) { $rpos = sprintf("%s:%d-%d:+", $rid, $ai->{"rend"}, $aj->{"rstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
262 else { $rpos = sprintf("%s:%d-%d:-", $rid, $aj->{"rstart"}, $ai->{"rend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
263
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
264 if ($qdist >= 0) { $qpos = sprintf("%s:%d-%d:+", $qid, $ai->{"qend"}, $aj->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
265 else { $qpos = sprintf("%s:%d-%d:-", $qid, $aj->{"qend"}, $ai->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
266
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
267 # When the alignments are forward-reverse, the connection point is at the beginning of the first (i: rstart) and at the end of the second (j: rend)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
268 # i + j +
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
269 # -------> <--------
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
270 $posi = $ai->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
271 $posj = $aj->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
272 $strandi = "+";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
273 $strandj = "+";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
274
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
275 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
276 elsif (($ai->{"qrc"} == 1) && ($aj->{"qrc"} == 0))
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
277 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
278 ## ri: [1 - 1000] | j: [2000 - 3000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
279 ## qi: [1000 - 1] | j: [2000 - 3000] => 1000
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
280
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
281 $svtype = "RF";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
282
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
283 $qdist = $ai->{"qend"} - $aj->{"qend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
284 $rdist = $aj->{"rstart"} - $ai->{"rend"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
285
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
286 if ($rdist >= 0) { $rpos = sprintf("%s:%d-%d:+", $rid, $ai->{"rend"}, $aj->{"rstart"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
287 else { $rpos = sprintf("%s:%d-%d:-", $rid, $aj->{"rstart"}, $ai->{"rend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
288
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
289 if ($qdist >= 0) { $qpos = sprintf("%s:%d-%d:+", $qid, $aj->{"qend"}, $ai->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
290 else { $qpos = sprintf("%s:%d-%d:-", $qid, $ai->{"qend"}, $aj->{"qend"}); }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
291
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
292 # When the alignments are reverse-forward:
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
293 # - i - j
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
294 # <------- -------->
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
295 $posi = $ai->{"rstart"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
296 $posj = $aj->{"rstart"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
297 $strandi = "-";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
298 $strandj = "-";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
299 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
300 else
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
301 {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
302 my $irc = $ai->{"qrc"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
303 my $jrc = $aj->{"qrc"};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
304
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
305 print "ERROR: Unknown SV: $irc $jrc\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
306 print "$istr\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
307 print "$jstr\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
308 die "ERROR: Unknown SV: $irc $jrc\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
309 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
310
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
311 my $totaldist = $rdist + $qdist;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
312 my $typeguess = "";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
313
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
314 my $abs_event_size = abs($rdist-$qdist);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
315
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
316 if ($chromi ne $chromj) { # interchromosomal
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
317 $typeguess = "Interchromosomal";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
318 $rdist = 0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
319 } else { # same chromosome
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
320 if ($strandi eq $strandj) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
321 $typeguess = "Inversion";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
322 $abs_event_size = $rdist;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
323 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
324 elsif ($qdist > $rdist) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
325 # both are significantly negative: (means the size of an overlapping region got larger, so tandem element expansion)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
326 if ($rdist > -1*$approximately_zero && $rdist < $approximately_zero && $qdist > -1*$approximately_zero) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
327 $typeguess = "Insertion";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
328 # split into out of nowhere (rdist ~ 0) vs. rdist is > 0: insertion_in_unmapped_region
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
329 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
330 else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
331 if ($rdist < 0 || $qdist < 0) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
332 $typeguess = "Tandem_expansion";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
333 } else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
334 $typeguess = "Repeat_expansion";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
335 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
336 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
337 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
338 elsif ($qdist < $rdist) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
339 # both are significantly negative: (means the size of an overlapping region got smaller, so tandem element contraction)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
340 if ($rdist > -1*$approximately_zero && $qdist > -1*$approximately_zero && $qdist < $approximately_zero) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
341 $typeguess = "Deletion";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
342 # split into out of nowhere (rdist ~ 0) vs. rdist is > 0: deletion_in_unmapped_region
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
343 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
344 else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
345 if ($rdist < 0 || $qdist < 0) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
346 $typeguess = "Tandem_contraction";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
347 } else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
348 $typeguess = "Repeat_contraction";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
349 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
350 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
351 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
352 else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
353 $typeguess = "None";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
354 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
355
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
356 if ($abs_event_size > $longrange) { # || abs($rdist) > $longrange || abs($qdist) > $longrange
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
357 $typeguess = "Longrange";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
358 if (abs($qdist) > $max_query_dist) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
359 $typeguess = "None";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
360 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
361 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
362 # my $ratio;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
363 # if ($qdist != 0){
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
364 # # $ratio = abs(($rdist/$qdist)-1);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
365 # # if ($ratio < 0.1) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
366 # # $typeguess = "Equilibrium";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
367 # # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
368 # if ($rdist==$qdist || abs($qdist) > $longrange) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
369 # $typeguess = "None";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
370 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
371 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
372 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
373
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
374 # my @chromosome_filter_choices = ("all-chromosomes","primary-chromosomes");
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
375 # my @longrange_filter_choices = ("include-longrange","exclude-longrange");
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
376
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
377 my $chromi_length = length $chromi; # length of the chromosome names: a way to filter to primary chromosomes and cut out alts and patches from the assembly
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
378 my $chromj_length = length $chromj;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
379 if ($typeguess ne "Inversion" && $typeguess ne "None" && $abs_event_size >= $minimum_event_size) { # always required
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
380 if ($chromosome_filter eq "all-chromosomes" || ($chromi_length < 6 && $chromj_length < 6)) { # test for primary chromosomes unless "all-chromosomes" is chosen
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
381 if ($longrange_filter ne "exclude-longrange" || ($typeguess ne "Interchromosomal" && $typeguess ne "Longrange")) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
382 if ($longrange_filter ne "longrange-only" || ($typeguess eq "Interchromosomal" || $typeguess eq "Longrange")) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
383 if ($output_file eq "bedpe") {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
384 print "$chromi\t$posi\t@{[$posi + 1]}\t$chromj\t$posj\t@{[$posj + 1]}\tAssemblytics_b_$sv_id_counter\t$abs_event_size\t$strandi\t$strandj\t$typeguess\t$rdist\t$qdist\t$qpos\t$abs_event_size\t$svtype\tbetween_alignments\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
385 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
386 else {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
387 use List::Util qw(min max);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
388 my $ref_start = min(($posi, $posj));
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
389 my $ref_stop = max(($posi, $posj));
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
390 if ($ref_stop eq $ref_start) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
391 $ref_stop = $ref_start + 1;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
392 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
393 # "chrom","start","stop","name","event.size","strand","event.type","ref.dist","query.dist","contig.name"
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
394 print "$chromi\t$ref_start\t$ref_stop\tAssemblytics_b_$sv_id_counter\t$abs_event_size\t+\t$typeguess\t$rdist\t$qdist\t$qpos\tbetween_alignments\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
395 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
396 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
397 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
398 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
399 #if ($filter_type ~~ ("primary-allsizes","primary-shortrange") {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
400 # && $typeguess ne "Interchromosomal" && $typeguess ne "Inversion" && $chromi_length < 6 && $chromj_length < 6 && $abs_event_size >= $minimum_event_size) {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
401 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
402 $candidatesvs++;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
403 #push @{$svstats{$svtype}}, $totaldist;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
404 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
405 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
406 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
407 }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
408
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
409
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
410
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
411 # print "Processed $numalignments alignments found $candidatefusions fusions and $candidatesvs SVs\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
412 # print STDERR "Processed $numalignments alignments found $candidatefusions fusions and $candidatesvs SVs\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
413
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
414 # foreach my $svtype (keys %svstats)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
415 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
416 # my @events = @{$svstats{$svtype}};
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
417 # my $cnt = scalar @events;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
418
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
419 # my $sum = 0.0;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
420 # foreach my $e (@events)
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
421 # {
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
422 # $sum += $e;
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
423 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
424
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
425 # my $mean = sprintf ("%0.02f", $sum/$cnt);
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
426
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
427 # print "svtype[$svtype]: $cnt $mean\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
428 # print STDERR "svtype[$svtype]: $cnt $mean\n";
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
429 # }
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
430
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
431
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
432
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
433
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
434
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
435
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
436
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
437
b9a3aeb162ab Uploaded
dereeper
parents:
diff changeset
438