#!/usr/bin/perl -w

use strict;


my %longitudEST;
open(longEST,"<ESTlongitud");
while (<longEST>){
    my @EST=split /\s+/,$_;
    $longitudEST{$EST[0]}=$EST[1];
}


my %humanhonney;
open(HUHO,"<human_honney.gff");
while (<HUHO>){
    my @humhon=split " ",$_;
    my $ESTid=$humhon[8];
    $ESTid=~ s/\;//;
    #print "$ESTid\n";

    my $ESTstart=$humhon[10];
    $ESTstart=~ s/\;//;
    my $ESTend=$humhon[12];
    $ESTend=~ s/\;//;

    my $coverage = sprintf"%.2f", 100* ($ESTend - $ESTstart + 1)/$longitudEST{$ESTid};

    my $humanid=$humhon[0];

    $humanhonney{$humanid}{$ESTid} = $coverage;

    print "$humanid\t","$ESTid\t","$coverage\n";

}


