view amrformat.pl @ 5:0b342ec0b33d

Uploaded
author estrain
date Wed, 29 Jan 2020 21:10:23 -0500
parents 514bd7256422
children abe5635dd846
line wrap: on
line source
#!/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";
}