changeset 7:abe5635dd846 tip

Uploaded
author estrain
date Thu, 30 Jan 2020 08:42:23 -0500
parents 834e31c6e4e5
children
files amrformat.pl
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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";
 }