changeset 0:514bd7256422

Uploaded
author estrain
date Wed, 29 Jan 2020 16:31:13 -0500
parents
children 868e6a44a99f
files amrformat.pl
diffstat 1 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/amrformat.pl	Wed Jan 29 16:31:13 2020 -0500
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+open IN,$ARGV[0];
+
+open OUT,">$ARGV[1]";
+
+my %iso_hash;
+
+## Skip header
+<IN>;
+
+while(<IN>) {
+  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];
+  }
+}
+
+
+print OUT "Source.Name\tGene symbol\n";
+foreach(sort keys %iso_hash){
+  print OUT $_,"\t",$iso_hash{$_},"\n";
+}
+