comparison amrformat.pl @ 0:514bd7256422

Uploaded
author estrain
date Wed, 29 Jan 2020 16:31:13 -0500
parents
children abe5635dd846
comparison
equal deleted inserted replaced
-1:000000000000 0:514bd7256422
1 #!/usr/bin/perl
2
3 open IN,$ARGV[0];
4
5 open OUT,">$ARGV[1]";
6
7 my %iso_hash;
8
9 ## Skip header
10 <IN>;
11
12 while(<IN>) {
13 chomp();
14 @vals=split(/\t/,$_);
15 @els=split(/\_/,$vals[0]);
16 if(exists $iso_hash{$els[0]}){
17 $iso_hash{$els[0]}="$iso_hash{$els[0]} $vals[1]";
18 } else {
19 $iso_hash{$els[0]}=$vals[1];
20 }
21 }
22
23
24 print OUT "Source.Name\tGene symbol\n";
25 foreach(sort keys %iso_hash){
26 print OUT $_,"\t",$iso_hash{$_},"\n";
27 }
28