# Compute emission probability matrix given a input file containing KNOWN homogeneous state sequences

$file=shift;
open in,$file;

my $obssymbols=0;
my $sequences=0;
my %obscounts=();

while(<in>){
chop $_;
@obs=split(//,$_);
$sequences ++;
 foreach $symbol (@obs){
		$obscounts{$symbol}++;
		$obssymbols++;
 }
}
close in;

print "Num. seen sequences:\t$sequences\n\n";
foreach $k (sort(keys(%obscounts))){
	print "$k\t".($obscounts{$k}/$obssymbols)."\t$obscounts{$k}\n";
}