[Bioperl-l] fasta genbank record with gid
Pedro Antonio Reche
reche at research.dfci.harvard.edu
Fri Jun 18 14:24:15 EDT 2004
Hi all,
I am using the following code provided by Jason Stajich to download
genbank fasta records:
#!/usr/sbin/perl -w
#
# How to retrieve GenBank entries over the Web
#
# by Jason Stajich
#
use Bio::DB::GenPept;
use Bio::SeqIO;
my $gb = new Bio::DB::GenPept;
my $seqout = new Bio::SeqIO(-fh => \*STDOUT, -format => 'fasta');
my $seqio = $gb->get_Stream_by_id([ qw( 18606304 )]);
while( defined ($seq = $seqio->next_seq )) {
$seqout->write_seq($seq);
}
When I do this I get the following:
>AAH22894 Thymic stromal lymphopoietin, isoform 2 [Homo sapiens].
MKTKAALAIWCPGYSETQINATQAMKKRRKRKVTTNKCLEQVSQLQGLWRRFNRPLLKQQ
which is nice but I wonder if it will be possible to include the GI
number in the fasta header so that I would get something like this
>18606304|AAH22894 Thymic stromal lymphopoietin, isoform 2 [Homo sapiens].
MKTKAALAIWCPGYSETQINATQAMKKRRKRKVTTNKCLEQVSQLQGLWRRFNRPLLKQQ
Thanks in advance for any help.
Regards,
pdro
More information about the Bioperl-l
mailing list