push @activline, "$1 | $2 | $activ{$1} \n" if $activ{$1};
push @antioxline, "$1 | $2 | $antiox{$1} \n" if $antiox{$1};
push @toxinline, "$1 | $2 | $toxin{$1} \n" if $toxin{$1};
####
if ($1 eq "E7F888"){print $2;}
####
next unless /(E7F888)\s+.+=([^\s]+)/;
push @activline, "$1 | $2 | $activ{$1} \n" if $activ{$1};
print @activline;
####
#!/usr/bin/perl
use Modern::Perl;
use File::Slurp qw/read_file write_file/;
my $uniprot = 'uniprot-ACN';
my $activin = 'Activator-PFAM.txt';
my $antioxin = 'AntiOxidant-PFAM.txt';
my $toxinin= 'Toxin-PFAM.txt';
my $activout = 'ActivACNPF.txt';
my $antioxout= 'AntioxACNPF.txt';
my $toxinout= 'ToxinACNPF.txt';
my @activline;
my @antioxline;
my @toxinline;
my %activ = map {s/\.\d+//g; /(.+)\s+\|\s+(.+)/ and $1 => $2 } grep /\|\s+\S+/, read_file $activin;
my %antiox = map { s/\.\d+//g; /(.+)\s+\|\s+(.+)/ and $1=>$2; } grep/\|\s+\S+/,read_file $antioxin;
my %toxin = map { s/\.\d+//g; /(.+)\s+\|\s+(.+)/ and $1=>$2; } grep/\|\s+\S+/,read_file $toxinin;
#if (exists $activ{"E7F888"}) {
#print $activ{'E7F888'};}
#else {print "LOL";}
for ( read_file $uniprot ) {
next unless /(.{6})\s+.+=([^\s]+)/;
# if ($1 eq "E7F888"){print $2;}
push @activline, "$1 | $2 | $activ{$1} \n" if $activ{$1};
push @antioxline, "$1 | $2 | $antiox{$1} \n" if $antiox{$1};
push @toxinline, "$1 | $2 | $toxin{$1} \n" if $toxin{$1};
}
print @activline;
write_file $activout, @activline;
write_file $antioxout, @antioxline;
write_file $toxinout, @toxinline;