#!/usr/bin/perl -w

use strict;

my %ensmart;
open (ENS,"<ensmart2.txt");
while (<ENS>){
    chomp;
    my ($genid,@anotacion)=split;
    my $anotacion=join"\t",@anotacion;
    push(@{$ensmart{$genid}},$anotacion);
}

my %bestuniqpairs;
open (BUP,"<bestuniqpairs.txt");
while (<BUP>){
    chomp;
    my ($genid,$ESTid)=split;
    my $i=0;
    while ($i < @{$ensmart{$genid}}){
	print "$ESTid\t","$genid\t","$ensmart{$genid}[$i]\n";
	$i=$i+1;
    }
}
      

