-
Notifications
You must be signed in to change notification settings - Fork 0
/
PSGs_count.pl
46 lines (46 loc) · 1.04 KB
/
PSGs_count.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
#######@PSGs select count###############
#--------------------------------------#
#######make by Kogoori Masaki###########
#--------------------------------------#
#Example Usage: for i in *.fa.filter.result; do perl PSGs_count.pl $i >> PSGs.count ; done#
use warnings;
open $I,"< $ARGV[0]" or die "no inputfile!";
@gene = <$I>;
@species = ("golani","galili","carmeli","judaei");
@count = 0;
$name = $ARGV[0];
$name =~ s/\.fa\.filter\.result//g;
for($j=0;$j<=$#gene;$j++)
{
for($d=0;$d<=$#species;$d++)
{
if($gene[$j] =~ /\"$species[$d]\"\:\{/)
{
push @count,"$j";
}
}
}
for($f=1;$f<=$#count;$f++)
{
my $a = $count[$f]+2;
my $z = $count[$f]+3;
my $e = $gene[$count[$f]];
$e =~ s/\n//g;
$e =~ s/\:\{//g;
$e =~ s/\"//g;
$pvalue = $gene[$z];
chomp $pvalue;
$pvalue =~ s/\,//g;
$pvalue =~ s/\:/\t/g;
$pvalue =~ s/\"//g;
$omegavalue = $gene[$a];
$omegavalue =~ s/\:/\t/g;
$omegavalue =~ s/\,//g;
$omegavalue =~ s/\"//g;
chomp $omegavalue;
print $name."\t";
print $e;
print $omegavalue."\t";
print $pvalue."\n";
}
close $I;