-
Notifications
You must be signed in to change notification settings - Fork 0
/
runASATP.pl
127 lines (78 loc) · 3.56 KB
/
runASATP.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env perl
=head2 NAME
Run Alternative splicing Analysis Tool Package.
=head2 SYNOPSIS
Usage: perl runASATP.pl --gtf <gtf file> --trExpFile <transcript_expression_file> --output <output_folder> [--graph no] [--graphFormat SVG]
Options:
-help|h
--gtf STRING Input gtf format file.
--output STRING Output folder.
--trExpFile STRING A file with expression levels of transcripts in different samples.
--graph no|yes Create graph or not. default [no]
--graphFormat SVG|png Graph format. default [SVG]
Note:
"--gtf" input file should contain CDS annotation.
"--trExpFile" input file format (column separated by Tab):
Gene Transcript Sample1 Sample2 ...
g1 tr1 0.5 20 ...
g1 tr2 53 19 ...
=head2 AUTHOR
Zhigang Li lzg0063(at)126.com 2014-10-30
=cut
################################################################################
# Options
################################################################################
BEGIN { use FindBin qw($Bin); use lib "$Bin"; }
use 5.010;
use strict;
#use warnings;
use Getopt::Long;
use Pod::Usage;
use lib::basic qw(logMsg logError logWarn logStd);
#use Data::Dumper;
#parameters
my ( $gtfFile, $expFile, $outputFolder ) = @ARGV;
my $outGraph = 'no'; #whether output graph
my $graphFormat = 'svg';
#help
if ( !@ARGV ) {
pod2usage( -noperldoc => 1, -verbose => 2 );
exit(0);
}
Getopt::Long::GetOptions(
"help|h" => sub { pod2usage( -noperldoc => 1, -verbose => 2 ); exit(0); },
"gtf=s" => \$gtfFile,
'graph=s' => \$outGraph,
'graphFormat=s' => \$graphFormat,
'trExpFile=s' => \$expFile,
'output=s' => \$outputFolder,
);
################################################################################
# Main
################################################################################
&logMsg("Starting...");
# check output fold
&lib::basic::checkFold( $outputFolder, 1 );
&logMsg("Running ASRecovist...");
my $asrecovistOut = $outputFolder . '/' . 'ASRecovist_out';
&logStd("perl $Bin/ASRecovist.pl --gtf $gtfFile --output $asrecovistOut --graph $outGraph --graphFormat $graphFormat");
my @arg = system("perl $Bin/ASRecovist.pl --gtf $gtfFile --output $asrecovistOut --graph $outGraph --graphFormat $graphFormat");
exit(1) if($? != 0);
########################################
&logMsg("Running ASAffectORF...");
my $asaffectOut = $outputFolder . '/' . 'ASAffectORF_out';
&logStd("perl $Bin/ASAffectORF.pl --gtf $gtfFile --asEvent $asrecovistOut/AS_event.xls --output $asaffectOut");
system("perl $Bin/ASAffectORF.pl --gtf $gtfFile --asEvent $asrecovistOut/AS_event.xls --output $asaffectOut");
exit(1) if($? != 0);
########################################
&logMsg("Running ASQuantityDiff...");
my $asquanOut = $outputFolder . '/' . 'ASQuantityDiff_out';
&logStd("perl $Bin/ASQuantityDiff.pl --asEvent $asaffectOut/ASAffectORF_event.xls --asGroup $asrecovistOut/AS_event_group.xls --trExpFile $expFile --output $asquanOut");
system(
"perl $Bin/ASQuantityDiff.pl --asEvent $asaffectOut/ASAffectORF_event.xls --asGroup $asrecovistOut/AS_event_group.xls --trExpFile $expFile --output $asquanOut"
);
exit(1) if($? != 0);
&logMsg("Finishing...");
################################################################################
# Subroutines
################################################################################