in reply to How to match the sequences with headers

while (<IFILE>) { ... elsif ($_ =~ /^(\w*)$/) { @sequence = $_; } ... foreach my $sequence(@sequence) { print OFILE1 "$headerseq\n$sequence\n"; } ... }

I'm not familiar with processing FASTA sequence data, but a couple of things strike me in the code fragment originally posted by anonym:

Replies are listed 'Best First'.
Re^2: How to match the sequences with headers
by anonym (Acolyte) on Oct 23, 2011 at 17:03 UTC

    Thanks for your replies.I did get the two output files now ,one having the headers and associated protein sequences and the other with headers of Sec structures and associated structures.

    if ($_ =~ /sequence/){ @headerseq = split('\n',$_); print OFILE1 "@headerseq\n"; } elsif ($_ =~ /^(\w*)$/){ @sequence = $_; print OFILE1 "@sequence\n"; } elsif ($_ =~ /secstr/) { @headersec = split('\n',$_); print OFILE2 "@headersec\n"; } else { @secseq = $_; print OFILE2 "@secseq\n"; }