#For now take primary or duplicates and only matches which correspond to more than 25% of the external peptide. These criteria will have to be lowered up.
#If the external peptide correspond to an embl clone, we will take the match only if the Ensembl peptide correspond to the same clone (at least one exon)
if($sp2embl{$xr}){
print"$xr\t".@{$sp2embl{$xr}}."\n";
my$tot_sp_embl;
my$tot_ens_embl;
my@sp_embl=@{$sp2embl{$xr}};
foreachmy$sing1(@sp_embl){
#print "$sing1\n";
$tot_sp_embl.=$sing1;
}
#if ($sp2embl{$xr}) {
# print "$xr\t".@{$sp2embl{$xr}}."\n";
# my $tot_sp_embl;
# my $tot_ens_embl;
# my @sp_embl = @{$sp2embl{$xr}};
# foreach my $sing1 (@sp_embl) {
# #print "$sing1\n";
# $tot_sp_embl .= $sing1;
# }
if($ens2embl{$enst}){
my@ens_embl=@{$ens2embl{$enst}};
# if ($ens2embl{$enst}) {
# my @ens_embl = @{$ens2embl{$enst}};
foreachmy$sing2(@sp_embl){
$tot_ens_embl.=$sing2;
}
if($tot_ens_embl=~$tot_sp_embl){
printOUT"$ens\t$map{$xr}\t$xr\n";
}
else{
#print "no\n";
}
}
}
else{
# foreach my $sing2 (@sp_embl) {
# $tot_ens_embl .= $sing2;
# }
# if ($tot_ens_embl =~ $tot_sp_embl) {
# print OUT "$ens\t$map{$xr}\t$xr\n";
# }
# else {
# #print "no\n";
# }
# }
#}
#else {
#Print the know gene AC and its database
#print OUT "$ens\t$map{$xr}\t$xr\n";
#}
printOUT"$ens\t$map{$xr}\t$xr\n";
}
#Print all of the external database it links to (eg: HUGO)
foreachmy$both(@{$hash{$xr}}){
($a,$b)=split(/:/,$both);
printOUT"$ens\t$a\t$b\n";
}
#Print all of the external database it links to (eg: HUGO)