5 use Time
::HiRes qw
( gettimeofday tv_interval
);
8 #use Fcntl qw(:DEFAULT :flock);
13 our($opt_i, $opt_o, $opt_v,$opt_b);
16 \t-i Annotation files list (./anno.lst) [ID\\tPath_to_file\\n]
17 \t-o Output mixed file (mixed_annot.txt)
18 \t-v show verbose info to STDOUT
19 \t-b No pause for batch runs
21 # \t-d dbSNP SQLite data file (_tdbSNP.sqlite)
25 $opt_i='./anno.lst' if ! defined $opt_i;
26 $opt_o='mixed_annot.txt' if ! $opt_o;
28 print STDERR
"From [$opt_i] to [$opt_o]\n";
29 if (! $opt_b) {print STDERR
'press [Enter] to continue...'; <>;}
31 my $start_time = [gettimeofday
];
34 open( SAMP
,'<',$opt_i) or die "Error: $!\n";
35 open( OUT
,'>',$opt_o) or die "Error: $!\n";
39 my ($id,$file)=split /\s+/;
42 ++$Keys{$_} for keys %dat;
43 push @Annots,[$id,\
%dat];
44 print OUT
"\t$id\t${id}_nfo";
50 my( $file ,$hash) = @_;
51 open (F
,"$file") or die $!;
54 my($key,$a,$b)=split /\s+/,$_,3;
59 #print "$key\t$value\n";
60 $$hash{$key} = $value;
66 for my $gene (sort keys %Keys) {
69 my ($id,$dathash)=@
$_;
70 my $v=(defined $$dathash{$gene})?
$$dathash{$gene}:".\t.";
78 my $stop_time = [gettimeofday
];
80 print STDERR
"\n Time Elapsed:\t",tv_interval
( $start_time, $stop_time )," second(s)\n";
82 print STDERR
"\033[32;1mgrep -i 'transcription factor' mixed_annot.txt > out\033[0;0m\n";