in reply to
How to match the sequences with headers
Note how simple the BioPerl solution is.
#!/usr/bin/perl
use strict;
use warnings;
use Bio::SeqIO;
my $in = Bio::SeqIO->new( -file => "933212.txt" ,
-format => 'fasta');
my $out_seq = Bio::SeqIO->new( -file => '>sequence.dat',
-format => 'fasta');
my $out_secstr = Bio::SeqIO->new( -file => '>secstr.dat',
-format => 'fasta');
while ( my $seq = $in->next_seq() ) {
if ($seq->id =~ /sequence$/) {
$out_seq->write_seq($seq);
}
elsif ($seq->id =~ /secstr$/) {
$out_secstr->write_seq($seq);
}
}
Chris