Hi all,
I have a multifasta file that has mix of protein amino acid fasta sequences and protein secondary structures fasta sequences.I have made four arrays to put the header lines for amino acid sequences into one array, the header lines of secondary structures into another array, the amino acid sequences into another array, the secondary structures into one array.
My code is:
my @headerseq;
my @headersec;
my @sequence;
my @secseq;
while (<IFILE>) {
chomp;
if ($_ =~ /sequence/){
@headerseq = split('\n',$_);
# print "@headerseq\n";
}
elsif ($_ =~ /secstr/){
@headersec = split ('\n',$_);
# print "@headersec\n";
}
elsif ($_ =~ /^(\w*)$/) {
@sequence = $_;
# print "@sequence\n";
}
else {
@secseq = split ('\n',$_);
# print "@secseq\n";
}
foreach my $headerseq(@headerseq){
foreach my $sequence(@sequence) {
print OFILE1 "$headerseq\n$sequence\n";
}
}
}
However, this foreach loop is not matching the header lines of protein sequences in @headerseq array with the sequences in @sequence array properly.How should I proceed with this?
I want to match the headers of protein seqs with protein sequences in outfile and in another outfile,I wish to match the secondary structures header lines with the Sec str sequences.Thanks..