#!/usr/bin/perl -w die "USage\n\tperl $0 gene_protein pep.fa > pep_geneid.fa\n" unless(@ARGV==2); open IN1, $ARGV[0]||die $!; open IN2,$ARGV[1]||die $!; my %hash; while(){ chomp; next if(/^\s*$/); my @a=split/\t/,$_; $hash{$a[1]}=$a[0]; } while(){ chomp; next if(/^\s*$/); #next unless(/^>/); if(/^>/){ $_=~s/^>//; print ">$hash{$_}\n"; }else{ print "$_\n"; } } close IN1; close IN2;