[Bioperl-l] Newbie: Format GenBank
adlai burman
adlai at refenestration.com
Wed Sep 23 14:38:32 UTC 2009
I have finally got past two major hurdles (for me) only to get stumped:
1. I have written a perl script that can take a genbank formated text
file as a filehandle and do all sorts of nifty (for me) things with it.
2. I have gotten my BioPerl installation working on a web hosting
service so my advisor can use this through a browser.
BUT the code I have to fetch GB record can print it as a single HTML
line, and what I need is for it to assign the retrieved file to a
scaler variable. I am going blind trying to figure out how access
(not write) the gb file from an SeqIO object and assign it to a
variable.
Here's an example of the code I have going on the server:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use Bio::SeqIO;
use Bio::DB::GenBank;
$genBank = new Bio::DB::GenBank; # This object knows how to talk to
GenBank
my $seq = $genBank->get_Seq_by_acc('DQ897681'); # get a record by
accession
my $seqOut = new Bio::SeqIO(-format => 'genbank');
$seqOut->write_seq($seq);
exit;
where 'DQ897861' will be replaced by a CGI post.
I know that write_seq is not what I need, and I assume that this is a
simple problem but can anyone tell me how to assign the retrieved gb
file to a scaler?
Thanks,
Adlai
More information about the Bioperl-l
mailing list