use strict; use Time::HiRes; my $start_time = [Time::HiRes::gettimeofday()]; my (@coordinates,%hash_chr,%HOA,%HOH,%hash_line) = (); open FILE,"GmGm.recent.gff"; while(my $line=){ chomp $line; my %seen = (); if($line=~/^(Gm\d{1,})\trecent_duplication\tsyntenic_region\t(\d{1,})\t(\d{1,})\t.*\tID\=\w{1,}_Gm\d{1,}\.(Gm\d{1,}.*)\;median_Ks=(.*)\;matches\=(Gm\d{1,}\:\d{1,}\.\.\d{1,})/) { my $chr1 = "$1:$2..$3"; my $ks_val = $5; my $chr2 = $6; if ((exists $hash_chr{$chr2})&&($ks_val > 0.4)){ next; } else{ $hash_chr{$chr1}=$chr2; } } } close FILE; #### Gm01 recent_duplication syntenic_region 170877 269340 179 - . ID=A_Gm01.Gm08.2.-;median_Ks=0.1101;matches=Gm08:46288465..46349001 Gm08 recent_duplication syntenic_region 46288465 46349001 179 - . ID=B_Gm01.Gm08.2.-;median_Ks=0.1101;matches=Gm01:170877..269340