forked from ion-beam-breeding/AMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpindel2stat.pl
More file actions
34 lines (30 loc) · 707 Bytes
/
pindel2stat.pl
File metadata and controls
34 lines (30 loc) · 707 Bytes
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
#!/usr/bin/perl
#
open(IN,"$ARGV[0]") or die;
while($line=<IN>) {
chomp($line);
next if ($line =~ /^#/);
@element = split(/\s+/,$line);
next if ($element[0] eq "Mt");
next if ($element[0] eq "Pt");
$info = $element[7];
@ele = split(/\;/,$info);
$svlen = 0;
$svtype = "";
for($i=0; $i<@ele; $i++) {
($item,$val) = split(/\=/,$ele[$i]);
$svlen = abs($val) if ($item eq "SVLEN");
$svtype = $val if ($item eq "SVTYPE");
}
if ($svtype eq "") {
print STDERR "ERROR : $line\n";
exit(-1);
}
$freq1{$svtype} ++;
$freq2{$svtype} ++ if ($svlen >= 10);
}
close IN;
foreach $type (keys %freq1) {
print STDOUT "$type\t$freq1{$type}\t$freq2{$type}\n";
}
exit (0);