2 #use lib "/ifs1/ST_ASMB/USER/huxuesong/public/lib";
5 use Time
::HiRes qw
( gettimeofday tv_interval
);
14 \t-o output prefix (./matrix).{mcount,mratio}
16 our $ARG_DESC='{sam,soap}pe_files';
19 $opt_o='./mchrpos.lst' if ! $opt_o;
21 print STDERR
"From [@ARGV] to [$opt_o]\n";
22 my $start_time = [gettimeofday
];
27 my ($chr,$pos)=split /\s+/;
30 open O
,'>',$opt_o or die "Error: $!\n";
32 for my $chr (sort keys %Dat) {
33 for my $pos (sort {$a<=>$b} keys %{$Dat{$chr}}) {
34 print O
"$chr\t$pos\t$Dat{$chr}{$pos}\n";
35 ++$Stat{$Dat{$chr}{$pos}};
39 print "$_\t$Stat{$_}\n" for sort {$a<=>$b} keys %Stat;
41 my $stop_time = [gettimeofday
];
43 print STDERR
"\nTime Elapsed:\t",tv_interval
( $start_time, $stop_time )," second(s).\n";