#!usr/bin/perl
use strict;
use warnings;
my %id2seq = ();
my $id = 0;
open F,"$ARGV[0]",or die $!;
while(<F>){
chomp;
if($_ =~ /^>(.+)/){
$id++;
s/\[//g; s/\]//g;
my @val = split /\s+/, $_;
my @newval=@val;
shift @newval;
print ">$id [ gene=$val[0] ] [ protein=@newval ]\n";
#$id = $1;
}else{
print "$_\n";
}
}
close F;