# HG changeset patch # User estrain # Date 1580391743 18000 # Node ID abe5635dd8462c2fe19b53fc9f2c54f070467d4e # Parent 834e31c6e4e581dd6326ea0732bede30e122dcd3 Uploaded diff -r 834e31c6e4e5 -r abe5635dd846 amrformat.pl --- a/amrformat.pl Thu Jan 30 08:42:12 2020 -0500 +++ b/amrformat.pl Thu Jan 30 08:42:23 2020 -0500 @@ -13,16 +13,16 @@ chomp(); @vals=split(/\t/,$_); @els=split(/\_/,$vals[0]); - if(exists $iso_hash{$els[0]}){ - $iso_hash{$els[0]}="$iso_hash{$els[0]} $vals[1]"; - } else { - $iso_hash{$els[0]}=$vals[1]; - } + $iso_hash{$els[0]}{$vals[1]}=1; } print OUT "Source.Name\tGene symbol\n"; foreach(sort keys %iso_hash){ - print OUT $_,"\t",$iso_hash{$_},"\n"; + print OUT $_; + foreach my $gene (sort keys %{$iso_hash{$_}}){ + print OUT " ",$gene; + } + print OUT "\n"; }