[Bioperl-l] Writing and retrieving Genbank files from BioSQL

Rik Rademaker hendrik.rademaker at gmail.com
Mon Apr 21 14:55:41 UTC 2014


Dear all,

I am a biologist trying to write genbank files to bioSQL. I am comfortable 
in writing python scripts but there is a problem with BioPython and that 
is  that the molecule type in the locus line is lost (eg 'circular DNA' 
becomes just 'DNA'). I am now trying to figure out how BioPerl is doing 
this and how BioPerl is writing this information to BioSQL.

I have a BioSQL database (MySQL) and I can commit to BioSQL eg via this 
program:
#!/usr/bin/perl
 
use strict;

use Bio::DB::BioDB; 
use Bio::DB::GenBank;

#Load Genbank file
my $genbank_id = 'L08752';

my $genDB = new Bio::DB::GenBank;
my $sequence = $genDB->get_Seq_by_id($genbank_id);

my $db=Bio::DB::BioDB->new(-database => 'BioSQL',
                           -user => 'root',
                           -dbname => 'bioseqdb',
                           -host => 'localhost',
                           -driver => 'mysql');

my $pobj = $db->create_persistent($sequence);
$pobj->create();
$pobj->commit();

This works and I see the data appearing in BioSQL.

I am having  hard time to figure out how to retrieve the sequence object 
from BioSQL and to write it back to a genbank on harddisk.
Could someone give me some suggestions?

I would like to know if BioPerl is capable to maintain the 'circular' 
property in the locus line after the data has been exported to and 
retrieved from BioSQL. Sofar,  I have not identified tables/fields that 
store the circular property. Next step would to implement this behavior in 
BioPython for which I already contacted Peter Cock. 

Kind regards, Rik.



More information about the Bioperl-l mailing list