-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmultiPathway.pl
More file actions
executable file
·75 lines (59 loc) · 1.28 KB
/
multiPathway.pl
File metadata and controls
executable file
·75 lines (59 loc) · 1.28 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use Getopt::Long;
use Data::Dumper;
use strict;
use File::Glob ':glob';
use File::Basename;
use FindBin qw($RealBin);
my $bin = $RealBin;
my $files = shift;
my @files = split(',', $files);
my $pathdb = shift;
my $Rbin = shift;
foreach my $file (@files) {
my $cmd = "perl $bin/runPathwayEnrichment.pl $file $pathdb $Rbin";
RunCommand($cmd, 0 , 0);
}
exit 0;
sub RunCommand {
my ($command,$noexecute,$quiet) = @_ ;
unless ($quiet){
print STDERR "$command\n\n";
}
unless ($noexecute) {
system($command);
}
}
sub grepGene {
my $line = shift;
my @dummy;
if ($line =~ /function=exonic\;functionalClass=([^\;]+)\;geneName=([\w\.\-\,\;\/]+?)\;[\w\.]+\=/) {
my $g1 = $2;
my $function = $1;
if ($function =~ /^synonymous/ or $function =~ /^nonframeshift/) {
return(@dummy);
} else {
&splitGene($g1);
}
} else {
print STDERR "error:\t\t$_\n";
}
}
sub splitGene {
my $genes = shift;
$genes =~ s/\(.+?\)//g; #remove the splicing parentheses
my @genes = split (/[\;\,]/, $genes);
my %tmp;
foreach my $gene (@genes) {
$tmp{$gene} = "";
}
@genes = keys %tmp;
return(@genes);
}
sub round {
my $number = shift;
my $tmp = int($number);
if ($number >= ($tmp+0.5)){
$tmp++;
}
return $tmp;
}