#!/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
In reply to Re: How to match the sequences with headers
by Cristoforo
in thread How to match the sequences with headers
by anonym
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |