#!/usr/bin/perl
use Modern::Perl;
use File::Slurp qw/read_file write_file/;
my $uniprot = 'D:ARP\\Downloads\\uniprot-ACN';
my $activin = 'D:ARP\\Downloads\\Activator-Pfam.txt';
my $antioxin = 'D:ARP\\Downloads\\AntiOxidant-PFAM.txt';
my $toxinin= 'D:ARP\\Downloads\\Toxin-PFAM.txt';
my $activout = 'D:ARP\\Downloads\\ActivACNPF.txt';
my $antioxout= 'D:ARP\\Downloads\\AntioxACNPF.txt';
my $toxinout= 'D:ARP\\Downloads\\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;
for ( read_file $uniprot ) {
next unless /(.{6})\s+.+=([^\s]+)/;
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;
####
Q6GZX4 | PF04947.9
Q96355 | PF01486.12 PF00319.13
Q96356 | PF01486.12 PF00319.13
Q39371 | PF01486.12 PF00319.13
Q84BZ4 | PF12833.2
Q6W4T3 | PF00501.23 PF00668.15 PF00550.20
B4YPW6 | PF01486.12 PF00319.13
Q8GTF5 | PF01486.12 PF00319.13
####
O59734 | Name=smf1; ORFNames=SPBC3E7.14, SPBC4F6.01
Q97W02 | Name=dbh; Synonyms=dpo4; OrderedLocusNames=SSO2448
B0JTM2 | Name=trpC; OrderedLocusNames=MAE_45030
Q0WVE9; Q5XF02; Q9ZVN7 | OrderedLocusNames=At1g05030; ORFNames=T7A14.10
Q15X31 | Name=rraB; OrderedLocusNames=Patl_1031
Q66640 | Name=36
Q9F2S0 | Name=hemL; OrderedLocusNames=SCO4469; ORFNames=SCD65.12
A9R5H1 | Name=dctA; OrderedLocusNames=YpAngola_A4067
Q7N3W0 | Name=rnt; OrderedLocusNames=plu2603
Q6GNW0 | Name=lrrfip2
Q4L4T4 | OrderedLocusNames=SH2032
B7I359 | Name=rplL; OrderedLocusNames=AB57_0368
B2HII2 | Name=leuD; OrderedLocusNames=MMAR_1727