| |||||
|
I would like to make my own custom fasta header ... To see other biotech frequently asked questions,
please visit http://biotech.fyicenter.com/faq/
(Continued from previous question...) I would like to make my own custom fasta header - how do I do this? You want to use the method use Bio::SeqIO;
my $seqin = Bio::SeqIO->new(-file => $file,
-format => 'genbank');
my $seqout = Bio::SeqIO->new(-fh => \*STDOUT,
-format => 'fasta');
# From Bio::SeqIO::fasta
$seqout->preferred_id_type('display');
my $count = 1;
while (my $seq = $seqin->next_seq) {
# override the regular display_id with your own
$seq->display_id('foo'.$count);
$seqout->write_seq($seq);
$count++;
}
You can pass one of the following values to $seq->desc($some_string);
(Continued on next question...)
Other Frequently Asked Questions
|
||||