-
Notifications
You must be signed in to change notification settings - Fork 1
/
prediction_keeper.pl
executable file
·60 lines (50 loc) · 1.59 KB
/
prediction_keeper.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
#!/usr/bin/perl -w
use strict;
use lib ('/sonas-hs/ware/hpc/home/mcampbel/lib');
use PostData;
use Getopt::Std;
use vars qw($opt_i $opt_e $opt_g $opt_p $opt_c $opt_m $opt_u);
getopts('iegpcmu');
use FileHandle;
use common_stuff; #for build_lu
use gff3_annotation_stuff; #for parse_gff
#-----------------------------------------------------------------------------
#----------------------------------- MAIN ------------------------------------
#-----------------------------------------------------------------------------
my $usage = "\n\n\t
\n\n";
my $FILE_1 = $ARGV[0];
my $FILE_2 = $ARGV[1];
die($usage) unless $ARGV[0];
my $LU = common_stuff::build_lu($FILE_1);
#PostData($LU);
parse($FILE_2);
#-----------------------------------------------------------------------------
#---------------------------------- SUBS -------------------------------------
#-----------------------------------------------------------------------------
sub parse{
my $file = shift;
my $fh = new FileHandle;
$fh->open($file);
while (defined(my $line = <$fh>)){
chomp($line);
last if $line =~ /^\#\#FASTA/;
next if $line =~ /^\#/;
my @cols = split(/\t/, $line);
if($cols[1] =~ /^augustus/ ||
$cols[1] =~ /^fgene/ ||
$cols[1] =~ /^pred_gff/){
my $id ='mike';
if($cols[2] eq 'match'){
($id) = $cols[8] =~ /Name=(\S+?);/;
#print $id,"\n";
}
elsif($cols[2] eq 'match_part'){
($id) = $cols[8] =~ /Target=(\S+)/;
}
print "$line\n" if defined($LU->{$id});
}
}
$fh->close();
}
#-----------------------------------------------------------------------------