-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpathwayDoubleFilter.pl
More file actions
executable file
·34 lines (29 loc) · 1.02 KB
/
pathwayDoubleFilter.pl
File metadata and controls
executable file
·34 lines (29 loc) · 1.02 KB
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
use strict;
my $hyperres = shift;
my $randomres = shift;
my %doublesig;
open IN, "$hyperres";
while ( <IN> ){
chomp;
my ($pathway, $id, $source, $genes, $matchgenes, $ngs, $nquery, $nmatch, $pvalue, $fdr) = split /\t/;
next if ($ngs <= 5);
my $name = join("\t", ($pathway, $id, $source, $genes, $matchgenes, $ngs, $nquery, $nmatch));
$doublesig{$name}{'hyper'} = $fdr;
}
close IN;
open IN, "$randomres";
while ( <IN> ){
chomp;
my ($pathway, $id, $source, $genes, $matchgenes, $ngs, $nquery, $nmatch, $nbetter, $pvalue, $fdr) = split /\t/;
my $name = join("\t", ($pathway, $id, $source, $genes, $matchgenes, $ngs, $nquery, $nmatch));
$doublesig{$name}{'random'} = $fdr;
}
close IN;
foreach my $pname (sort {$doublesig{$a}{'random'} <=> $doublesig{$b}{'random'}} keys %doublesig) {
my $fdrHyper = $doublesig{$pname}{'hyper'};
next if ($doublesig{$pname}{'random'} eq '');
my $fdrRandom = $doublesig{$pname}{'random'};
if ($fdrHyper < 0.02 and $fdrRandom < 0.05){
print "$pname\t$fdrHyper\t$fdrRandom\n";
}
}