-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgpeFillFrame.pl
executable file
·52 lines (45 loc) · 1.18 KB
/
gpeFillFrame.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
#!/bin/env perl
use strict;
use 5.010;
use Getopt::Long;
use File::Basename;
use lib dirname $0;
use pm::gpeParser;
my($bin,$help);
GetOptions(
'b|bin' => \$bin,
'h|help' => \$help
)||usage();
usage () if defined $help;
$ARGV[0]='-' unless defined $ARGV[0];
open IN,"$ARGV[0]" or die "Can't open $ARGV[0]:$!";
while(<IN>){
chomp;
my @data_input=split "\t",$_;
my $bin_input=shift @data_input if defined $bin;
my $cds_s=$data_input[5];
my $cds_e=$data_input[6];
my $strand=$data_input[2];
my $exonSs=$data_input[8];
my $exonEs=$data_input[9];
my @exon_Frames=@{&gpeParser::getExonFrames($cds_s, $cds_e, $strand, $exonSs, $exonEs)};
my $exon_Frames=join ",",@exon_Frames;
$data_input[14]=$exon_Frames;
if(defined $bin){
say STDOUT join "\t",($bin_input,@data_input);
}
else{
say STDOUT join "\t",@data_input;
}
}
sub usage{
my $scriptName=basename $0;
print <<HELP;
Usage: perl $scriptName INPUT >OUTPUT
if INPUT not specified, input from STDIN
output from STDOUT
-b --bin Have bin column
-h --help print this help information screen
HELP
exit(-1);
}